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