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

4.104.114.84.9
Last change on this file since 9e4fa6ae was 888622c4, checked in by Ralf Corsepius <ralf.corsepius@…>, on Jun 6, 2003 at 4:39:43 AM

2003-06-06 Ralf Corsepius <corsepiu@…>

PR 321:

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