source: rtems/make/compilers/gcc-no_bsp.cfg @ 93f79c0f

4.104.114.84.95
Last change on this file since 93f79c0f was 93f79c0f, checked in by Joel Sherrill <joel.sherrill@…>, on 05/08/01 at 22:59:25

2001-05-07 Ralf Corsepius <corsepiu@…>

  • leaf.cfg: Remove CFLAGS_DEBUG_OPTIMIZE_V.
  • compilers/gcc-no_bsp.cfg: Remove CPP_CC_FLAGS.
  • compilers/gcc-portsw.cfg: Remove CPP_CC_FLAGS.
  • compilers/gcc-target-default.cfg: Remove *_DEBUG_OPTIMIZE_*-flags, remove unused flags, remove -ansi from CPP.
  • custom/eth_comm.cfg: Remove CPU_DEFINES.
  • custom/sim68000.cfg: Remove CPU_DEFINES.
  • Property mode set to 100644
File size: 7.0 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, profile)
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#  This section makes the target dependent options file.
27
28#  NDEBUG (C library)
29#     if defined asserts do not generate code.  This is commonly used
30#     as a command line option.
31#
32#  RTEMS_TEST_NO_PAUSE (RTEMS tests)
33#     do not pause between screens of output in the rtems tests
34#
35#  NO_TABLE_MOVE (SPARC PORT)
36#     do not have a second trap table -- use the BSP's
37#
38#  STACK_CHECKER_ON (RTEMS support code)
39#     If defined, stack bounds checking is enabled.
40#
41#  RTEMS_DEBUG (RTEMS)
42#     If defined, debug checks in RTEMS and support library code are enabled.
43
44define make-target-options
45        echo "/* #define NDEBUG 1 */ "                     >>$@
46        echo "#define RTEMS_TEST_NO_PAUSE 1"               >>$@
47        echo "/* #define STACK_CHECKER_ON  1 */"           >>$@
48        echo "/* #define RTEMS_DEBUG  1 */"                >>$@
49endef
50
51#
52# Local tailoring (on the command line) can be done by setting XCFLAGS
53# which is never set in the Makefile's
54#
55
56#
57# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V, CFLAGS_PROFILE_V are the values we
58# would want the corresponding macros to be set to.
59#
60# CFLAGS_OPTIMIZE, CFLAGS_DEBUG, CFLAGS_PROFILE are set in the leaf
61# Makefiles by the 'debug:' and 'profile:' targets to their _V values.
62#
63
64# default flags
65
66#
67#  This contains the compiler options necessary to select the CPU model
68#  and (hopefully) optimize for it.
69#
70CPU_CFLAGS =
71
72CFLAGS_DEFAULT = $(CPU_CFLAGS) -Wall
73
74# optimize flag: typically -0, could use -O4 or -fast
75# -O4 is ok for RTEMS
76CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
77
78# debug flag; typically -g
79CFLAGS_DEBUG_V=-g -Wno-unused
80
81# profile flag; use gprof(1)
82CFLAGS_PROFILE_V=-pg
83
84# default is to optimize
85CFLAGS_OPTIMIZE=$(CFLAGS_OPTIMIZE_V)
86
87# dynamic libraries
88CFLAGS_DYNAMIC_V=-fpic
89# ASFLAGS_DYNAMIC_V=
90
91CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE) \
92       -I $(PROJECT_INCLUDE)
93
94# List of library paths without -L
95LD_PATHS= $(PROJECT_RELEASE)/lib
96
97# libraries you want EVERYONE to link with
98LD_LIBS=
99
100# ld flag to ensure pure-text
101LDFLAGS_MUST_BE_PURE_V =
102
103# ld flag for [un]shared objects
104LDFLAGS_STATIC_LIBRARIES_V =
105LDFLAGS_SHARED_LIBRARIES_V =
106
107# ld flag for incomplete link
108LDFLAGS_INCOMPLETE = -r
109
110# Special linker options when building lib.so
111LDFLAGS_DYNAMIC_V = ??
112
113# Some dynamic linking systems want the preferred name recorded in the binary
114# ref: src/libxil/Makefile
115LDFLAGS_DYNAMIC_LIBNAME_V = -h $(DYNAMIC_VERSION_LIBNAME)
116
117# ld flags for profiling, debugging
118LDFLAGS_PROFILE_V =
119LDFLAGS_DEBUG_V =
120
121LDFLAGS=$(LDFLAGS_PROFILE) $(LDFLAGS_DEBUG) $(LD_PATHS:%=-L %)
122
123#
124# Stuff to clean and clobber for the compiler and its tools
125#
126
127CLEAN_CC = a.out *.o *.BAK
128CLOBBER_CC =
129
130#
131# Client compiler and support tools
132#
133
134CC=gcc
135CXX=$(CC)
136CCC=$(CXX)
137
138# CPP command to write file to standard output
139CPP=$(CC) -E
140
141AS=as
142ASPP=ERROR_NO_ASPP
143
144ASFLAGS=
145
146
147# NOTE: should never use full path .. but there is no guarantee ld, etc
148#       will be in the same directory as gcc.. so hope they are in the path
149#       Don't do this on a real target!!!
150LD=ld
151NM=nm
152AR=ar
153# egrep regexp to ignore symbol table entries in ar archives.
154# Only used to make sure we skip them when coalescing libraries.
155# skip __.SYMDEF and empty names (maybe bug in ranlib??).
156AR_SYMBOL_TABLE="HIGHLY-UNLIKELY-TO-CONFLICT"
157ARFLAGS=ruv
158
159# NOTE: see comment on ld, nm, ar
160SIZE=size
161
162#
163# Command to convert a normal archive to one searchable by $(LD)
164# Not needed on SVR4
165#
166
167MKLIB=echo library is complete:
168
169#
170# How to compile stuff into ${ARCH} subdirectory
171#
172# NOTE: we override COMPILE.c
173#
174
175COMPILE.c=$(CC) $(CFLAGS) $(CPPFLAGS) $(XCFLAGS) -c
176
177${ARCH}/%.o: %.c
178        ${COMPILE.c} -o $@ $<
179
180${ARCH}/%.o: %.cc
181        ${COMPILE.c} -o $@ $<
182
183${ARCH}/%.o: %.S
184        ${COMPILE.c} -DASM -o $@ $<
185
186${ARCH}/%.o: %.s
187        $(CPP) $(CPPFLAGS) - <$*.s  >$(ARCH)/$*.i
188        $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i
189#       $(RM) $(ARCH)/$*.i
190
191# Specify our own default rule for this to prevent having CFLAGS and
192#  CPPFLAGS being passed to linker
193${ARCH}/%: ${ARCH}/%.o
194        ${CC} ${LDFLAGS} -o $@ $@.o ${LD_LIBS}
195
196# Make foo.rel from foo.o
197${ARCH}/%.rel: ${ARCH}/%.o
198        ${LD} $(LDFLAGS_INCOMPLETE) -o $@ $^
199
200# create $(ARCH)/pgm from pgm.sh
201${ARCH}/%: %.sh
202        $(RM) $@
203        $(CP) $< $@
204        $(CHMOD) +x $@
205
206# Dependency files for use by gmake
207# NOTE: we don't put them into $(ARCH)
208#       so that 'make clean' doesn't blow it away
209
210DEPEND=Depends-${ARCH}
211
212CLEAN_DEPEND=$(DEPEND).tmp
213CLOBBER_DEPEND=$(DEPEND)
214
215# We deliberately don't have anything depend on the
216# $(DEPEND) file; otherwise it will get rebuilt even
217# on 'make clean'
218#
219
220depend: $(C_FILES) $(CC_FILES) $(S_FILES)
221ifneq ($(words $(C_FILES) $(CC_FILES) $(S_FILES)), 0)
222#       Use gcc -M to generate dependencies
223#       Replace foo.o with $(ARCH)/foo.o
224#       Replace $(ARCH) value with string $(ARCH)
225#           so that it will for debug and profile cases
226        $(COMPILE.c) -M   $^    |  \
227        $(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
228            -e 's?$(ARCH)/?$$(ARCH)/?'   >$(DEPEND).tmp
229        $(MV) $(DEPEND).tmp $(DEPEND)
230endif
231
232
233# List (possibly empty) of required managers
234# We require:
235#    region  -- used by lib/libcsupport for malloc()
236#    ext     -- used by libc for libc reentrancy hooks
237
238MANAGERS_REQUIRED=region ext sem
239
240# Create a RTEMS executable based on MANAGERS which was set in
241#  app's Makefile
242
243MANAGERS_NOT_WANTED=$(filter-out $(MANAGERS), $(MANAGER_LIST))
244MANAGERS_NOT_WANTED:=$(filter-out $(MANAGERS_REQUIRED), $(MANAGERS_NOT_WANTED))
245
246# spell out all the LINK_FILE's, rather than using -lbsp, so
247#  that $(LINK_FILES) can be a dependency
248
249# Start file must be one of
250#    $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o
251#    $(PROJECT_RELEASE)/lib/asmiface$(LIB_VARIANT).o
252# It defaults to start.o, but an app can override it.
253
254# Note:  Normally RTEMS provides a start file...
255START_FILE=
256
257CONSTRUCTOR=
258
259LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name $(GCCSED))
260
261LINK_FILES= $(START_FILE) \
262    $(CONSTRUCTOR) \
263    $(OBJS) \
264    $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel) \
265    $(LD_LIBS) \
266    $(LIBC_EXTRA_LIBS)  \
267    $(PROJECT_RELEASE)/lib/libtest$(LIBSUFFIX_VA) \
268    $(PROJECT_RELEASE)/lib/librtemsall$(LIBSUFFIX_VA) \
269    $(LIBC_LIBM) $(LIBC_LIBC) $(LIBGCC)
270
271# Here is the rule to actually build a $(ARCH)/foo.exe
272# It also builds $(ARCH)/foo.sr and $(ARCH)/foo.nm
273# Usage ref: src/tests/sptest/sp1/Makefile
274
275# On Solaris at least you need to had /usr/ucblib/libucb.a
276
277define make-exe
278        $(CC) -o $(basename $@).exe $(LINK_FILES) -lc -lm
279        $(NM) -n $(basename $@).exe > $(basename $@).num
280        $(SIZE) $(basename $@).exe
281endef
282
283define make-rel
284        $(LD) $(LDFLAGS_INCOMPLETE) $(XLDFLAGS) -o $@ $(OBJS)
285endef
Note: See TracBrowser for help on using the repository browser.