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

4.104.114.84.95
Last change on this file since 9e4fa6ae was 888622c4, checked in by Ralf Corsepius <ralf.corsepius@…>, on 06/06/03 at 04:39:43

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
RevLine 
[bffb938]1#
[c2c9c7e]2#  Shared compiler for all GNU tools configurations
3#
4#  $Id$
[bffb938]5#
6
7##
[888622c4]8# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V are the values we
[bffb938]9# would want the corresponding macros to be set to.
10#
[888622c4]11# CFLAGS_OPTIMIZE, CFLAGS_DEBUG are set in the leaf
12# Makefiles by the 'debug:' targets to their _V values.
[bffb938]13#
14
15# default flags
[a110b68]16# XCPPFLAGS, XCFLAGS, XCXXFLAGS, XASFLAGS
17# are used to add flags from the shell
18# cf. make.info ("Implicit rules/variables" for details)
19
[4d20133]20# NOTE: Should these go to CPPFLAGS ?
[65e6b542]21CFLAGS_DEFAULT=-g -Wall
[4d20133]22
23# NOTE: CPU_CFLAGS should probably be renamed to CPU_CPPFLAGS
24# NOTE: CPU_DEFINES should probably be merged with CPU_CFLAGS
[9608320]25CPPFLAGS += $(CPU_DEFINES) $(CPU_CFLAGS) $(DEFINES) $(XCPPFLAGS)
[4d20133]26CFLAGS   = $(CFLAGS_DEFAULT) $(XCFLAGS)
27CXXFLAGS = $(CFLAGS_DEFAULT) $(XCXXFLAGS)
[a110b68]28ASFLAGS  = $(CPU_ASFLAGS) $(XASFLAGS)
[bffb938]29
[4cc89bd]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
[72f9937b]38CPPFLAGS +=
[bffb938]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.
[d6c83529]42ifeq ($(HAS_CPLUSPLUS),yes)
[bffb938]43CPLUS_LD_LIBS += $(PROJECT_RELEASE)/lib/librtems++$(LIBSUFFIX_VA)
44endif
45
[98100d2]46# debug flag;
[ac61209b]47CFLAGS_DEBUG_V+=-Wno-unused
[8ef3818]48CXXFLAGS_DEBUG_V+=
[bffb938]49
[a858910]50CFLAGS_DEBUG_V+=-qrtems_debug
[8ef3818]51CXXFLAGS_DEBUG_V+=-qrtems_debug
[a858910]52
[8ef3818]53# when debugging, optimize flag: typically empty
54# some compilers do allow optimization with their "-g"
[c2646c8]55CFLAGS_OPTIMIZE_V+=-g
56CXXFLAGS_OPTIMIZE_V+=-g
[8ef3818]57
[df49c60]58ifndef AUTOMAKE
[c2646c8]59CFLAGS_$(VARIANT)  =$(CFLAGS_$(VARIANT)_V)
60CXXFLAGS_$(VARIANT)=$(CXXFLAGS_$(VARIANT)_V)
[df49c60]61endif
[bffb938]62
[df49c60]63ifndef AUTOMAKE
[888622c4]64CFLAGS   += $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG)
65CXXFLAGS += $(CXXFLAGS_OPTIMIZE) $(CXXFLAGS_DEBUG)
[df49c60]66endif
[bffb938]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
[ccf2cfd]92LDFLAGS_DEBUG_V = -qrtems_debug
[bffb938]93
[888622c4]94LDFLAGS=$(LDFLAGS_DEBUG) $(LD_PATHS:%=-L %)
[bffb938]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
[93f79c0f]108CPP=$(CC) -E -w -Wp,-$$
[bffb938]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
[9608320]121        ${COMPILE.c} $(AM_CPPFLAGS) $(AM_CFLAGS) -o $@ $<
[bffb938]122
123${ARCH}/%.o: %.cc
[9608320]124        ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $<
[bffb938]125
[07001360]126${ARCH}/%.o: %.cpp
[9608320]127        ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $<
[07001360]128
129${ARCH}/%.o: %.cxx
[9608320]130        ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $<
[07001360]131
132${ARCH}/%.o: %.C
[9608320]133        ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $<
[07001360]134
[0162910]135${ARCH}/%.o: %.S
[9608320]136        ${COMPILE.S} $(AM_CPPFLAGS) -DASM -o $@ $<
[4d20133]137
[bffb938]138# Make foo.rel from foo.o
139${ARCH}/%.rel: ${ARCH}/%.o
[df49c60]140        ${make-rel}
[bffb938]141
142# create $(ARCH)/pgm from pgm.sh
[5b8c1b7]143${ARCH}/%: %.sh
[bffb938]144        $(RM) $@
145        $(CP) $< $@
146        $(CHMOD) +x $@
147
148# Dependency files for use by gmake
[d6c83529]149# NOTE: we don't put them into $(ARCH)
[bffb938]150#       so that 'make clean' doesn't blow it away
151
[d6c83529]152DEPEND=Depends-${ARCH}
[bffb938]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
[9f4868c]162depend-am: $(C_FILES) $(CC_FILES) $(S_FILES)
[bffb938]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)
[888622c4]167#           so that it will for debug cases
[df49c60]168        $(COMPILE.c) $(AM_CPPFLAGS) $(AM_CFLAGS) -M   $^    |  \
[bffb938]169        $(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
170            -e 's?$(ARCH)/?$$(ARCH)/?'   >$(DEPEND).tmp
171        $(MV) $(DEPEND).tmp $(DEPEND)
172endif
[9f4868c]173depend: depend-am
[bffb938]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
[98100d2]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)
[30cde042]195#       $(CC) $(CFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS)
[98100d2]196#
197
198LINK_OBJS =\
[bffb938]199    $(CONSTRUCTOR) \
200    $(OBJS) \
[3a8915e]201    $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel)
[bffb938]202
[98100d2]203LINK_FILES =\
[bffb938]204    $(START_FILE) \
[98100d2]205    $(CONSTRUCTOR) \
206    $(OBJS) \
207    $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel) \
[6703f877]208    $(PROJECT_RELEASE)/lib/librtemsbsp$(LIBSUFFIX_VA) \
[88f60e26]209    $(PROJECT_RELEASE)/lib/librtemscpu$(LIBSUFFIX_VA)
[98100d2]210
211LINK_LIBS += $(LD_LIBS)   
[bffb938]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
[ccf2cfd]221        $(LINK.c) $(CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \
[df49c60]222          -qnolinkcmds -nostdlib -Wl,-r $(XLDFLAGS) -o $@ $^
223endef
Note: See TracBrowser for help on using the repository browser.