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