source: rtems/make/compilers/gcc-no_bsp.cfg @ 641982a

4.104.115
Last change on this file since 641982a was 15043ea9, checked in by Joel Sherrill <joel.sherrill@…>, on 09/18/08 at 17:33:55

2008-09-18 Joel Sherrill <joel.sherrill@…>

  • compilers/gcc-no_bsp.cfg, compilers/gcc-target-default.cfg, custom/bare.cfg, custom/c3xsim.cfg, custom/c4xsim.cfg, custom/default.cfg, custom/haleakala.cfg, custom/mbx8xx.cfg, custom/mvme2307.cfg, custom/mvme3100.cfg, custom/mvme5500.cfg, custom/posix.cfg, custom/ss555.cfg, custom/virtex.cfg: Eliminate START_BASE and START_FILE.
  • Property mode set to 100644
File size: 5.5 KB
Line 
1#
2#  $Id$
3#
4# gcc 2.6.x compiler for a "native" nocpu/nobsp system
5# Compiler (and tools) configuration
6#
7
8# Prefix on the installed GNU tools
9#  Just use the native tools
10GNU_TOOLS_PREFIX=
11
12# Additional target names (other than debug)
13TARGET_VARIANTS +=
14
15#
16# Pre-processor defines using the target options header file.
17#
18# Local tailoring (on the command line) can be done by setting XCFLAGS
19# or XCPPFLAGS -- neither of which are never set in the Makefile's
20#
21
22CPPFLAGS=$(CFLAGS) $(XCPPFLAGS) $(DEFINES)
23
24CPLUS_CPPFLAGS=$(CFLAGS) $(XCPPFLAGS) $(DEFINES)
25
26#
27# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V are the values we
28# would want the corresponding macros to be set to.
29#
30# CFLAGS_OPTIMIZE, CFLAGS_DEBUG are set in the leaf
31# Makefiles by the 'debug:' targets to their _V values.
32#
33
34# default flags
35
36#
37#  This contains the compiler options necessary to select the CPU model
38#  and (hopefully) optimize for it.
39#
40CPU_CFLAGS =
41
42CFLAGS_DEFAULT = $(CPU_CFLAGS) -Wall
43
44# optimize flag: typically -0, could use -O4 or -fast
45# -O4 is ok for RTEMS
46CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
47
48# debug flag; typically -g
49CFLAGS_DEBUG_V=-g -Wno-unused
50
51# default is to optimize
52CFLAGS_OPTIMIZE=$(CFLAGS_OPTIMIZE_V)
53
54# dynamic libraries
55CFLAGS_DYNAMIC_V=-fpic
56# ASFLAGS_DYNAMIC_V=
57
58CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) \
59       -I $(PROJECT_INCLUDE)
60
61# List of library paths without -L
62LD_PATHS= $(PROJECT_RELEASE)/lib
63
64# libraries you want EVERYONE to link with
65LD_LIBS=
66
67# ld flag to ensure pure-text
68LDFLAGS_MUST_BE_PURE_V =
69
70# ld flag for [un]shared objects
71LDFLAGS_STATIC_LIBRARIES_V =
72LDFLAGS_SHARED_LIBRARIES_V =
73
74# ld flag for incomplete link
75LDFLAGS_INCOMPLETE = -r
76
77# Special linker options when building lib.so
78LDFLAGS_DYNAMIC_V = ??
79
80# Some dynamic linking systems want the preferred name recorded in the binary
81# ref: src/libxil/Makefile
82LDFLAGS_DYNAMIC_LIBNAME_V = -h $(DYNAMIC_VERSION_LIBNAME)
83
84# ld flags for profiling, debugging
85LDFLAGS_DEBUG_V =
86
87LDFLAGS=$(LDFLAGS_DEBUG) $(LD_PATHS:%=-L %)
88
89#
90# Stuff to clean and clobber for the compiler and its tools
91#
92
93CLEAN_CC = a.out *.o *.BAK
94CLOBBER_CC =
95
96#
97# Client compiler and support tools
98#
99
100CC=gcc
101CXX=$(CC)
102CCC=$(CXX)
103
104# CPP command to write file to standard output
105CPP=$(CC) -E
106
107AS=as
108ASPP=ERROR_NO_ASPP
109
110ASFLAGS=
111
112
113# NOTE: should never use full path .. but there is no guarantee ld, etc
114#       will be in the same directory as gcc.. so hope they are in the path
115#       Don't do this on a real target!!!
116LD=ld
117NM=nm
118AR=ar
119# egrep regexp to ignore symbol table entries in ar archives.
120# Only used to make sure we skip them when coalescing libraries.
121# skip __.SYMDEF and empty names (maybe bug in ranlib??).
122AR_SYMBOL_TABLE="HIGHLY-UNLIKELY-TO-CONFLICT"
123ARFLAGS=ruv
124
125# NOTE: see comment on ld, nm, ar
126SIZE=size
127
128#
129# Command to convert a normal archive to one searchable by $(LD)
130# Not needed on SVR4
131#
132
133MKLIB=echo library is complete:
134
135#
136# How to compile stuff into ${ARCH} subdirectory
137#
138# NOTE: we override COMPILE.c
139#
140
141COMPILE.c=$(CC) $(CFLAGS) $(CPPFLAGS) $(XCFLAGS) -c
142
143${ARCH}/%.o: %.c
144        ${COMPILE.c} -o $@ $<
145
146${ARCH}/%.o: %.cc
147        ${COMPILE.c} -o $@ $<
148
149${ARCH}/%.o: %.S
150        ${COMPILE.c} -DASM -o $@ $<
151
152${ARCH}/%.o: %.s
153        $(CPP) $(CPPFLAGS) - <$*.s  >$(ARCH)/$*.i
154        $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i
155#       $(RM) $(ARCH)/$*.i
156
157# Specify our own default rule for this to prevent having CFLAGS and
158#  CPPFLAGS being passed to linker
159${ARCH}/%: ${ARCH}/%.o
160        ${CC} ${LDFLAGS} -o $@ $@.o ${LD_LIBS}
161
162# Make foo.rel from foo.o
163${ARCH}/%.rel: ${ARCH}/%.o
164        ${LD} $(LDFLAGS_INCOMPLETE) -o $@ $^
165
166# create $(ARCH)/pgm from pgm.sh
167${ARCH}/%: %.sh
168        $(RM) $@
169        $(CP) $< $@
170        $(CHMOD) +x $@
171
172# Dependency files for use by gmake
173# NOTE: we don't put them into $(ARCH)
174#       so that 'make clean' doesn't blow it away
175
176DEPEND=Depends-${ARCH}
177
178CLEAN_DEPEND=$(DEPEND).tmp
179CLOBBER_DEPEND=$(DEPEND)
180
181# We deliberately don't have anything depend on the
182# $(DEPEND) file; otherwise it will get rebuilt even
183# on 'make clean'
184#
185
186depend: $(C_FILES) $(CC_FILES) $(S_FILES)
187ifneq ($(words $(C_FILES) $(CC_FILES) $(S_FILES)), 0)
188#       Use gcc -M to generate dependencies
189#       Replace foo.o with $(ARCH)/foo.o
190#       Replace $(ARCH) value with string $(ARCH)
191#           so that it will for debug cases
192        $(COMPILE.c) -M   $^    |  \
193        $(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
194            -e 's?$(ARCH)/?$$(ARCH)/?'   >$(DEPEND).tmp
195        $(MV) $(DEPEND).tmp $(DEPEND)
196endif
197
198
199# There are currently no required managers.
200MANAGERS_REQUIRED=
201
202# Create a RTEMS executable based on MANAGERS which was set in app's Makefile
203
204MANAGERS_NOT_WANTED=$(filter-out $(MANAGERS), $(MANAGER_LIST))
205MANAGERS_NOT_WANTED:=$(filter-out $(MANAGERS_REQUIRED), $(MANAGERS_NOT_WANTED))
206
207CONSTRUCTOR=
208
209LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name $(GCCSED))
210
211LINK_FILES= \
212    $(CONSTRUCTOR) \
213    $(OBJS) \
214    $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel) \
215    $(LD_LIBS) \
216    $(LIBC_EXTRA_LIBS)  \
217    $(PROJECT_RELEASE)/lib/libtest$(LIBSUFFIX_VA) \
218    $(PROJECT_RELEASE)/lib/librtemsbsp$(LIBSUFFIX_VA) \
219    $(PROJECT_RELEASE)/lib/librtemscpu$(LIBSUFFIX_VA) \
220    $(LIBC_LIBM) $(LIBC_LIBC) $(LIBGCC)
221
222# Here is the rule to actually build a $(ARCH)/foo.exe
223# It also builds $(ARCH)/foo.sr and $(ARCH)/foo.nm
224# Usage ref: src/tests/sptest/sp1/Makefile
225
226# On Solaris at least you need to had /usr/ucblib/libucb.a
227
228define make-exe
229        $(CC) -o $(basename $@).exe $(LINK_FILES) -lc -lm
230        $(NM) -n $(basename $@).exe > $(basename $@).num
231        $(SIZE) $(basename $@).exe
232endef
233
234define make-rel
235        $(LD) $(LDFLAGS_INCOMPLETE) $(XLDFLAGS) -o $@ $(OBJS)
236endef
Note: See TracBrowser for help on using the repository browser.