source: rtems/c/src/make/compilers/gcc-target-default.cfg @ fb2205a

4.104.114.95
Last change on this file since fb2205a was 0707bd20, checked in by Ralf Corsepius <ralf.corsepius@…>, on 06/06/03 at 02:59:13

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

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