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

4.104.114.84.95
Last change on this file since bffb938 was bffb938, checked in by Joel Sherrill <joel.sherrill@…>, on 01/20/98 at 19:30:30

Removed PROJECT_HOME and CONFIG_DIR variables.

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