source: rtems/make/compilers/gcc-portsw.cfg @ edeed26

4.104.114.84.95
Last change on this file since edeed26 was df49c60, checked in by Joel Sherrill <joel.sherrill@…>, on 06/12/00 at 15:00:15

Merged from 4.5.0-beta3a

  • Property mode set to 100644
File size: 7.8 KB
Line 
1#
2#  gcc-no_bsp.cfg,v 1.13 1995/12/19 19:59:57 joel Exp
3#
4# This is for the amd29k portsw board.
5#
6# THIS IS NOT A GNU TOOLS BASED PORT!!!
7#
8
9# Prefix on the installed GNU tools
10#  Just use the native tools
11GNU_TOOLS_PREFIX=
12
13# Additional target names (other than debug, profile)
14TARGET_VARIANTS +=
15
16#
17# Pre-processor defines.
18# Local tailoring (on the command line) can be done by setting XCPPFLAGS
19# which is never set in the Makefile's
20#
21# Possible defines include:
22#       -DRTEMS_LIBC            using libc bundled with RTEMS
23#       -DRTEMS_NEWLIB          using CYGNUS libc
24#       -DMALLOC_PROVIDED       must be used for newlib reent struct
25
26DEFINES:= $(LIBC_DEFINES)
27
28GCC_INCLUDE=.
29
30#  Note: normally we do not want the standard include files
31#        Also we usually include a "libc_include" directory
32CPPFLAGS=$(XCPPFLAGS) $(DEFINES) \
33  -I$(RTEMS_LIBC_DIR)/include \
34  -I$(PROJECT_INCLUDE) \
35  -I/opt/29k/src/inc
36
37#
38# Local tailoring (on the command line) can be done by setting XCFLAGS
39# which is never set in the Makefile's
40#
41
42#
43# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V, CFLAGS_PROFILE_V are the values we
44# would want the corresponding macros to be set to.
45#
46# CFLAGS_OPTIMIZE, CFLAGS_DEBUG, CFLAGS_PROFILE are set in the leaf
47# Makefiles by the 'debug:' and 'profile:' targets to their _V values.
48#
49
50# default flags
51
52CFLAGS_DEFAULT = -NB -bwc -nocrt0 -Ml -m -g -Hansi -Hon=Pointers_compatible -Hon=Pointers_compatible_with_ints -Dinline= -D___AM29K__ -Hnocopyr
53
54# optimize flag: typically -0, could use -O4 or -fast
55# -O4 is ok for RTEMS
56# -Os to optimize for size
57CFLAGS_OPTIMIZE_V=-Os
58
59# debug flag; typically -g
60CFLAGS_DEBUG_V=-g -O0 -DRTEMS_DEBUG -DSTACK_CHECKER_ON
61
62# profile flag; use gprof(1)
63CFLAGS_PROFILE_V=
64
65# default is to optimize
66CFLAGS_OPTIMIZE=$(CFLAGS_OPTIMIZE_V)
67
68# dynamic libraries
69CFLAGS_DYNAMIC_V=-fpic
70#ASFLAGS_DYNAMIC_V=
71
72CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE)
73
74# List of library paths without -L
75LD_PATHS= $(PROJECT_RELEASE)/lib
76
77# libraries you want EVERYONE to link with
78LD_LIBS=
79
80# ld flag to ensure pure-text
81LDFLAGS_MUST_BE_PURE_V =
82
83# ld flag for [un]shared objects
84LDFLAGS_STATIC_LIBRARIES_V =
85LDFLAGS_SHARED_LIBRARIES_V =
86
87# ld flag for incomplete link
88LDFLAGS_INCOMPLETE = -i
89
90# Special linker options when building lib.so
91LDFLAGS_DYNAMIC_V = ??
92
93# Some dynamic linking systems want the preferred name recorded in the binary
94# ref: src/libxil/Makefile
95LDFLAGS_DYNAMIC_LIBNAME_V = -h $(DYNAMIC_VERSION_LIBNAME)
96
97# ld flags for profiling, debugging
98LDFLAGS_PROFILE_V =
99LDFLAGS_DEBUG_V =
100
101LDFLAGS=$(LDFLAGS_PROFILE) $(LDFLAGS_DEBUG) $(LD_PATHS:%=-L %)
102
103#
104# Stuff to clean and clobber for the compiler and its tools
105#
106
107CLEAN_CC = a.out *.o *.BAK
108CLOBBER_CC =
109
110#
111# Client compiler and support tools
112#
113
114CC=/opt/29k/bin/hc29
115CXX=$(CC)
116CCC=$(CXX)
117
118# CPP command to write file to standard output
119CPP=$(CC) -E
120
121# flags set by cc when running cpp
122CPP_CC_FLAGS=-D__STDC__
123
124AS=/opt/29k/bin/as29
125ASPP=ERROR_NO_ASPP
126
127ASFLAGS=-l -fcgimosx
128
129# NOTE: should never use full path .. but there is no guarantee ld, etc
130#       will be in the same directory as gcc.. so hope they are in the path
131#       Don't do this on a real target!!!
132LD=/opt/29k/bin/ld29
133NM=/opt/29k/bin/nm29
134AR=echo making library
135# egrep regexp to ignore symbol table entries in ar archives.
136# Only used to make sure we skip them when coalescing libraries.
137# skip __.SYMDEF and empty names (maybe bug in ranlib??).
138AR_SYMBOL_TABLE="HIGHLY-UNLIKELY-TO-CONFLICT"
139ARFLAGS=ruv
140
141# NOTE: see comment on ld, nm, ar
142SIZE=size
143
144#
145# Command to convert a normal archive to one searchable by $(LD)
146# Not needed on SVR4
147#
148
149MKLIB=/opt/29k/bin/lib29
150
151#
152# How to compile stuff into ${ARCH} subdirectory
153#
154# NOTE: we override COMPILE.c
155#
156
157COMPILE.c=$(CC) -c $(CFLAGS) $(CPPFLAGS) $(XCFLAGS)
158
159${ARCH}/%.o: %.c
160        ${COMPILE.c} -o $@ $<
161        $(CHMOD) -f g+w $@
162
163${ARCH}/%.o: %.cc
164        ${COMPILE.c} -o $@ $<
165        $(CHMOD) -f g+w $@
166
167${ARCH}/%.o: %.s
168        ${COMPILE.c} -DASM -o $@ $<
169        $(CHMOD) -f g+w $@
170
171${ARCH}/%.o: %.S
172        $(CP) $*.s $(ARCH)/$*.c
173        $(CPP) $(CPPFLAGS) $(ARCH)/$*.c  > $(ARCH)/$*.s
174        ${COMPILE.c} -o $@ $(ARCH)/$*.s
175        $(CHMOD) -f g+w $@
176        $(RM) $(ARCH)/$*.c
177
178# Specify our own default rule for this to prevent having CFLAGS and
179#  CPPFLAGS being passed to linker
180${ARCH}/%: ${ARCH}/%.o
181        ${CC} ${LDFLAGS} -o $@ $@.o ${LD_LIBS}
182        $(CHMOD) -f g+w $@
183
184# Make foo.rel from foo.o
185${ARCH}/%.rel: ${ARCH}/%.o
186        ${LD} $(LDFLAGS_INCOMPLETE) -o $@ $^
187        $(CHMOD) -f g+w $@
188
189# create $(ARCH)/pgm from pgm.sh
190${ARCH}/%: %.sh
191        $(RM) $@
192        $(CP) $< $@
193        $(CHMOD) +x $@
194        $(CHMOD) -f g+w $@
195
196# Dependency files for use by gmake
197# NOTE: we don't put them into $(ARCH)
198#       so that 'make clean' doesn't blow it away
199
200DEPEND=Depends-${ARCH}
201
202CLEAN_DEPEND=$(DEPEND).tmp
203CLOBBER_DEPEND=$(DEPEND)
204
205# We deliberately don't have anything depend on the
206# $(DEPEND) file; otherwise it will get rebuilt even
207# on 'make clean'
208#
209
210depend: $(C_FILES) $(CC_FILES) $(S_FILES)
211ifneq ($(words $(C_FILES) $(CC_FILES) $(S_FILES)), 0)
212#       Use gcc -M to generate dependencies
213#       Replace foo.o with $(ARCH)/foo.o
214#       Replace $(ARCH) value with string $(ARCH)
215#           so that it will for debug and profile cases
216        $(COMPILE.c) -Hmake $^ | \
217            $(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
218                   -e 's?$(ARCH)/?$$(ARCH)/?'   >$(DEPEND).tmp
219
220        $(MV) $(DEPEND).tmp $(DEPEND)
221        $(CHMOD) -f g+w $(DEPEND)
222endif
223
224
225# spell out all the LINK_FILE's, rather than using -lbsp, so
226#  that $(LINK_FILES) can be a dependency
227
228# Start file must be one of
229#    $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o
230#    $(PROJECT_RELEASE)/lib/asmiface$(LIB_VARIANT).o
231# It defaults to start.o, but an app can override it.
232
233# Note:  Normally RTEMS provides a start file...
234START_FILE= $(PROJECT_RELEASE)/lib/crt0$(LIB_VARIANT).o $(PROJECT_RELEASE)/lib/register$(LIB_VARIANT).o
235
236LIBC_LOW=   $(PROJECT_RELEASE)/lib/libcsupport$(LIBSUFFIX_VA)
237
238LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name $(GCCSED))
239
240LIBOSBOOT=/home/src/amd29k/sps2000/netrom.o
241
242LINK_FILES= \
243    $(START_FILE) \
244    $(OBJS) \
245    $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel) \
246    $(PROJECT_RELEASE)/lib/libbsp$(LIBSUFFIX_VA)  \
247    $(LD_LIBS) \
248    $(PROJECT_RELEASE)/lib/libtest$(LIBSUFFIX_VA) \
249    $(PROJECT_RELEASE)/lib/librtems$(LIBSUFFIX_VA) \
250    $(LIBC_LOW) \
251    $(PROJECT_RELEASE)/lib/libmisc$(LIBSUFFIX_VA) \
252    $(LIBC_LIBC) \
253    $(LIBC_EXTRALIBS) \
254    $(LIBC_LIBM)
255#    /home/craigl/osbdbg.o
256
257# Here is the rule to actually build a $(ARCH)/foo.exe
258# It also builds $(ARCH)/foo.sr and $(ARCH)/foo.nm
259# Usage ref: src/tests/sptest/sp1/Makefile
260
261define make-exe
262        if [ $(NO_ROM) ]; then echo "\n\nskipping ROM compile\n"; else  \
263          $(CC) -nocrt0 -cmd$(PROJECT_RELEASE)/lib/romlink -u _times -u _gettimeofday \
264          -u _sleep -o $(basename $@).out $(LIBOSBOOT) $(LINK_FILES); \
265          romcoff -r -t -l -b $(basename $@).out raminit.o; \
266          rm $(basename $@).out; \
267          $(CC) -m -u _times -u _gettimeofday -u _sleep -o $(basename $@).romcof $(LIBOSBOOT) \
268          $(LINK_FILES) raminit.o -nocrt0 -cmd$(PROJECT_RELEASE)/lib/romlink > $(basename $@).rommap ; \
269          rm raminit.o ; \
270          $(CHMOD) -f g+w $(basename $@).romcof; \
271          /opt/green/coff2sr -noS5 $(basename $@).romcof -o $(basename $@).srec; \
272          $(CHMOD) -f g+w $(basename $@).srec; \
273        fi
274        if [ $(CREATE_MAP) ]; then \
275          $(CC) -m -u _times -u _gettimeofday -u _sleep -o $(basename $@).exe $(LINK_FILES) -nocrt0 -cmd$(PROJECT_RELEASE)/lib/ramlink > $(basename $@).rammap; \
276        else \
277          rm $(basename $@).rommap > /dev/null 2> /dev/null ; \
278          $(CC) -u _times -u _gettimeofday -u _sleep -o $(basename $@).exe $(LINK_FILES) -nocrt0 -cmd$(PROJECT_RELEASE)/lib/ramlink; \
279        fi
280        $(CHMOD) -f g+w $(basename $@).exe
281#       $(CC) -o $(basename $@).exe $(LINK_FILES) -nocrt0 -cmd/opt/29k/lib/link030.cmd
282        $(NM) -g $(basename $@).exe > $(basename $@).num
283        $(CHMOD) -f g+w $(basename $@).num
284#       $(SIZE) $(basename $@).exe
285endef
286
287define make-rel
288        $(LD) $(LDFLAGS_INCOMPLETE) $(XLDFLAGS) -o $@ $(OBJS)
289        $(CHMOD) -f g+w $@
290endef
Note: See TracBrowser for help on using the repository browser.