1 |
56 |
joel |
# Copyright (c) 1995, 1996, 1998 Cygnus Support
|
2 |
39 |
lampret |
#
|
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 |
|
|
|
14 |
|
|
#
|
15 |
|
|
# This currently works with the PPC simulator.
|
16 |
|
|
#
|
17 |
|
|
|
18 |
|
|
VPATH = @srcdir@ @srcdir@/..
|
19 |
|
|
srcdir = @srcdir@
|
20 |
|
|
objdir = .
|
21 |
|
|
srcroot = $(srcdir)/../..
|
22 |
|
|
objroot = $(objdir)/../..
|
23 |
|
|
|
24 |
|
|
prefix = @prefix@
|
25 |
|
|
exec_prefix = @exec_prefix@
|
26 |
|
|
|
27 |
|
|
host_alias = @host_alias@
|
28 |
|
|
target_alias = @target_alias@
|
29 |
|
|
|
30 |
|
|
bindir = @bindir@
|
31 |
|
|
libdir = @libdir@
|
32 |
|
|
tooldir = $(exec_prefix)/$(target_alias)
|
33 |
|
|
|
34 |
|
|
# Multilib support variables.
|
35 |
|
|
# TOP is used instead of MULTI{BUILD,SRC}TOP.
|
36 |
|
|
MULTIDIRS =
|
37 |
|
|
MULTISUBDIR =
|
38 |
|
|
MULTIDO = true
|
39 |
|
|
MULTICLEAN = true
|
40 |
|
|
|
41 |
|
|
INSTALL = @INSTALL@
|
42 |
|
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
43 |
|
|
INSTALL_DATA = @INSTALL_DATA@
|
44 |
|
|
|
45 |
|
|
SHELL = /bin/sh
|
46 |
|
|
|
47 |
|
|
CC = @CC@
|
48 |
|
|
|
49 |
|
|
AS = @AS@
|
50 |
|
|
AR = @AR@
|
51 |
|
|
LD = @LD@
|
52 |
|
|
RANLIB = @RANLIB@
|
53 |
|
|
|
54 |
|
|
OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
|
55 |
|
|
then echo ${objroot}/../binutils/objdump ; \
|
56 |
|
|
else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
|
57 |
|
|
OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
|
58 |
|
|
then echo ${objroot}/../binutils/objcopy ; \
|
59 |
|
|
else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
|
60 |
|
|
|
61 |
|
|
OBJS = fstat.o getpid.o isatty.o kill.o putnum.o stat.o unlink.o mcount.o
|
62 |
|
|
CFLAGS = -g
|
63 |
|
|
SCRIPTS = ${SIM_SCRIPTS} ${MVME_SCRIPTS} ${YELLOWKNIFE_SCRIPTS} ${ADS_SCRIPTS}
|
64 |
|
|
|
65 |
|
|
# Here is all of the simulator stuff
|
66 |
|
|
SIM_SCRIPTS =
|
67 |
|
|
SIM_LDFLAGS =
|
68 |
|
|
SIM_BSP = libsim.a
|
69 |
|
|
SIM_CRT0 = sim-crt0.o
|
70 |
|
|
SIM_OBJS = sim-print.o sim-inbyte.o sim-sbrk.o sim-abort.o sim-errno.o simulator.o
|
71 |
|
|
SIM_TEST = sim-test
|
72 |
|
|
SIM_INSTALL = install-sim
|
73 |
|
|
|
74 |
|
|
# Here is all the mvme stuff
|
75 |
|
|
MVME_SCRIPTS =
|
76 |
|
|
MVME_LDFLAGS =
|
77 |
|
|
MVME_BSP = libmvme.a
|
78 |
|
|
MVME_CRT0 = crt0.o
|
79 |
|
|
MVME_OBJS = mvme-exit.o mvme-inbyte.o mvme-outbyte.o open.o close.o lseek.o sbrk.o mvme-read.o mvme-print.o
|
80 |
|
|
MVME_TEST = mvme-test
|
81 |
|
|
MVME_INSTALL = install-mvme
|
82 |
|
|
|
83 |
|
|
# Here is the Solaris stuff
|
84 |
56 |
joel |
#SOLARIS_SCRIPTS=
|
85 |
|
|
#SOLARIS_LDFLAGS=
|
86 |
|
|
#SOLARIS_BSP = libsolaris.a
|
87 |
|
|
#SOLARIS_CRT0 =
|
88 |
|
|
#SOLARIS_OBJS = sol-cfuncs.o sol-syscall.o
|
89 |
|
|
#SOLARIS_TEST = sol-test
|
90 |
|
|
#SOLARIS_INSTALL= install-solaris
|
91 |
39 |
lampret |
|
92 |
|
|
# Here is the Linux stuff
|
93 |
|
|
#LINUX_SCRIPTS =
|
94 |
|
|
#LINUX_LDFLAGS =
|
95 |
|
|
#LINUX_BSP = liblinux.a
|
96 |
|
|
#LINUX_CRT0 =
|
97 |
|
|
#LINUX_OBJS = lin-cfuncs.o lin-syscall.o
|
98 |
|
|
#LINUX_TEST = linux-test
|
99 |
|
|
#LINUX_INSTALL = install-linux
|
100 |
|
|
|
101 |
|
|
YELLOWKNIFE_SCRIPTS = yellowknife.ld
|
102 |
|
|
YELLOWKNIFE_CRT0 = crt0.o
|
103 |
|
|
YELLOWKNIFE_BSP = libyk.a
|
104 |
|
|
YELLOWKNIFE_OBJS = open.o close.o lseek.o sbrk.o mvme-exit.o mvme-inbyte.o mvme-outbyte.o mvme-read.o mvme-print.o
|
105 |
|
|
YELLOWKNIFE_TEST = yellowknife-test
|
106 |
|
|
YELLOWKNIFE_INSTALL = install-yellowknife
|
107 |
|
|
|
108 |
|
|
ADS_SCRIPTS = ads.ld
|
109 |
|
|
ADS_CRT0 = crt0.o
|
110 |
|
|
ADS_BSP = libads.a
|
111 |
|
|
ADS_OBJS = open.o close.o lseek.o sbrk.o ads-exit.o ads-io.o
|
112 |
|
|
ADS_TEST = ads-test
|
113 |
|
|
ADS_INSTALL = install-ads
|
114 |
|
|
|
115 |
|
|
MBX_SCRIPTS = mbx.ld
|
116 |
|
|
MBX_SPECS = mbx.specs
|
117 |
|
|
MBX_CRT0 = crt0.o
|
118 |
|
|
MBX_BSP = libmbx.a
|
119 |
|
|
MBX_OBJS = open.o close.o lseek.o sbrk.o read.o write.o mbx-exit.o mbx-inbyte.o mbx-outbyte.o mbx-print.o
|
120 |
|
|
MBX_TEST = mbx-test
|
121 |
|
|
MBX_INSTALL = install-mbx
|
122 |
|
|
|
123 |
|
|
# Host specific makefile fragment comes in here.
|
124 |
|
|
@host_makefile_frag@
|
125 |
|
|
|
126 |
|
|
#
|
127 |
|
|
# build a test program for each target board. Just trying to get
|
128 |
|
|
# it to link is a good test, so we ignore all the errors for now.
|
129 |
|
|
#
|
130 |
|
|
all: \
|
131 |
|
|
${SIM_CRT0} ${SIM_BSP} \
|
132 |
|
|
${MVME_CRT0} ${MVME_BSP} \
|
133 |
|
|
${SOLARIS_CRT0} ${SOLARIS_BSP} \
|
134 |
|
|
${LINUX_CRT0} ${LINUX_BSP} \
|
135 |
|
|
${YELLOWKNIFE_CRT0} ${YELLOWKNIFE_BSP} \
|
136 |
|
|
${ADS_CRT0} ${ADS_BSP} \
|
137 |
|
|
${MBX_CRT0} ${MBX_BSP}
|
138 |
|
|
|
139 |
|
|
#
|
140 |
|
|
# here's where we build the board support packages for each target
|
141 |
|
|
#
|
142 |
|
|
|
143 |
|
|
${SIM_BSP}: ${OBJS} ${SIM_OBJS}
|
144 |
|
|
${AR} ${ARFLAGS} $@ ${SIM_OBJS} ${OBJS}
|
145 |
|
|
${RANLIB} $@
|
146 |
|
|
|
147 |
|
|
${MVME_BSP}: ${OBJS} ${MVME_OBJS}
|
148 |
|
|
${AR} ${ARFLAGS} $@ ${MVME_OBJS} ${OBJS}
|
149 |
|
|
${RANLIB} $@
|
150 |
|
|
|
151 |
|
|
${LINUX_BSP}: ${OBJS} ${LINUX_OBJS}
|
152 |
|
|
${AR} ${ARFLAGS} $@ ${LINUX_OBJS} ${OBJS}
|
153 |
|
|
${RANLIB} $@
|
154 |
|
|
|
155 |
|
|
${SOLARIS_BSP}: ${OBJS} ${SOLARIS_OBJS}
|
156 |
|
|
${AR} ${ARFLAGS} $@ ${SOLARIS_OBJS}
|
157 |
|
|
${RANLIB} $@
|
158 |
|
|
|
159 |
|
|
${YELLOWKNIFE_BSP}: ${OBJS} ${YELLOWKNIFE_OBJS}
|
160 |
|
|
${AR} ${ARFLAGS} $@ ${YELLOWKNIFE_OBJS} ${OBJS}
|
161 |
|
|
${RANLIB} $@
|
162 |
|
|
|
163 |
|
|
${ADS_BSP}: ${OBJS} ${ADS_OBJS}
|
164 |
|
|
${AR} ${ARFLAGS} $@ ${ADS_OBJS} ${OBJS}
|
165 |
|
|
${RANLIB} $@
|
166 |
|
|
|
167 |
|
|
${MBX_BSP}: ${OBJS} ${MBX_OBJS}
|
168 |
|
|
${AR} ${ARFLAGS} $@ ${MBX_OBJS} ${OBJS}
|
169 |
|
|
${RANLIB} $@
|
170 |
|
|
|
171 |
|
|
#
|
172 |
|
|
# here's where we build the test programs for each target
|
173 |
|
|
#
|
174 |
|
|
.PHONY: test
|
175 |
|
|
test: ${SIM_TEST} ${MVME_TEST} ${YELLOWKNIFE_TEST} ${ADS_TEST} ${MBX_TEST}
|
176 |
|
|
|
177 |
|
|
sim-test: sim-test.x sim-test.dis
|
178 |
|
|
|
179 |
|
|
sim-test.x: test.o ${SIM_CRT0} ${SIM_BSP}
|
180 |
|
|
${CC} ${LDFLAGS_FOR_TARGET} -L${objdir} \
|
181 |
|
|
${SIM_CRT0} test.o \
|
182 |
|
|
-o sim-test.x ${LIBS_FOR_TARGET} -lc ${SIM_BSP}
|
183 |
|
|
|
184 |
|
|
sim-test.dis: sim-test.x
|
185 |
|
|
${OBJDUMP} -d sim-test.x > sim-test.dis
|
186 |
|
|
|
187 |
|
|
mvme-test: mvme-test.x mvme-test.dis mvme-test.srec
|
188 |
|
|
|
189 |
|
|
mvme-test.x: test.o ${MVME_CRT0} ${MVME_BSP}
|
190 |
|
|
${CC} ${LDFLAGS_FOR_TARGET} -L${objdir} \
|
191 |
|
|
${SIM_CRT0} test.o \
|
192 |
|
|
-o mvme-test.x ${LIBS_FOR_TARGET} -lc ${MVME_BSP}
|
193 |
|
|
|
194 |
|
|
mvme-test.dis: mvme-test.x
|
195 |
|
|
${OBJDUMP} -d mvme-test.x > mvme-test.dis
|
196 |
|
|
|
197 |
|
|
mvme-test.srec: mvme-test.x
|
198 |
|
|
${OBJCOPY} -O srec mvme-test.x mvme-test.srec
|
199 |
|
|
|
200 |
|
|
sol-test: sol-test.x sol-test.dis sol-test.srec
|
201 |
|
|
|
202 |
|
|
sol-test.x: test.o ${SOLARIS_CRT0} ${SOLARIS_BSP}
|
203 |
|
|
${CC} ${LDFLAGS_FOR_TARGET} -L${objdir} \
|
204 |
|
|
${SIM_CRT0} test.o \
|
205 |
|
|
-o sol-test.x ${LIBS_FOR_TARGET} -lc ${SOLARIS_BSP}
|
206 |
|
|
|
207 |
|
|
sol-test.dis: sol-test.x
|
208 |
|
|
${OBJDUMP} -d sol-test.x > sol-test.dis
|
209 |
|
|
|
210 |
|
|
sol-test.srec: sol-test.x
|
211 |
|
|
${OBJCOPY} -O srec sol-test.x sol-test.srec
|
212 |
|
|
|
213 |
|
|
linux-test: linux-test.x linux-test.dis linux-test.srec
|
214 |
|
|
|
215 |
|
|
linux-test.x: test.o ${LINUX_CRT0} ${LINUX_BSP}
|
216 |
|
|
${CC} ${LDFLAGS_FOR_TARGET} -L${objdir} \
|
217 |
|
|
${SIM_CRT0} test.o \
|
218 |
|
|
-o linux-test.x ${LIBS_FOR_TARGET} -lc ${LINUX_BSP}
|
219 |
|
|
|
220 |
|
|
linux-test.dis: linux-test.x
|
221 |
|
|
${OBJDUMP} -d linux-test.x > linux-test.dis
|
222 |
|
|
|
223 |
|
|
linux-test.srec: linux-test.x
|
224 |
|
|
${OBJCOPY} -O srec linux-test.x linux-test.srec
|
225 |
|
|
|
226 |
|
|
yellowknife-test: yellowknife-test.x yellowknife-test.dis yellowknife-test.srec
|
227 |
|
|
|
228 |
|
|
yellowknife-test.x: test.o ${YELLOWKNIFE_CRT0} ${YELLOWKNIFE_BSP}
|
229 |
|
|
${CC} ${LDFLAGS_FOR_TARGET} -L${objdir} \
|
230 |
|
|
-T${srcdir}/yellowknife.ld ${YELLOWKNIFE_CRT0} test.o \
|
231 |
|
|
-o yellowknife-test.x $(LIBS_FOR_TARGET) ${YELLOWKNIFE_BSP} -lc ${YELLOWKNIFE_BSP}
|
232 |
|
|
|
233 |
|
|
yellowknife-test.dis: yellowknife-test.x
|
234 |
|
|
${OBJDUMP} -d yellowknife-test.x > yellowknife-test.dis
|
235 |
|
|
|
236 |
|
|
yellowknife-test.srec: yellowknife-test.x
|
237 |
|
|
${OBJCOPY} -O srec yellowknife-test.x yellowknife-test.srec
|
238 |
|
|
|
239 |
|
|
ads-test: ads-test.x ads-test.dis ads-test.srec
|
240 |
|
|
|
241 |
|
|
ads-test.x: test.o ${ADS_CRT0} ${ADS_BSP}
|
242 |
|
|
${CC} ${LDFLAGS_FOR_TARGET} -L${objdir} \
|
243 |
|
|
-T${srcdir}/ads.ld ${ADS_CRT0} test.o \
|
244 |
|
|
-o ads-test.x $(LIBS_FOR_TARGET) ${ADS_BSP} -lc ${ADS_BSP}
|
245 |
|
|
|
246 |
|
|
ads-test.dis: ads-test.x
|
247 |
|
|
${OBJDUMP} -d ads-test.x > ads-test.dis
|
248 |
|
|
|
249 |
|
|
ads-test.srec: ads-test.x
|
250 |
|
|
${OBJCOPY} -O srec ads-test.x ads-test.srec
|
251 |
|
|
|
252 |
|
|
mbx-test: mbx-test.x mbx-test.dis mbx-test.srec
|
253 |
|
|
|
254 |
|
|
mbx-test.x: test.o ${MBX_CRT0} ${MBX_BSP}
|
255 |
|
|
${CC} ${LDFLAGS_FOR_TARGET} -L${objdir} \
|
256 |
|
|
-T${srcdir}/mbx.ld ${MBX_CRT0} test.o \
|
257 |
|
|
-o mbx-test.x $(LIBS_FOR_TARGET) ${MBX_BSP} -lc ${MBX_BSP}
|
258 |
|
|
|
259 |
|
|
mbx-test.dis: mbx-test.x
|
260 |
|
|
${OBJDUMP} -d mbx-test.x > mbx-test.dis
|
261 |
|
|
|
262 |
|
|
mbx-test.srec: mbx-test.x
|
263 |
|
|
${OBJCOPY} -O srec mbx-test.x mbx-test.srec
|
264 |
|
|
|
265 |
|
|
#
|
266 |
|
|
#
|
267 |
|
|
#
|
268 |
|
|
|
269 |
|
|
crt0.o: crt0.S
|
270 |
|
|
|
271 |
|
|
simulator.o: simulator.S
|
272 |
|
|
sim-crt0.o: sim-crt0.S
|
273 |
|
|
mount.o: mount.S
|
274 |
|
|
|
275 |
|
|
mvme-exit.o: mvme-exit.S
|
276 |
|
|
mvme-inbyte.o: mvme-inbyte.S
|
277 |
|
|
mvme-outbyte.o: mvme-outbyte.S
|
278 |
|
|
|
279 |
|
|
ads-exit.o: ads-exit.S
|
280 |
|
|
ads-io.o: ads-io.c
|
281 |
|
|
|
282 |
|
|
mbx-exit.o: mbx-exit.c
|
283 |
|
|
mbx-inbyte.o: mbx-inbyte.c
|
284 |
|
|
mbx-outbyte.o: mbx-outbyte.c
|
285 |
|
|
mbx-print.o: mbx-print.c
|
286 |
|
|
|
287 |
|
|
sol-cfuncs.o: sol-cfuncs.c
|
288 |
|
|
sol-syscall.o: sol-syscall.S
|
289 |
|
|
|
290 |
|
|
close.o: $(srcdir)/../close.c
|
291 |
|
|
fstat.o: $(srcdir)/../fstat.c
|
292 |
|
|
getpid.o: $(srcdir)/../getpid.c
|
293 |
|
|
isatty.o: $(srcdir)/../isatty.c
|
294 |
|
|
kill.o: $(srcdir)/../kill.c
|
295 |
|
|
lseek.o: $(srcdir)/../lseek.c
|
296 |
|
|
open.o: $(srcdir)/../open.c
|
297 |
|
|
putnum.o: $(srcdir)/../putnum.c
|
298 |
|
|
sbrk.o: $(srcdir)/../sbrk.c
|
299 |
|
|
stat.o: $(srcdir)/../stat.c
|
300 |
|
|
unlink.o: $(srcdir)/../unlink.c
|
301 |
|
|
|
302 |
|
|
# Don't optimize when compiling the test program, makes confusion in
|
303 |
|
|
# the debugger.
|
304 |
|
|
|
305 |
|
|
test.o: $(srcdir)/test.c
|
306 |
|
|
$(CC) -g $(CFLAGS_MRELOCATABLE) $(INCLUDES) -c $(CFLAGS) $<
|
307 |
|
|
|
308 |
|
|
clean mostlyclean:
|
309 |
|
|
rm -f a.out core *.i *.o *-test *.srec *.dis *.x
|
310 |
|
|
|
311 |
|
|
distclean maintainer-clean realclean: clean
|
312 |
|
|
rm -f Makefile config.status *~
|
313 |
|
|
|
314 |
|
|
.PHONY: install info install-info clean-info
|
315 |
|
|
install: ${SIM_INSTALL} ${MVME_INSTALL} ${SOLARIS_INSTALL} ${LINUX_INSTALL} ${YELLOWKNIFE_INSTALL} ${ADS_INSTALL} ${MBX_INSTALL}
|
316 |
|
|
|
317 |
|
|
install-sim:
|
318 |
|
|
set -e; for x in ${SIM_CRT0} ${SIM_BSP} ${SIM_SCRIPTS}; do ${INSTALL_DATA} $$x ${tooldir}/lib${MULTISUBDIR}/$$x; done
|
319 |
|
|
|
320 |
|
|
install-mvme:
|
321 |
|
|
set -e; for x in ${MVME_CRT0} ${MVME_BSP} ${MVME_SCRIPTS}; do ${INSTALL_DATA} $$x ${tooldir}/lib${MULTISUBDIR}/$$x; done
|
322 |
|
|
|
323 |
|
|
install-solaris:
|
324 |
|
|
set -e; for x in ${SOLARIS_CRT0} ${SOLARIS_BSP} ${SOLARIS_SCRIPTS}; do ${INSTALL_DATA} $$x ${tooldir}/lib${MULTISUBDIR}/$$x; done
|
325 |
|
|
|
326 |
|
|
install-linux:
|
327 |
|
|
set -e; for x in ${LINUX_CRT0} ${LINUX_BSP} ${LINUX_SCRIPTS}; do ${INSTALL_DATA} $$x ${tooldir}/lib${MULTISUBDIR}/$$x; done
|
328 |
|
|
|
329 |
|
|
install-yellowknife:
|
330 |
|
|
set -e; for x in ${YELLOWKNIFE_CRT0} ${YELLOWKNIFE_BSP}; do ${INSTALL_DATA} $$x ${tooldir}/lib${MULTISUBDIR}/$$x; done
|
331 |
|
|
set -e; for x in ${YELLOWKNIFE_SCRIPTS}; do ${INSTALL_DATA} $(srcdir)/$$x ${tooldir}/lib${MULTISUBDIR}/$$x; done
|
332 |
|
|
|
333 |
|
|
install-ads:
|
334 |
|
|
set -e; for x in ${ADS_CRT0} ${ADS_BSP}; do ${INSTALL_DATA} $$x ${tooldir}/lib${MULTISUBDIR}/$$x; done
|
335 |
|
|
set -e; for x in ${ADS_SCRIPTS}; do ${INSTALL_DATA} $(srcdir)/$$x ${tooldir}/lib${MULTISUBDIR}/$$x; done
|
336 |
|
|
|
337 |
|
|
install-mbx:
|
338 |
|
|
set -e; for x in ${MBX_CRT0} ${MBX_BSP}; do ${INSTALL_DATA} $$x ${tooldir}/lib${MULTISUBDIR}/$$x; done
|
339 |
|
|
set -e; for x in ${MBX_SCRIPTS} ${MBX_SPECS}; do ${INSTALL_DATA} $(srcdir)/$$x ${tooldir}/lib${MULTISUBDIR}/$$x; done
|
340 |
|
|
|
341 |
|
|
doc:
|
342 |
|
|
info:
|
343 |
|
|
install-info:
|
344 |
|
|
clean-info:
|
345 |
|
|
|
346 |
|
|
Makefile: Makefile.in config.status @host_makefile_frag_path@
|
347 |
|
|
$(SHELL) config.status
|
348 |
|
|
|
349 |
|
|
config.status: configure
|
350 |
|
|
$(SHELL) config.status --recheck
|