source: rtems/make/compilers/gcc-no_bsp.cfg @ 6ee6abb

4.104.114.84.95
Last change on this file since 6ee6abb was 092940bd, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 6, 1998 at 5:09:44 PM

Purged references to STACK_CHECKER_REPORT_USAGE

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