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

4.104.114.84.95
Last change on this file since bffb938 was bffb938, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 20, 1998 at 7:30:30 PM

Removed PROJECT_HOME and CONFIG_DIR variables.

  • Property mode set to 100644
File size: 7.0 KB
Line 
1#
2#
3
4CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
5
6CPLUS_CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
7
8##
9# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V, CFLAGS_PROFILE_V are the values we
10# would want the corresponding macros to be set to.
11#
12# CFLAGS_OPTIMIZE, CFLAGS_DEBUG, CFLAGS_PROFILE are set in the leaf
13# Makefiles by the 'debug:' and 'profile:' targets to their _V values.
14#
15
16# default flags
17
18# We only include the header files for KA9Q if it is enabled.
19INCLUDE_KA9Q_yes_V = -I$(PROJECT_INCLUDE)/ka9q
20INCLUDE_KA9Q = $(INCLUDE_KA9Q_$(HAS_KA9Q)_V)
21
22ifeq ($(RTEMS_USE_GCC272),yes)
23# Ask gcc where it finds its own include files
24GCC_INCLUDE=$(shell $(CC) $(CPU_CFLAGS) -print-file-name=include)
25
26CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
27  -nostdinc -I$(PROJECT_INCLUDE) \
28  $(INCLUDE_KA9Q) \
29  -I$(RTEMS_LIBC_DIR)/include -I$(GCC_INCLUDE) $(DEFINES)
30
31ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g \
32  -nostdinc -I$(PROJECT_INCLUDE) \
33  -I$(RTEMS_LIBC_DIR)/include -I$(GCC_INCLUDE) $(DEFINES)
34
35# default location of Standard C Library
36ifndef LIBC_LIBC
37LIBC_LIBC=$(RTEMS_LIBC_DIR)/lib/libc.a
38endif
39
40ifndef LIBC_LIBM
41LIBC_LIBM=$(RTEMS_LIBC_DIR)/lib/libm.a
42endif
43
44else
45CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
46        -B$(PROJECT_RELEASE)/lib/ -specs bsp_specs -qrtems \
47        $(INCLUDE_KA9Q) $(DEFINES)
48
49ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g -I$(srcdir) \
50        -B$(PROJECT_RELEASE)/lib/ -specs bsp_specs -qrtems $(DEFINES)
51
52# default location of Standard C Library
53ifndef LIBC_LIBC
54LIBC_LIBC=$(shell $(CC) $(CPU_CFLAGS) -print-file-name=libc.a)
55endif
56
57ifndef LIBC_LIBM
58LIBC_LIBM=$(shell $(CC) $(CPU_CFLAGS) -print-file-name=libm.a)
59endif
60endif
61
62# Define this to yes if C++ is included in the development environment.
63# This requires that at least the GNU C++ compiler and libg++ be installed.
64ifeq ($(RTEMS_HAS_CPLUSPLUS),yes)
65HAS_CPLUSPLUS=yes
66CPLUS_LD_LIBS += $(PROJECT_RELEASE)/lib/librtems++$(LIBSUFFIX_VA)
67else
68HAS_CPLUSPLUS=no
69endif
70
71# debug flag; typically -g
72CFLAGS_DEBUG_V+=-g -Wno-unused
73
74# when debugging, optimize flag: typically empty
75# some compilers do allow optimization with their "-g"
76#CFLAGS_DEBUG_OPTIMIZE_V=
77
78# profile flag; use gprof(1)
79CFLAGS_PROFILE_V=-pg
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) $(CFLAGS_PROFILE)
89
90# List of library paths without -L
91LD_PATHS= $(PROJECT_RELEASE)/lib
92
93# libraries you want EVERYONE to link with
94#LD_LIBS=
95
96# ld flag to ensure pure-text
97#LDFLAGS_MUST_BE_PURE_V =
98
99# ld flag for [un]shared objects
100#LDFLAGS_STATIC_LIBRARIES_V =
101#LDFLAGS_SHARED_LIBRARIES_V =
102
103# ld flag for incomplete link
104LDFLAGS_INCOMPLETE = -r
105
106# Special linker options when building lib.so
107LDFLAGS_DYNAMIC_V = ??
108
109# Some dynamic linking systems want the preferred name recorded in the binary
110# ref: src/libxil/Makefile
111LDFLAGS_DYNAMIC_LIBNAME_V = -h $(DYNAMIC_VERSION_LIBNAME)
112
113# ld flags for profiling, debugging
114LDFLAGS_PROFILE_V =
115LDFLAGS_DEBUG_V =
116
117LDFLAGS=$(LDFLAGS_PROFILE) $(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
130# CPP command to write file to standard output
131CPP=$(CC) -E
132
133# flags set by cc when running cpp
134CPP_CC_FLAGS=-D__STDC__
135
136ASFLAGS=
137ASM4FLAGS := -I $(PROJECT_INCLUDE)
138
139# egrep regexp to ignore symbol table entries in ar archives.
140# Only used to make sure we skip them when coalescing libraries.
141# skip __.SYMDEF and empty names (maybe bug in ranlib??).
142AR_SYMBOL_TABLE="HIGHLY-UNLIKELY-TO-CONFLICT"
143ARFLAGS=ruv
144
145#
146# Command to convert a normal archive to one searchable by $(LD)
147# Not needed on SVR4
148#
149
150MKLIB=echo library is complete:
151
152#
153# How to compile stuff into ${ARCH} subdirectory
154#
155# NOTE: we override COMPILE.c
156#
157# NOTE: Remove -pipe if it causes you problems.  Using it can decrease
158#       compile time.
159#
160
161COMPILE.c=$(CC) $(CFLAGS) $(XCFLAGS) -c
162
163${ARCH}/%.o: %.c
164        ${COMPILE.c} -pipe -o $@ $<
165
166${ARCH}/%.o: %.cc
167        ${COMPILE.c} -pipe -o $@ $<
168
169${ARCH}/%.o: %.S
170        ${COMPILE.c} -pipe -DASM -o $@ $<
171
172# strip out C++ style comments.
173${ARCH}/%.o: %.s
174        sed -e 's/\/\/.*$$//' < $< | \
175            $(CPP) $(ASMFLAGS) -I. -I$(srcdir) -DASM - >$(ARCH)/$*.i
176        $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i
177
178#       $(CPP) $(CPPFLAGS) -DASM - < $<  >$(ARCH)/$*.i
179#       $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i
180#       $(RM) $(ARCH)/$*.i
181
182# Specify our own default rule for this to prevent having CFLAGS and
183#  CPPFLAGS being passed to linker
184${ARCH}/%: ${ARCH}/%.o
185        ${CC} ${LDFLAGS} -o $@ $@.o ${LD_LIBS}
186
187# Make foo.rel from foo.o
188${ARCH}/%.rel: ${ARCH}/%.o
189        ${LD} $(LDFLAGS_INCOMPLETE) -o $@ $^
190
191# create $(ARCH)/pgm from pgm.sh
192${ARCH}/%: %.sh
193        $(RM) $@
194        $(CP) $< $@
195        $(CHMOD) +x $@
196
197# Dependency files for use by gmake
198# NOTE: we don't put in $(TARGET_ARCH)
199#       so that 'make clean' doesn't blow it away
200
201DEPEND=Depends-$(TARGET_ARCH:o-%=%)
202
203CLEAN_DEPEND=$(DEPEND).tmp
204CLOBBER_DEPEND=$(DEPEND)
205
206# We deliberately don't have anything depend on the
207# $(DEPEND) file; otherwise it will get rebuilt even
208# on 'make clean'
209#
210
211depend: $(C_FILES) $(CC_FILES) $(S_FILES)
212ifneq ($(words $(C_FILES) $(CC_FILES) $(S_FILES)), 0)
213#       Use gcc -M to generate dependencies
214#       Replace foo.o with $(ARCH)/foo.o
215#       Replace $(ARCH) value with string $(ARCH)
216#           so that it will for debug and profile cases
217        $(COMPILE.c) -M   $^    |  \
218        $(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
219            -e 's?$(ARCH)/?$$(ARCH)/?'   >$(DEPEND).tmp
220        $(MV) $(DEPEND).tmp $(DEPEND)
221endif
222
223
224# List (possibly empty) of required managers
225# We require:
226#    region  -- used by lib/libcsupport for malloc()
227#    ext     -- used by libc for libc reentrancy hooks
228
229MANAGERS_REQUIRED=region ext sem
230
231# Create a RTEMS executable based on MANAGERS which was set in
232#  app's Makefile
233
234MANAGERS_NOT_WANTED=$(filter-out $(MANAGERS), $(MANAGER_LIST))
235MANAGERS_NOT_WANTED:=$(filter-out $(MANAGERS_REQUIRED), $(MANAGERS_NOT_WANTED))
236
237# spell out all the LINK_FILE's, rather than using -lbsp, so
238#  that $(LINK_FILES) can be a dependency
239
240# Start file must be one of
241#    $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o
242#    $(PROJECT_RELEASE)/lib/asmiface$(LIB_VARIANT).o
243# It defaults to start.o, but an app can override it.
244
245ifeq ($(START_BASE),)
246  START_FILE=
247else
248  START_FILE=$(PROJECT_RELEASE)/lib/$(START_BASE)$(LIB_VARIANT).o
249endif
250
251CONSTRUCTOR=
252
253LIBC_LOW=
254
255LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
256
257LINK_OBJS=\
258    $(CONSTRUCTOR) \
259    $(OBJS) \
260    $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel) \
261    $(LD_LIBS) \
262    $(PROJECT_RELEASE)/lib/libtest$(LIBSUFFIX_VA)
263
264LINK_LIBS=\
265    $(LD_LIBS) \
266    $(LIBC_EXTRA_LIBS)  \
267    $(PROJECT_RELEASE)/lib/librtemsall$(LIBSUFFIX_VA) \
268    $(LIBC_LIBM) $(LIBC_LIBC) $(LIBGCC)
269
270LINK_FILES=\
271    $(START_FILE) \
272    $(LINK_OBJS) \
273    $(LINK_LIBS)
274
275#
276# Allow user to override link commands (to build a prom image, perhaps)
277#
278ifndef LINKCMDS
279LINKCMDS=$(PROJECT_RELEASE)/lib/linkcmds
280endif
281
282
283define make-rel
284        $(LD) $(LDFLAGS_INCOMPLETE) $(XLDFLAGS) -o $@ $(OBJS)
285endef
Note: See TracBrowser for help on using the repository browser.