1 |
207 |
jeremybenn |
# Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 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 |
|
|
DESTDIR =
|
14 |
|
|
VPATH = @srcdir@
|
15 |
|
|
srcdir = @srcdir@
|
16 |
|
|
objdir = .
|
17 |
|
|
srcroot = $(srcdir)/../..
|
18 |
|
|
objroot = $(objdir)/../..
|
19 |
|
|
|
20 |
|
|
prefix = @prefix@
|
21 |
|
|
exec_prefix = @exec_prefix@
|
22 |
|
|
|
23 |
|
|
host_alias = @host_alias@
|
24 |
|
|
target_alias = @target_alias@
|
25 |
|
|
program_transform_name = @program_transform_name@
|
26 |
|
|
|
27 |
|
|
bindir = @bindir@
|
28 |
|
|
libdir = @libdir@
|
29 |
|
|
tooldir = $(exec_prefix)/$(target_alias)
|
30 |
|
|
|
31 |
|
|
# Multilib support variables.
|
32 |
|
|
# TOP is used instead of MULTI{BUILD,SRC}TOP.
|
33 |
|
|
MULTIDIRS =
|
34 |
|
|
MULTISUBDIR =
|
35 |
|
|
MULTIDO = true
|
36 |
|
|
MULTICLEAN = true
|
37 |
|
|
|
38 |
|
|
INSTALL = @INSTALL@
|
39 |
|
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
40 |
|
|
INSTALL_DATA = @INSTALL_DATA@
|
41 |
|
|
|
42 |
|
|
SHELL = /bin/sh
|
43 |
|
|
|
44 |
|
|
CC = @CC@
|
45 |
|
|
|
46 |
|
|
#AS = @AS@
|
47 |
|
|
AS = `if [ -f ${objroot}/../gas/as.new ] ; \
|
48 |
|
|
then echo ${objroot}/../gas/as.new ; \
|
49 |
|
|
else echo as ; fi`
|
50 |
|
|
|
51 |
|
|
AR = @AR@
|
52 |
|
|
|
53 |
|
|
#LD = @LD@
|
54 |
|
|
LD = `if [ -f ${objroot}/../ld/ld.new ] ; \
|
55 |
|
|
then echo ${objroot}/../ld/ld.new ; \
|
56 |
|
|
else echo ld ; fi`
|
57 |
|
|
|
58 |
|
|
RANLIB = @RANLIB@
|
59 |
|
|
|
60 |
|
|
OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
|
61 |
|
|
then echo ${objroot}/../binutils/objdump ; \
|
62 |
|
|
else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
|
63 |
|
|
OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
|
64 |
|
|
then echo ${objroot}/../binutils/objcopy ; \
|
65 |
|
|
else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
|
66 |
|
|
|
67 |
|
|
CRT0 = @crt0@
|
68 |
|
|
PCRT0 = @pcrt0@
|
69 |
|
|
GENOBJS = syscalls.o fstat.o getpid.o isatty.o kill.o \
|
70 |
|
|
lseek.o print.o putnum.o stat.o unlink.o
|
71 |
|
|
GENOBJS2 = open.o close.o read.o write.o
|
72 |
|
|
IDTOBJS = idtmon.o @part_specific_obj@ ${GENOBJS}
|
73 |
|
|
PMONOBJS = pmon.o @part_specific_obj@ ${GENOBJS}
|
74 |
|
|
LSIOBJS = lsipmon.o @part_specific_obj@ ${GENOBJS}
|
75 |
|
|
DVEOBJS = dvemon.o @part_specific_obj@ ${GENOBJS} ${GENOBJS2}
|
76 |
|
|
JMR3904OBJS = jmr3904-io.o @part_specific_obj@ ${GENOBJS} ${GENOBJS2}
|
77 |
|
|
CFEOBJS = cfe.o cfe_api.o cfe_mem.o @part_specific_obj@ ${GENOBJS} ${GENOBJS2}
|
78 |
|
|
CYGMONOBJS = open.o close.o cygmon.o @part_specific_obj@ ${GENOBJS}
|
79 |
|
|
|
80 |
|
|
# Nullmon cannot support read and write, but the test cases pull them in via libs
|
81 |
|
|
NULLMONOBJS = nullmon.o @part_specific_obj@ ${GENOBJS}
|
82 |
|
|
|
83 |
|
|
CFLAGS = -g
|
84 |
|
|
|
85 |
|
|
GCC_LDFLAGS = `if [ -d ${objroot}/../gcc ] ; \
|
86 |
|
|
then echo -L${objroot}/../gcc ; fi`
|
87 |
|
|
|
88 |
|
|
SCRIPTS = @script_list@
|
89 |
|
|
BSP = @bsp_list@
|
90 |
|
|
|
91 |
|
|
PART_SPECIFIC_DEFINES = @part_specific_defines@
|
92 |
|
|
|
93 |
|
|
# Host specific makefile fragment comes in here.
|
94 |
|
|
@host_makefile_frag@
|
95 |
|
|
|
96 |
|
|
#
|
97 |
|
|
# build a test program for each target board. Just trying to get
|
98 |
|
|
# it to link is a good test, so we ignore all the errors for now.
|
99 |
|
|
#
|
100 |
|
|
|
101 |
|
|
all: ${CRT0} ${PCRT0} test.o ${BSP}
|
102 |
|
|
|
103 |
|
|
#
|
104 |
|
|
# here's where we build the board support packages for each target
|
105 |
|
|
#
|
106 |
|
|
mipsidt.o: $(IDTOBJS)
|
107 |
|
|
${LD} -r $(IDTOBJS) -o $@
|
108 |
|
|
|
109 |
|
|
mipspmon.o: $(PMONOBJS)
|
110 |
|
|
${LD} -r $(PMONOBJS) -o $@
|
111 |
|
|
|
112 |
|
|
mipslsi.o: $(PMONOBJS)
|
113 |
|
|
${LD} -r $(LSIOBJS) -o $@
|
114 |
|
|
|
115 |
|
|
libidt.a: $(IDTOBJS)
|
116 |
|
|
${AR} ${ARFLAGS} $@ $(IDTOBJS)
|
117 |
|
|
${RANLIB} $@
|
118 |
|
|
|
119 |
|
|
libpmon.a: $(PMONOBJS)
|
120 |
|
|
${AR} ${ARFLAGS} $@ $(PMONOBJS)
|
121 |
|
|
${RANLIB} $@
|
122 |
|
|
|
123 |
|
|
liblsi.a: $(LSIOBJS)
|
124 |
|
|
${AR} ${ARFLAGS} $@ $(LSIOBJS)
|
125 |
|
|
${RANLIB} $@
|
126 |
|
|
|
127 |
|
|
libdve.a: $(DVEOBJS)
|
128 |
|
|
${AR} ${ARFLAGS} $@ $(DVEOBJS)
|
129 |
|
|
${RANLIB} $@
|
130 |
|
|
|
131 |
|
|
libjmr3904.a: $(JMR3904OBJS)
|
132 |
|
|
${AR} ${ARFLAGS} $@ $(JMR3904OBJS)
|
133 |
|
|
${RANLIB} $@
|
134 |
|
|
|
135 |
|
|
libcygmon.a: $(CYGMONOBJS)
|
136 |
|
|
${AR} ${ARFLAGS} $@ $(CYGMONOBJS)
|
137 |
|
|
${RANLIB} $@
|
138 |
|
|
|
139 |
|
|
libcfe.a: $(CFEOBJS)
|
140 |
|
|
${AR} ${ARFLAGS} $@ $(CFEOBJS)
|
141 |
|
|
${RANLIB} $@
|
142 |
|
|
|
143 |
|
|
# nullmon.a , This is what you want if you want crt0 but NO mon services
|
144 |
|
|
# Supports GDB sim testing, board bringups, ICE operation.
|
145 |
|
|
libnullmon.a: $(NULLMONOBJS)
|
146 |
|
|
${AR} ${ARFLAGS} $@ $(NULLMONOBJS)
|
147 |
|
|
${RANLIB} $@
|
148 |
|
|
|
149 |
|
|
|
150 |
|
|
# compile a fully linked binary. The -Wl,-T*.ld is for the linker
|
151 |
|
|
# script. By using -Wl, the linker script is put on the proper place
|
152 |
|
|
# in the comand line for ld, and all the symbols will get fully
|
153 |
|
|
# resolved.
|
154 |
|
|
|
155 |
|
|
test: $(OBJS) ${BSP} pmon-test idt-test cfe-test
|
156 |
|
|
@echo Done...
|
157 |
|
|
|
158 |
|
|
dtor.o: $(srcdir)/dtor.C
|
159 |
|
|
$(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -o $@ -c $<
|
160 |
|
|
dtor.x: dtor.o ${CRT0} ${srcdir}/pmon.ld Makefile libpmon.a
|
161 |
|
|
${CC} $(CFLAGS_FOR_TARGET) -L${srcdir} -L${objdir} \
|
162 |
|
|
dtor.o -o $@ $(NEWLIB_LDFLAGS) -N -Wl,-Tpmon.ld
|
163 |
|
|
|
164 |
|
|
pmon-test.x: test.o ${CRT0} Makefile libpmon.a
|
165 |
|
|
${CC} $(CFLAGS_FOR_TARGET) -L${srcdir} -L${objdir} \
|
166 |
|
|
test.o -o $@ $(NEWLIB_LDFLAGS) -Wl,-Tpmon.ld
|
167 |
|
|
pmon-test.srec: pmon-test.x
|
168 |
|
|
$(OBJCOPY) -O srec pmon-test.x $@
|
169 |
|
|
pmon-test.dis: pmon-test.x
|
170 |
|
|
@rm -fr pmon-test.dis
|
171 |
|
|
$(OBJDUMP) -d pmon-test.x > $@
|
172 |
|
|
pmon-test: pmon-test.srec pmon-test.dis
|
173 |
|
|
|
174 |
|
|
idt-test.x: test.o ${CRT0} Makefile libidt.a
|
175 |
|
|
${CC} $(CFLAGS_FOR_TARGET) -L${srcdir} -L${objdir} \
|
176 |
|
|
test.o -o $@ $(NEWLIB_LDFLAGS) -Wl,-Tidt.ld
|
177 |
|
|
idt-test.srec: idt-test.x
|
178 |
|
|
$(OBJCOPY) -O srec idt-test.x $@
|
179 |
|
|
idt-test.dis: idt-test.x
|
180 |
|
|
@rm -fr idt-test.dis
|
181 |
|
|
$(OBJDUMP) -d idt-test.x > $@
|
182 |
|
|
idt-test: idt-test.srec idt-test.dis
|
183 |
|
|
|
184 |
|
|
cfe-test.x: test.o ${CRT0} Makefile libcfe.a
|
185 |
|
|
${CC} $(CFLAGS_FOR_TARGET) -L${srcdir} -L${objdir} \
|
186 |
|
|
test.o -o $@ $(NEWLIB_LDFLAGS) -Wl,-Tcfe.ld
|
187 |
|
|
cfe-test.srec: cfe-test.x
|
188 |
|
|
$(OBJCOPY) -O srec cfe-test.x $@
|
189 |
|
|
cfe-test.dis: cfe-test.x
|
190 |
|
|
@rm -fr cfe-test.dis
|
191 |
|
|
$(OBJDUMP) -d cfe-test.x > $@
|
192 |
|
|
cfe-test: cfe-test.srec cfe-test.dis
|
193 |
|
|
|
194 |
|
|
doc:
|
195 |
|
|
|
196 |
|
|
clean mostlyclean:
|
197 |
|
|
rm -f a.out core *.i *~ *.o *-test *.srec *.dis *.map *.x
|
198 |
|
|
|
199 |
|
|
distclean maintainer-clean realclean: clean
|
200 |
|
|
rm -f Makefile config.status a.out
|
201 |
|
|
|
202 |
|
|
.PHONY: install info install-info clean-info
|
203 |
|
|
install:
|
204 |
|
|
@for file in $(CRT0) $(PCRT0) $(BSP); do \
|
205 |
|
|
$(INSTALL_DATA) $${file} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \
|
206 |
|
|
done
|
207 |
|
|
@for script in ${SCRIPTS}; do\
|
208 |
|
|
$(INSTALL_DATA) ${srcdir}/$${script}.ld $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$${script}.ld; \
|
209 |
|
|
done
|
210 |
|
|
|
211 |
|
|
info:
|
212 |
|
|
install-info:
|
213 |
|
|
clean-info:
|
214 |
|
|
|
215 |
|
|
test.o: ${srcdir}/test.c
|
216 |
|
|
|
217 |
|
|
# these are for the BSPs
|
218 |
|
|
crt0.o: ${srcdir}/crt0.S
|
219 |
|
|
pcrt0.o: ${srcdir}/crt0.S
|
220 |
|
|
$(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) -DGCRT0 ${srcdir}/crt0.S -o ${PCRT0}
|
221 |
|
|
crt0_cfe.o: ${srcdir}/crt0_cfe.S
|
222 |
|
|
crt0_cygmon.o: ${srcdir}/crt0_cygmon.S
|
223 |
|
|
idtmon.o: ${srcdir}/idtmon.S
|
224 |
|
|
pmon.o: ${srcdir}/pmon.S
|
225 |
|
|
$(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) $(PART_SPECIFIC_DEFINES) ${srcdir}/pmon.S -o pmon.o
|
226 |
|
|
vr4300.o: ${srcdir}/vr4300.S
|
227 |
|
|
$(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) ${srcdir}/vr4300.S
|
228 |
|
|
vr5xxx.o: ${srcdir}/vr5xxx.S
|
229 |
|
|
$(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) ${srcdir}/vr5xxx.S
|
230 |
|
|
lsipmon.o: $(srcdir)/lsipmon.S $(srcdir)/pmon.S
|
231 |
|
|
jmr3904-io.o: ${srcdir}/jmr3904-io.c
|
232 |
|
|
$(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) ${srcdir}/jmr3904-io.c -o $@
|
233 |
|
|
cfe.o: ${srcdir}/cfe.c ${srcdir}/cfe_api.h
|
234 |
|
|
$(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) ${srcdir}/cfe.c -o $@
|
235 |
|
|
cfe_api.o: ${srcdir}/cfe_api.c ${srcdir}/cfe_api.h ${srcdir}/cfe_api_int.h
|
236 |
|
|
$(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) ${srcdir}/cfe_api.c -o $@
|
237 |
|
|
cfe_mem.o: ${srcdir}/cfe_mem.c ${srcdir}/cfe_api.h
|
238 |
|
|
$(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) ${srcdir}/cfe_mem.c -o $@
|
239 |
|
|
|
240 |
|
|
# cma101 can not be compiled mips16, if a mips16 version is needed then
|
241 |
|
|
# it will have to be built, then this rule can be scrapped, allowing
|
242 |
|
|
# the implicit rule to run.
|
243 |
|
|
cma101.o: ${srcdir}/cma101.c
|
244 |
|
|
$(CC) -c $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) $(CFLAGS) -mno-mips16 ${srcdir}/cma101.c
|
245 |
|
|
|
246 |
|
|
# cygmon can not be compiled as mips16 since it uses the syscall instruction
|
247 |
|
|
cygmon.o: ${srcdir}/cygmon.c
|
248 |
|
|
$(CC) -c $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) $(CFLAGS) -mno-mips16 ${srcdir}/cygmon.c
|
249 |
|
|
|
250 |
|
|
syscalls.o: ${srcdir}/syscalls.c
|
251 |
|
|
|
252 |
|
|
# target specific makefile fragment comes in here.
|
253 |
|
|
@target_makefile_frag@
|
254 |
|
|
|
255 |
|
|
Makefile: Makefile.in config.status @host_makefile_frag_path@ @target_makefile_frag_path@
|
256 |
|
|
$(SHELL) config.status
|
257 |
|
|
|
258 |
|
|
config.status: configure
|
259 |
|
|
$(SHELL) config.status --recheck
|