source: rtems/make/compilers/gcc-target-default.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: 5.6 KB
Line 
1#
2#  Shared compiler for all GNU tools configurations
3#
4#  $Id$
5#
6
7##
8# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V are the values we
9# would want the corresponding macros to be set to.
10#
11# CFLAGS_OPTIMIZE, CFLAGS_DEBUG are set in the leaf
12# Makefiles by the 'debug:' targets to their _V values.
13#
14
15# default flags
16# XCPPFLAGS, XCFLAGS, XCXXFLAGS, XASFLAGS
17# are used to add flags from the shell
18# cf. make.info ("Implicit rules/variables" for details)
19
20# NOTE: Should these go to CPPFLAGS ?
21CFLAGS_DEFAULT=-g -Wall
22
23# NOTE: CPU_CFLAGS should probably be renamed to CPU_CPPFLAGS
24# NOTE: CPU_DEFINES should probably be merged with CPU_CFLAGS
25CPPFLAGS += $(CPU_DEFINES) $(CPU_CFLAGS) $(DEFINES) $(XCPPFLAGS)
26CFLAGS   = $(CFLAGS_DEFAULT) $(XCFLAGS)
27CXXFLAGS = $(CFLAGS_DEFAULT) $(XCXXFLAGS)
28ASFLAGS  = $(CPU_ASFLAGS) $(XASFLAGS)
29
30# NOTE: GCCSPECS probably belongs to CPPFLAGS
31# Unfortunately, many custom/*.cfg files do not pass CPPFLAGS
32# to their gcc-2.8 make-exe rules
33GCCSPECS = -B$(PROJECT_RELEASE)/lib/ -specs bsp_specs -qrtems
34 
35CC  += $(GCCSPECS)
36CXX += $(GCCSPECS)
37
38CPPFLAGS += 
39
40# Define this to yes if C++ is included in the development environment.
41# This requires that at least the GNU C++ compiler and libg++ be installed.
42ifeq ($(HAS_CPLUSPLUS),yes)
43CPLUS_LD_LIBS += $(PROJECT_RELEASE)/lib/librtems++$(LIBSUFFIX_VA)
44endif
45
46# debug flag;
47CFLAGS_DEBUG_V+=-Wno-unused
48CXXFLAGS_DEBUG_V+=
49
50CFLAGS_DEBUG_V+=-qrtems_debug
51CXXFLAGS_DEBUG_V+=-qrtems_debug
52
53# when debugging, optimize flag: typically empty
54# some compilers do allow optimization with their "-g"
55CFLAGS_OPTIMIZE_V+=-g
56CXXFLAGS_OPTIMIZE_V+=-g
57
58ifndef AUTOMAKE
59CFLAGS_$(VARIANT)  =$(CFLAGS_$(VARIANT)_V)
60CXXFLAGS_$(VARIANT)=$(CXXFLAGS_$(VARIANT)_V)
61endif
62
63ifndef AUTOMAKE
64CFLAGS   += $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG)
65CXXFLAGS += $(CXXFLAGS_OPTIMIZE) $(CXXFLAGS_DEBUG)
66endif
67
68# List of library paths without -L
69LD_PATHS= $(PROJECT_RELEASE)/lib
70
71# libraries you want EVERYONE to link with
72#LD_LIBS=
73
74# ld flag to ensure pure-text
75#LDFLAGS_MUST_BE_PURE_V =
76
77# ld flag for [un]shared objects
78#LDFLAGS_STATIC_LIBRARIES_V =
79#LDFLAGS_SHARED_LIBRARIES_V =
80
81# ld flag for incomplete link
82LDFLAGS_INCOMPLETE = -r
83
84# Special linker options when building lib.so
85LDFLAGS_DYNAMIC_V = ??
86
87# Some dynamic linking systems want the preferred name recorded in the binary
88# ref: src/libxil/Makefile
89LDFLAGS_DYNAMIC_LIBNAME_V = -h $(DYNAMIC_VERSION_LIBNAME)
90
91# ld flags for profiling, debugging
92LDFLAGS_DEBUG_V = -qrtems_debug
93
94LDFLAGS=$(LDFLAGS_DEBUG) $(LD_PATHS:%=-L %)
95
96#
97# Stuff to clean and clobber for the compiler and its tools
98#
99
100CLEAN_CC = a.out *.o *.BAK
101CLOBBER_CC =
102
103#
104# Client compiler and support tools
105#
106
107# CPP command to write file to standard output
108CPP=$(CC) -E -w -Wp,-$$
109
110# egrep regexp to ignore symbol table entries in ar archives.
111# Only used to make sure we skip them when coalescing libraries.
112# skip __.SYMDEF and empty names (maybe bug in ranlib??).
113AR_SYMBOL_TABLE="HIGHLY-UNLIKELY-TO-CONFLICT"
114ARFLAGS=ruv
115
116#
117# How to compile stuff into ${ARCH} subdirectory
118#
119
120${ARCH}/%.o: %.c
121        ${COMPILE.c} $(AM_CPPFLAGS) $(AM_CFLAGS) -o $@ $<
122
123${ARCH}/%.o: %.cc
124        ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $<
125
126${ARCH}/%.o: %.cpp
127        ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $<
128
129${ARCH}/%.o: %.cxx
130        ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $<
131
132${ARCH}/%.o: %.C
133        ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $<
134
135${ARCH}/%.o: %.S
136        ${COMPILE.S} $(AM_CPPFLAGS) -DASM -o $@ $<
137
138# Make foo.rel from foo.o
139${ARCH}/%.rel: ${ARCH}/%.o
140        ${make-rel}
141
142# create $(ARCH)/pgm from pgm.sh
143${ARCH}/%: %.sh
144        $(RM) $@
145        $(CP) $< $@
146        $(CHMOD) +x $@
147
148# Dependency files for use by gmake
149# NOTE: we don't put them into $(ARCH)
150#       so that 'make clean' doesn't blow it away
151
152DEPEND=Depends-${ARCH}
153
154CLEAN_DEPEND=$(DEPEND).tmp
155CLOBBER_DEPEND=$(DEPEND)
156
157# We deliberately don't have anything depend on the
158# $(DEPEND) file; otherwise it will get rebuilt even
159# on 'make clean'
160#
161
162depend-am: $(C_FILES) $(CC_FILES) $(S_FILES)
163ifneq ($(words $(C_FILES) $(CC_FILES) $(S_FILES)), 0)
164#       Use gcc -M to generate dependencies
165#       Replace foo.o with $(ARCH)/foo.o
166#       Replace $(ARCH) value with string $(ARCH)
167#           so that it will for debug cases
168        $(COMPILE.c) $(AM_CPPFLAGS) $(AM_CFLAGS) -M   $^    |  \
169        $(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
170            -e 's?$(ARCH)/?$$(ARCH)/?'   >$(DEPEND).tmp
171        $(MV) $(DEPEND).tmp $(DEPEND)
172endif
173depend: depend-am
174
175# spell out all the LINK_FILE's, rather than using -lbsp, so
176#  that $(LINK_FILES) can be a dependency
177
178# Start file must be one of
179#    $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o
180#    $(PROJECT_RELEASE)/lib/asmiface$(LIB_VARIANT).o
181# It defaults to start.o, but an app can override it.
182
183ifeq ($(START_BASE),)
184  START_FILE=
185else
186  START_FILE=$(PROJECT_RELEASE)/lib/$(START_BASE)$(LIB_VARIANT).o
187endif
188
189#
190# NOTE: a rule to link an rtems' application should look similar to this
191#       (cf. "make-exe" in make/custom/*.cfg):
192#
193# gcc28:
194# $(PGM): $(LINK_FILES)
195#       $(CC) $(CFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS)
196#
197
198LINK_OBJS =\
199    $(CONSTRUCTOR) \
200    $(OBJS) \
201    $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel)
202
203LINK_FILES =\
204    $(START_FILE) \
205    $(CONSTRUCTOR) \
206    $(OBJS) \
207    $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel) \
208    $(PROJECT_RELEASE)/lib/librtemsbsp$(LIBSUFFIX_VA) \
209    $(PROJECT_RELEASE)/lib/librtemscpu$(LIBSUFFIX_VA)
210
211LINK_LIBS += $(LD_LIBS)   
212
213#
214# Allow user to override link commands (to build a prom image, perhaps)
215#
216ifndef LINKCMDS
217LINKCMDS=$(PROJECT_RELEASE)/lib/linkcmds
218endif
219
220define make-rel
221        $(LINK.c) $(CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \
222          -qnolinkcmds -nostdlib -Wl,-r $(XLDFLAGS) -o $@ $^
223endef
Note: See TracBrowser for help on using the repository browser.