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

4.115
Last change on this file since baa60b5e was baa60b5e, checked in by Sebastian Huber <sebastian.huber@…>, on 02/12/13 at 10:25:25

make: Remove -qrtems_debug flag usage

  • Property mode set to 100644
File size: 4.6 KB
Line 
1#
2#  Shared compiler for all GNU tools configurations
3#
4
5##
6# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V are the values we
7# would want the corresponding macros to be set to.
8#
9# CFLAGS_OPTIMIZE, CFLAGS_DEBUG are set in the leaf
10# Makefiles by the 'debug:' targets to their _V values.
11#
12
13# default flags
14# XCPPFLAGS, XCFLAGS, XCXXFLAGS, XASFLAGS
15# are used to add flags from the shell
16# cf. make.info ("Implicit rules/variables" for details)
17
18# NOTE: Should these go to CPPFLAGS ?
19CFLAGS_DEFAULT=-g -Wall
20
21# NOTE: CPU_CFLAGS should probably be renamed to CPU_CPPFLAGS
22# NOTE: CPU_DEFINES should probably be merged with CPU_CFLAGS
23CPPFLAGS += $(CPU_DEFINES) $(CPU_CFLAGS) $(DEFINES) $(XCPPFLAGS)
24CFLAGS   = $(CFLAGS_DEFAULT) $(XCFLAGS)
25CXXFLAGS = $(CFLAGS_DEFAULT) $(XCXXFLAGS)
26ASFLAGS  = $(CPU_ASFLAGS) $(XASFLAGS)
27
28# NOTE: GCCSPECS probably belongs to CPPFLAGS
29GCCSPECS_OPTIMIZE_V =
30GCCSPECS_DEBUG_V =
31
32GCCSPECS = -B$(PROJECT_RELEASE)/lib/ -specs bsp_specs -qrtems
33GCCSPECS += $(GCCSPECS_$(VARIANT_V)_V)
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+=
51CXXFLAGS_DEBUG_V+=
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# ld flag for incomplete link
72LDFLAGS_INCOMPLETE = -r
73
74# LDFLAGS=$(LDFLAGS_DEBUG) $(LD_PATHS:%=-L%)
75LDFLAGS += $(LDFLAGS_DEBUG)
76
77#
78# Stuff to clean and clobber for the compiler and its tools
79#
80
81CLEAN_CC = a.out *.o *.BAK
82CLOBBER_CC =
83
84#
85# Client compiler and support tools
86#
87
88# CPP command to write file to standard output with warnings suppressed
89CPP=$(CC) -E -w
90
91# egrep regexp to ignore symbol table entries in ar archives.
92# Only used to make sure we skip them when coalescing libraries.
93# skip __.SYMDEF and empty names (maybe bug in ranlib??).
94AR_SYMBOL_TABLE="HIGHLY-UNLIKELY-TO-CONFLICT"
95ARFLAGS=ruv
96
97#
98# How to compile stuff into ${ARCH} subdirectory
99#
100
101${ARCH}/%.o: %.c
102        ${COMPILE.c} $(AM_CPPFLAGS) $(AM_CFLAGS) -o $@ $<
103
104${ARCH}/%.o: %.cc
105        ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $<
106
107${ARCH}/%.o: %.cpp
108        ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $<
109
110${ARCH}/%.o: %.cxx
111        ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $<
112
113${ARCH}/%.o: %.C
114        ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $<
115
116${ARCH}/%.o: %.S
117        ${COMPILE.S} $(AM_CPPFLAGS) -DASM -o $@ $<
118
119# Make foo.rel from foo.o
120${ARCH}/%.rel: ${ARCH}/%.o
121        ${make-rel}
122
123# create $(ARCH)/pgm from pgm.sh
124${ARCH}/%: %.sh
125        $(RM) $@
126        $(CP) $< $@
127        $(CHMOD) +x $@
128
129# Dependency files for use by gmake
130# NOTE: we don't put them into $(ARCH)
131#       so that 'make clean' doesn't blow it away
132
133DEPEND=Depends-${ARCH}
134
135CLEAN_DEPEND=$(DEPEND).tmp
136CLOBBER_DEPEND=$(DEPEND)
137
138# We deliberately don't have anything depend on the
139# $(DEPEND) file; otherwise it will get rebuilt even
140# on 'make clean'
141#
142
143depend-am: $(C_FILES) $(CC_FILES) $(S_FILES)
144ifneq ($(words $(C_FILES) $(CC_FILES) $(S_FILES)), 0)
145#       Use gcc -M to generate dependencies
146#       Replace foo.o with $(ARCH)/foo.o
147#       Replace $(ARCH) value with string $(ARCH)
148#           so that it will for debug cases
149        $(COMPILE.c) $(AM_CPPFLAGS) $(AM_CFLAGS) -M   $^    |  \
150        $(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
151            -e 's?$(ARCH)/?$$(ARCH)/?'   >$(DEPEND).tmp
152        $(MV) $(DEPEND).tmp $(DEPEND)
153endif
154depend: depend-am
155
156# spell out all the LINK_FILE's, rather than using -lbsp, so
157#  that $(LINK_FILES) can be a dependency
158
159#
160# NOTE: a rule to link an rtems' application should look similar to this
161#       (cf. "make-exe" in make/custom/*.cfg):
162#
163# gcc28:
164# $(PGM): $(LINK_FILES)
165#       $(CC) $(CFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS)
166#
167
168LINK_OBJS =\
169    $(CONSTRUCTOR) \
170    $(OBJS)
171
172LINK_FILES =\
173    $(CONSTRUCTOR) \
174    $(OBJS) \
175    $(PROJECT_RELEASE)/lib/librtemsbsp$(LIBSUFFIX_VA) \
176    $(PROJECT_RELEASE)/lib/librtemscpu$(LIBSUFFIX_VA)
177
178LINK_LIBS += $(LD_LIBS)   
179
180#
181# Allow user to override link commands (to build a prom image, perhaps)
182#
183ifndef LINKCMDS
184LINKCMDS=$(PROJECT_RELEASE)/lib/linkcmds
185endif
186
187define make-rel
188        $(LINK.c) $(CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \
189          -qnolinkcmds -nostdlib -Wl,-r $(XLDFLAGS) -o $@ $^
190endef
Note: See TracBrowser for help on using the repository browser.