1 |
39 |
lampret |
# Copyright (c) 1995, 1996, 1997 Cygnus Support
|
2 |
|
|
#
|
3 |
|
|
# The authors hereby grant permission to use, copy, modify, distribute,
|
4 |
|
|
# and license this software and its documentation for any purpose, provided
|
5 |
|
|
# that existing copyright notices are retained in all copies and that this
|
6 |
|
|
# notice is included verbatim in any distributions. No written agreement,
|
7 |
|
|
# license, or royalty fee is required for any of the authorized uses.
|
8 |
|
|
# Modifications to this software may be copyrighted by their authors
|
9 |
|
|
# and need not follow the licensing terms described here, provided that
|
10 |
|
|
# the new terms are clearly indicated on the first page of each file where
|
11 |
|
|
# they apply.
|
12 |
|
|
|
13 |
|
|
# Makefile for libgloss/sparc. This is the board support
|
14 |
|
|
# code for the various sparc targets.
|
15 |
|
|
|
16 |
|
|
VPATH = @srcdir@
|
17 |
|
|
srcdir = @srcdir@
|
18 |
|
|
objdir = .
|
19 |
|
|
srcroot = $(srcdir)/../..
|
20 |
|
|
objroot = $(objdir)/../..
|
21 |
|
|
|
22 |
|
|
prefix = @prefix@
|
23 |
|
|
exec_prefix = @exec_prefix@
|
24 |
|
|
|
25 |
|
|
host_alias = @host_alias@
|
26 |
|
|
target_alias = @target_alias@
|
27 |
|
|
|
28 |
|
|
bindir = @bindir@
|
29 |
|
|
libdir = @libdir@
|
30 |
|
|
tooldir = $(exec_prefix)/$(target_alias)
|
31 |
|
|
|
32 |
|
|
# Multilib support variables.
|
33 |
|
|
# TOP is used instead of MULTI{BUILD,SRC}TOP.
|
34 |
|
|
MULTIDIRS =
|
35 |
|
|
MULTISUBDIR =
|
36 |
|
|
MULTIDO = true
|
37 |
|
|
MULTICLEAN = true
|
38 |
|
|
|
39 |
|
|
INSTALL = @INSTALL@
|
40 |
|
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
41 |
|
|
INSTALL_DATA = @INSTALL_DATA@
|
42 |
|
|
|
43 |
|
|
SHELL = /bin/sh
|
44 |
|
|
|
45 |
|
|
CC = @CC@
|
46 |
|
|
|
47 |
|
|
AS = @AS@
|
48 |
|
|
AR = @AR@
|
49 |
|
|
LD = @LD@
|
50 |
|
|
RANLIB = @RANLIB@
|
51 |
|
|
AR_FLAGS = qrv
|
52 |
|
|
|
53 |
|
|
OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
|
54 |
|
|
then echo ${objroot}/../binutils/objdump ; \
|
55 |
|
|
else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
|
56 |
|
|
OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
|
57 |
|
|
then echo ${objroot}/../binutils/objcopy ; \
|
58 |
|
|
else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
|
59 |
|
|
|
60 |
|
|
CYGMON_CRT0 = cygmon-crt0.o
|
61 |
|
|
CYGMON_BSP = libcygmon.a
|
62 |
|
|
CYGMON_OBJS = cygmon-salib.o
|
63 |
|
|
|
64 |
|
|
701_CRT0 = crt0-701.o
|
65 |
|
|
701_BSP = libsplet701.a
|
66 |
|
|
701_OBJS = sysc-701.o salib-701.o sparclet-stub.o
|
67 |
|
|
|
68 |
|
|
930_BSP = libslite930.a
|
69 |
|
|
931_BSP = libslite931.a
|
70 |
|
|
934_BSP = libslite934.a
|
71 |
56 |
joel |
86X_BSP = libslite86x.a
|
72 |
|
|
|
73 |
39 |
lampret |
# for the time being, built the stub without hardware breakpoint support
|
74 |
56 |
joel |
SLITE_OBJS = salib.o sparcl-stub.o cache.o
|
75 |
39 |
lampret |
|
76 |
|
|
# ERC32: SIS simulator, see sim/erc32.
|
77 |
|
|
ERC32_CRT0 = erc32-crt0.o
|
78 |
|
|
ERC32_BSP = liberc32.a
|
79 |
56 |
joel |
ERC32_OBJS = erc32-io.o traps.o erc32-stub.o debug.o fixctors.o
|
80 |
39 |
lampret |
ERC32_ALL = $(ERC32_CRT0) $(ERC32_BSP)
|
81 |
|
|
|
82 |
|
|
CRT0 = crt0.o
|
83 |
|
|
OBJS = close.o fstat.o getpid.o isatty.o kill.o \
|
84 |
|
|
lseek.o open.o print.o putnum.o read.o sbrk.o stat.o \
|
85 |
|
|
unlink.o write.o
|
86 |
|
|
|
87 |
|
|
# This is set to one of SPARC, SLITE, or SPLET by configure.
|
88 |
|
|
# It's not clear what to do here.
|
89 |
|
|
# One could certainly build everything. The assembler supports all cpu
|
90 |
|
|
# variants (via runtime switches). However, the compiler [currently] doesn't.
|
91 |
|
|
# Of course, it may be the case that there isn't any cpu specific code in
|
92 |
|
|
# C source files, but there might be in the future.
|
93 |
|
|
CPU = @CPU@
|
94 |
|
|
|
95 |
|
|
# sparc stuff (not sparclite or sparclet)
|
96 |
|
|
SPARC_ALL = $(CYGMON_BSP) $(CYGMON_CRT0) $(objdir)/cygmon.ld
|
97 |
|
|
SPARC_INSTALL = sparc-install
|
98 |
|
|
SPARC_OBJ_FORMAT = sparc
|
99 |
|
|
SPARC_RAM_START = 0x4000
|
100 |
|
|
|
101 |
|
|
# sparc 64 stuff
|
102 |
|
|
SPARC64_ALL = $(CYGMON_BSP) $(CYGMON_CRT0) $(objdir)/cygmon.ld
|
103 |
|
|
SPARC64_INSTALL = sparc-install
|
104 |
|
|
SPARC64_OBJ_FORMAT = sparc:v9
|
105 |
|
|
SPARC64_RAM_START = 0x4000
|
106 |
|
|
|
107 |
|
|
# sparclite stuff
|
108 |
56 |
joel |
SLITE_ALL = $(930_BSP) $(931_BSP) $(CYGMON_BSP) $(CYGMON_CRT0) $(objdir)/cygmon.ld $(934_BSP) $(86X_BSP)
|
109 |
39 |
lampret |
SLITE_INSTALL = slite-install
|
110 |
|
|
SLITE_OBJ_FORMAT = sparc
|
111 |
|
|
SLITE_RAM_START = 0x40050000
|
112 |
|
|
|
113 |
|
|
# sparclet stuff
|
114 |
|
|
SPLET_ALL = $(701_CRT0) $(701_BSP)
|
115 |
|
|
SPLET_INSTALL = splet-install
|
116 |
|
|
|
117 |
|
|
#### Host specific Makefile fragment comes in here.
|
118 |
|
|
@host_makefile_frag@
|
119 |
|
|
|
120 |
|
|
all: ${CRT0} $($(CPU)_ALL) $(ERC32_ALL)
|
121 |
|
|
|
122 |
|
|
$(CYGMON_CRT0): cygmon-crt0.S
|
123 |
56 |
joel |
$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) -DTARGET_CPU_$(CPU) $(INCLUDES) -o $@ -c $(srcdir)/cygmon-crt0.S
|
124 |
39 |
lampret |
|
125 |
|
|
$(CYGMON_BSP): $(CYGMON_OBJS)
|
126 |
|
|
@rm -f $@
|
127 |
|
|
${AR} ${AR_FLAGS} $@ $(CYGMON_OBJS)
|
128 |
|
|
${RANLIB} $@
|
129 |
|
|
|
130 |
|
|
#$(STUBLIBS): $(OBJS) $(SLITE_OBJS) $(CRT0)
|
131 |
|
|
# ${CC} -nostdlib -r $(SLITE_OBJS) $(SHARED_OBJS) -o $(930_BSP)
|
132 |
|
|
# ${CC} -DSL931 -nostdlib -r $(SLITE_OBJS) $(SHARED_OBJS) -o $(931_BSP)
|
133 |
|
|
# ${CC} -nostdlib -r $(SLITE_OBJS) $(SHARED_OBJS) -o $(934_BSP)
|
134 |
|
|
|
135 |
|
|
$(CRT0): $(srcdir)/crt0.S $(srcdir)/asm.h $(srcdir)/slite.h
|
136 |
56 |
joel |
$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -o $@ -c $(srcdir)/crt0.S
|
137 |
39 |
lampret |
|
138 |
56 |
joel |
$(930_BSP) $(931_BSP) $(934_BSP) $(86X_BSP): $(OBJS) $(SLITE_OBJS)
|
139 |
39 |
lampret |
@rm -f $@
|
140 |
|
|
${AR} ${AR_FLAGS} $@ $(OBJS) $(SLITE_OBJS)
|
141 |
|
|
${RANLIB} $@
|
142 |
|
|
|
143 |
|
|
$(701_BSP): $(701_OBJS)
|
144 |
|
|
@rm -f $@
|
145 |
|
|
${AR} ${AR_FLAGS} $@ $(701_OBJS)
|
146 |
|
|
${RANLIB} $@
|
147 |
|
|
|
148 |
|
|
erc32-crt0.o: $(srcdir)/erc32-crt0.S $(srcdir)/asm.h $(srcdir)/slite.h
|
149 |
56 |
joel |
$(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -o $@ -c $(srcdir)/erc32-crt0.S
|
150 |
39 |
lampret |
|
151 |
|
|
liberc32.a: $(OBJS) $(ERC32_OBJS)
|
152 |
|
|
@rm -f $@
|
153 |
|
|
${AR} ${AR_FLAGS} $@ $(OBJS) $(ERC32_OBJS)
|
154 |
|
|
${RANLIB} $@
|
155 |
|
|
|
156 |
|
|
crt0-701.o: crt0-701.S
|
157 |
|
|
sysc-701.o: sysc-701.c
|
158 |
|
|
salib-701.o: salib-701.c
|
159 |
|
|
sparclet-stub.o: sparclet-stub.c
|
160 |
|
|
cygmon-salib.o: cygmon-salib.c
|
161 |
56 |
joel |
$(CC) -DTARGET_CPU_$(CPU) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -o $@ -c $(srcdir)/cygmon-salib.c
|
162 |
|
|
cache.o: $(srcdir)/cache.c
|
163 |
39 |
lampret |
salib.o: $(srcdir)/salib.c
|
164 |
|
|
win.o: $(srcdir)/win.S
|
165 |
|
|
syscalls.o: $(srcdir)/syscalls.c
|
166 |
|
|
sparcl-stub.o: $(srcdir)/sparcl-stub.c $(srcdir)/../debug.h $(srcdir)/../debug.c
|
167 |
|
|
erc32-stub.o: $(srcdir)/erc32-stub.c $(srcdir)/../debug.h $(srcdir)/../debug.c
|
168 |
56 |
joel |
fixctors.o : $(srcdir)/fixctors.c
|
169 |
39 |
lampret |
|
170 |
|
|
$(objdir)/cygmon.ld: @CYGMONLDSCRIPTTEMPL@
|
171 |
|
|
sed 's/TARGET_OBJ_FORMAT/$($(CPU)_OBJ_FORMAT)/g;s/TARGET_RAM_START/$($(CPU)_RAM_START)/g;' < $(<) > $(objdir)/cygmon.ld
|
172 |
|
|
|
173 |
|
|
install: $($(CPU)_INSTALL)
|
174 |
|
|
$(INSTALL_DATA) $(CRT0) $(tooldir)/lib${MULTISUBDIR}/$(CRT0)
|
175 |
|
|
|
176 |
|
|
sparc-install:
|
177 |
|
|
$(INSTALL_DATA) $(CYGMON_BSP) $(tooldir)/lib${MULTISUBDIR}
|
178 |
|
|
$(INSTALL_DATA) $(CYGMON_OBJS) $(tooldir)/lib${MULTISUBDIR}
|
179 |
|
|
$(INSTALL_DATA) $(objdir)/cygmon.ld $(tooldir)/lib${MULTISUBDIR}
|
180 |
|
|
$(INSTALL_DATA) $(CYGMON_CRT0) $(tooldir)/lib${MULTISUBDIR}
|
181 |
|
|
|
182 |
|
|
slite-install:
|
183 |
|
|
$(INSTALL_DATA) $(930_BSP) $(tooldir)/lib${MULTISUBDIR}/$(930_BSP)
|
184 |
|
|
$(INSTALL_DATA) $(931_BSP) $(tooldir)/lib${MULTISUBDIR}/$(931_BSP)
|
185 |
56 |
joel |
$(INSTALL_DATA) $(934_BSP) $(tooldir)/lib${MULTISUBDIR}/$(934_BSP)
|
186 |
|
|
$(INSTALL_DATA) $(86X_BSP) $(tooldir)/lib${MULTISUBDIR}/$(86X_BSP)
|
187 |
39 |
lampret |
$(INSTALL_DATA) $(srcdir)/ex930.ld $(tooldir)/lib${MULTISUBDIR}
|
188 |
|
|
$(INSTALL_DATA) $(srcdir)/ex931.ld $(tooldir)/lib${MULTISUBDIR}
|
189 |
|
|
$(INSTALL_DATA) $(srcdir)/ex934.ld $(tooldir)/lib${MULTISUBDIR}
|
190 |
56 |
joel |
$(INSTALL_DATA) $(srcdir)/sparc86x.ld $(tooldir)/lib${MULTISUBDIR}
|
191 |
39 |
lampret |
$(INSTALL_DATA) $(srcdir)/elfsim.ld $(tooldir)/lib${MULTISUBDIR}
|
192 |
|
|
$(INSTALL_DATA) $(ERC32_CRT0) $(tooldir)/lib${MULTISUBDIR}
|
193 |
|
|
$(INSTALL_DATA) $(ERC32_BSP) $(tooldir)/lib${MULTISUBDIR}
|
194 |
|
|
$(INSTALL_DATA) $(objdir)/traps.o $(tooldir)/lib${MULTISUBDIR}
|
195 |
|
|
$(INSTALL_DATA) $(CYGMON_BSP) $(tooldir)/lib${MULTISUBDIR}
|
196 |
|
|
$(INSTALL_DATA) $(CYGMON_OBJS) $(tooldir)/lib${MULTISUBDIR}
|
197 |
|
|
$(INSTALL_DATA) $(objdir)/cygmon.ld $(tooldir)/lib${MULTISUBDIR}
|
198 |
|
|
$(INSTALL_DATA) $(CYGMON_CRT0) $(tooldir)/lib${MULTISUBDIR}
|
199 |
|
|
|
200 |
|
|
splet-install:
|
201 |
|
|
$(INSTALL_DATA) $(701_CRT0) $(tooldir)/lib${MULTISUBDIR}/$(701_CRT0)
|
202 |
|
|
$(INSTALL_DATA) $(701_BSP) $(tooldir)/lib${MULTISUBDIR}/$(701_BSP)
|
203 |
|
|
$(INSTALL_DATA) $(srcdir)/tsc701.ld $(tooldir)/lib${MULTISUBDIR}
|
204 |
|
|
|
205 |
|
|
# Make a simple test case to test the linker script, startup code, and
|
206 |
|
|
# I/O code
|
207 |
|
|
#
|
208 |
|
|
test: ex930-test.x ex931-test.x erc32-test.x
|
209 |
|
|
@echo Done...
|
210 |
|
|
|
211 |
|
|
# compile a fully linked binary. The -N option is for a.out, so the
|
212 |
|
|
# base address will be zero, rather than the default of 0x2020. The
|
213 |
|
|
# -Wl,-T*.ld is for the linker script. By using -Wl, the linker script
|
214 |
|
|
# is put on the proper place in the comand line for ld, and all the
|
215 |
|
|
# symbols will get fully resolved.
|
216 |
|
|
|
217 |
|
|
erc32-test.x: test.o ${ERC32_CRT0} ${srcdir}/erc32.ld Makefile ${ERC32_BSP}
|
218 |
|
|
${CC} -L${srcdir} -L${objdir} test.o -o $@ $(LDFLAGS_FOR_TARGET) \
|
219 |
|
|
-N -Wl,-Terc32.ld -Wl,-Map -Wl,erc32.map -nostdlib
|
220 |
|
|
erc32-test.srec: erc32-test.x
|
221 |
|
|
$(OBJCOPY) -O srec erc32-test.x $@
|
222 |
|
|
erc32-test.dis: erc32-test.x
|
223 |
|
|
@rm -fr erc32-test.dis
|
224 |
|
|
$(OBJDUMP) -d erc32-test.x > $@
|
225 |
|
|
erc32-test: erc32-test.srec erc32-test.dis
|
226 |
|
|
|
227 |
|
|
ex930-test.x: test.o ${CRT0} ${srcdir}/ex930.ld Makefile ${930_BSP}
|
228 |
|
|
${CC} -L${srcdir} -L${objdir} test.o -o $@ $(LDFLAGS_FOR_TARGET) \
|
229 |
|
|
-N -Wl,-Tex930.ld -nostdlib
|
230 |
|
|
ex930-test.srec: ex930-test.x
|
231 |
|
|
$(OBJCOPY) -O srec ex930-test.x $@
|
232 |
|
|
ex930-test.dis: ex930-test.x
|
233 |
|
|
@rm -fr ex930-test.dis
|
234 |
|
|
$(OBJDUMP) -d ex930-test.x > $@
|
235 |
|
|
ex930-test: ex930-test.srec ex930-test.dis
|
236 |
|
|
|
237 |
|
|
ex931-test.x: test.o ${CRT0} ${srcdir}/ex931.ld Makefile ${931_BSP}
|
238 |
|
|
${CC} -L${srcdir} -L${objdir} test.o -o $@ $(LDFLAGS_FOR_TARGET) \
|
239 |
|
|
-N -Wl,-Tex931.ld -nostdlib
|
240 |
|
|
ex931-test.srec: ex931-test.x
|
241 |
|
|
$(OBJCOPY) -O srec ex931-test.x $@
|
242 |
|
|
ex931-test.dis: ex931-test.x
|
243 |
|
|
@rm -fr ex931-test.dis
|
244 |
|
|
$(OBJDUMP) -d ex931-test.x > $@
|
245 |
|
|
ex931-test: ex931-test.srec ex931-test.dis
|
246 |
|
|
|
247 |
|
|
ex934-test.x: test.o ${CRT0} ${srcdir}/ex934.ld Makefile ${934_BSP}
|
248 |
|
|
${CC} -L${srcdir} -L${objdir} test.o -o $@ $(LDFLAGS_FOR_TARGET) \
|
249 |
|
|
-N -Wl,-Tex934.ld -nostdlib
|
250 |
|
|
ex934-test.srec: ex934-test.x
|
251 |
|
|
$(OBJCOPY) -O srec ex934-test.x $@
|
252 |
|
|
ex934-test.dis: ex934-test.x
|
253 |
|
|
@rm -fr ex934-test.dis
|
254 |
|
|
$(OBJDUMP) -d ex934-test.x > $@
|
255 |
|
|
ex934-test: ex934-test.srec ex934-test.dis
|
256 |
|
|
|
257 |
|
|
# a C++ test case
|
258 |
|
|
dtor.o: $(srcdir)/dtor.C
|
259 |
|
|
$(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -o $@ -c $?
|
260 |
|
|
dtor.dis: dtor.x
|
261 |
|
|
@rm -fr dtor.dis
|
262 |
|
|
$(OBJDUMP) -d dtor.x > $@
|
263 |
|
|
dtor.x: dtor.o ${ERC32_CRT0} ${srcdir}/erc32.ld Makefile ${ERC32_BSP}
|
264 |
|
|
${CC} -L${srcdir} -L${objdir} dtor.o -o $@ $(LIBS_FOR_TARGET) \
|
265 |
|
|
-N -Wl,-Terc32.ld
|
266 |
|
|
|
267 |
|
|
# target specific makefile fragment comes in here.
|
268 |
|
|
@target_makefile_frag@
|
269 |
|
|
|
270 |
|
|
clean mostlyclean:
|
271 |
|
|
rm -f *.o *.a *.map *.x
|
272 |
|
|
|
273 |
|
|
distclean maintainer-clean realclean: clean
|
274 |
|
|
rm -f Makefile config.cache config.log config.status
|
275 |
|
|
|
276 |
|
|
.PHONY: info dvi doc install-info clean-info
|
277 |
|
|
info doc dvi:
|
278 |
|
|
install-info:
|
279 |
|
|
clean-info:
|
280 |
|
|
|
281 |
|
|
Makefile: Makefile.in config.status @host_makefile_frag_path@ \
|
282 |
|
|
@target_makefile_frag_path@
|
283 |
|
|
$(SHELL) config.status
|
284 |
|
|
|
285 |
|
|
config.status: configure
|
286 |
|
|
$(SHELL) config.status --recheck
|