Commit | Line | Data |
---|---|---|
c906108c SS |
1 | # Makefile template for Configure for the MIPS simulator. |
2 | # Written by Cygnus Support. | |
3 | ||
4 | ## COMMON_PRE_CONFIG_FRAG | |
5 | ||
6 | srcdir=@srcdir@ | |
7 | srcroot=$(srcdir)/../../ | |
8 | ||
9 | # Object files created by various simulator generators. | |
10 | ||
11 | ||
12 | SIM_IGEN_OBJ = \ | |
13 | support.o \ | |
14 | itable.o \ | |
15 | semantics.o \ | |
16 | idecode.o \ | |
17 | icache.o \ | |
18 | @mips_igen_engine@ \ | |
19 | irun.o \ | |
20 | ||
21 | ||
22 | SIM_M16_OBJ = \ | |
23 | m16_support.o \ | |
24 | m16_semantics.o \ | |
25 | m16_idecode.o \ | |
26 | m16_icache.o \ | |
27 | \ | |
28 | m32_support.o \ | |
29 | m32_semantics.o \ | |
30 | m32_idecode.o \ | |
31 | m32_icache.o \ | |
32 | \ | |
33 | itable.o \ | |
34 | m16run.o \ | |
35 | ||
4c54fc26 | 36 | SIM_MULTI_OBJ = itable.o @sim_multi_obj@ |
c906108c SS |
37 | |
38 | MIPS_EXTRA_OBJS = @mips_extra_objs@ | |
39 | MIPS_EXTRA_LIBS = @mips_extra_libs@ | |
40 | ||
41 | SIM_OBJS = \ | |
42 | $(SIM_@sim_gen@_OBJ) \ | |
43 | $(SIM_NEW_COMMON_OBJS) \ | |
44 | $(MIPS_EXTRA_OBJS) \ | |
487f79b7 | 45 | cp1.o \ |
c906108c | 46 | interp.o \ |
f4f1b9f1 | 47 | mdmx.o \ |
c906108c SS |
48 | sim-main.o \ |
49 | sim-hload.o \ | |
50 | sim-engine.o \ | |
51 | sim-stop.o \ | |
52 | sim-resume.o \ | |
53 | sim-reason.o \ | |
54 | ||
55 | ||
56 | # List of flags to always pass to $(CC). | |
57 | SIM_SUBTARGET=@SIM_SUBTARGET@ | |
58 | SIM_EXTRA_CFLAGS = $(SIM_SUBTARGET) | |
59 | ||
60 | SIM_EXTRA_CLEAN = clean-extra | |
4c54fc26 | 61 | SIM_EXTRA_DISTCLEAN = distclean-extra |
c906108c SS |
62 | |
63 | SIM_EXTRA_ALL = $(SIM_@sim_gen@_ALL) | |
64 | ||
65 | SIM_EXTRA_LIBS = $(MIPS_EXTRA_LIBS) | |
66 | ||
67 | # List of main object files for `run'. | |
68 | SIM_RUN_OBJS = nrun.o | |
69 | ||
70 | ||
71 | ||
72 | ## COMMON_POST_CONFIG_FRAG | |
73 | ||
74 | interp.o: $(srcdir)/interp.c config.h sim-main.h itable.h | |
487f79b7 | 75 | cp1.o: $(srcdir)/cp1.c config.h sim-main.h |
c906108c | 76 | |
f4f1b9f1 | 77 | mdmx.o: $(srcdir)/mdmx.c $(srcdir)/sim-main.h |
c906108c | 78 | |
4c54fc26 CD |
79 | multi-run.o: multi-include.h tmp-mach-multi |
80 | ||
c906108c SS |
81 | ../igen/igen: |
82 | cd ../igen && $(MAKE) | |
83 | ||
84 | IGEN_TRACE= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries # -G trace-all | |
85 | IGEN_INSN=$(srcdir)/mips.igen | |
86 | IGEN_DC=$(srcdir)/mips.dc | |
87 | M16_DC=$(srcdir)/m16.dc | |
88 | IGEN_INCLUDE=\ | |
89 | $(srcdir)/m16.igen \ | |
909daa82 | 90 | $(srcdir)/mdmx.igen \ |
e7e81181 | 91 | $(srcdir)/mips3d.igen \ |
7cbea089 | 92 | $(srcdir)/sb1.igen \ |
c906108c SS |
93 | $(srcdir)/tx.igen \ |
94 | $(srcdir)/vr.igen \ | |
95 | ||
96 | # NB: Since these can be built by a number of generators, care | |
97 | # must be taken to ensure that they are only dependant on | |
98 | # one of those generators. | |
99 | BUILT_SRC_FROM_GEN = \ | |
100 | itable.h \ | |
101 | itable.c \ | |
102 | ||
103 | SIM_IGEN_ALL = tmp-igen | |
104 | SIM_M16_ALL = tmp-m16 | |
4c54fc26 | 105 | SIM_MULTI_ALL = tmp-multi |
c906108c SS |
106 | |
107 | $(BUILT_SRC_FROM_GEN): $(SIM_@sim_gen@_ALL) | |
108 | ||
109 | ||
110 | ||
111 | BUILT_SRC_FROM_IGEN = \ | |
112 | icache.h \ | |
113 | icache.c \ | |
114 | idecode.h \ | |
115 | idecode.c \ | |
116 | semantics.h \ | |
117 | semantics.c \ | |
118 | model.h \ | |
119 | model.c \ | |
120 | support.h \ | |
121 | support.c \ | |
122 | engine.h \ | |
123 | engine.c \ | |
124 | irun.c \ | |
125 | ||
126 | $(BUILT_SRC_FROM_IGEN): tmp-igen | |
127 | ||
128 | tmp-igen: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE) | |
129 | cd ../igen && $(MAKE) | |
130 | ../igen/igen \ | |
131 | $(IGEN_TRACE) \ | |
132 | -I $(srcdir) \ | |
133 | -Werror \ | |
134 | -Wnodiscard \ | |
135 | @sim_igen_flags@ \ | |
136 | -G gen-direct-access \ | |
137 | -G gen-zero-r0 \ | |
138 | -B 32 \ | |
139 | -H 31 \ | |
140 | -i $(IGEN_INSN) \ | |
141 | -o $(IGEN_DC) \ | |
142 | -x \ | |
143 | -n icache.h -hc tmp-icache.h \ | |
144 | -n icache.c -c tmp-icache.c \ | |
145 | -n semantics.h -hs tmp-semantics.h \ | |
146 | -n semantics.c -s tmp-semantics.c \ | |
147 | -n idecode.h -hd tmp-idecode.h \ | |
148 | -n idecode.c -d tmp-idecode.c \ | |
149 | -n model.h -hm tmp-model.h \ | |
150 | -n model.c -m tmp-model.c \ | |
151 | -n support.h -hf tmp-support.h \ | |
152 | -n support.c -f tmp-support.c \ | |
153 | -n itable.h -ht tmp-itable.h \ | |
154 | -n itable.c -t tmp-itable.c \ | |
155 | -n engine.h -he tmp-engine.h \ | |
156 | -n engine.c -e tmp-engine.c \ | |
157 | -n irun.c -r tmp-irun.c | |
158 | $(srcdir)/../../move-if-change tmp-icache.h icache.h | |
159 | $(srcdir)/../../move-if-change tmp-icache.c icache.c | |
160 | $(srcdir)/../../move-if-change tmp-idecode.h idecode.h | |
161 | $(srcdir)/../../move-if-change tmp-idecode.c idecode.c | |
162 | $(srcdir)/../../move-if-change tmp-semantics.h semantics.h | |
163 | $(srcdir)/../../move-if-change tmp-semantics.c semantics.c | |
164 | $(srcdir)/../../move-if-change tmp-model.h model.h | |
165 | $(srcdir)/../../move-if-change tmp-model.c model.c | |
166 | $(srcdir)/../../move-if-change tmp-support.h support.h | |
167 | $(srcdir)/../../move-if-change tmp-support.c support.c | |
168 | $(srcdir)/../../move-if-change tmp-itable.h itable.h | |
169 | $(srcdir)/../../move-if-change tmp-itable.c itable.c | |
170 | $(srcdir)/../../move-if-change tmp-engine.h engine.h | |
171 | $(srcdir)/../../move-if-change tmp-engine.c engine.c | |
172 | $(srcdir)/../../move-if-change tmp-irun.c irun.c | |
173 | touch tmp-igen | |
174 | ||
175 | semantics.o: sim-main.h semantics.c $(SIM_EXTRA_DEPS) | |
176 | engine.o: sim-main.h engine.c $(SIM_EXTRA_DEPS) | |
177 | support.o: sim-main.h support.c $(SIM_EXTRA_DEPS) | |
178 | idecode.o: sim-main.h idecode.c $(SIM_EXTRA_DEPS) | |
179 | itable.o: sim-main.h itable.c $(SIM_EXTRA_DEPS) | |
180 | ||
181 | ||
182 | ||
183 | ||
184 | BUILT_SRC_FROM_M16 = \ | |
185 | m16_icache.h \ | |
186 | m16_icache.c \ | |
187 | m16_idecode.h \ | |
188 | m16_idecode.c \ | |
189 | m16_semantics.h \ | |
190 | m16_semantics.c \ | |
191 | m16_model.h \ | |
192 | m16_model.c \ | |
193 | m16_support.h \ | |
194 | m16_support.c \ | |
195 | \ | |
196 | m32_icache.h \ | |
197 | m32_icache.c \ | |
198 | m32_idecode.h \ | |
199 | m32_idecode.c \ | |
200 | m32_semantics.h \ | |
201 | m32_semantics.c \ | |
202 | m32_model.h \ | |
203 | m32_model.c \ | |
204 | m32_support.h \ | |
205 | m32_support.c \ | |
206 | ||
207 | $(BUILT_SRC_FROM_M16): tmp-m16 | |
208 | ||
209 | tmp-m16: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE) | |
210 | cd ../igen && $(MAKE) | |
211 | ../igen/igen \ | |
212 | $(IGEN_TRACE) \ | |
213 | -I $(srcdir) \ | |
214 | -Werror \ | |
215 | -Wnodiscard \ | |
216 | @sim_m16_flags@ \ | |
217 | -G gen-direct-access \ | |
218 | -G gen-zero-r0 \ | |
219 | -B 16 \ | |
220 | -H 15 \ | |
221 | -i $(IGEN_INSN) \ | |
222 | -o $(M16_DC) \ | |
223 | -P m16_ \ | |
224 | -x \ | |
225 | -n m16_icache.h -hc tmp-icache.h \ | |
226 | -n m16_icache.c -c tmp-icache.c \ | |
227 | -n m16_semantics.h -hs tmp-semantics.h \ | |
228 | -n m16_semantics.c -s tmp-semantics.c \ | |
229 | -n m16_idecode.h -hd tmp-idecode.h \ | |
230 | -n m16_idecode.c -d tmp-idecode.c \ | |
231 | -n m16_model.h -hm tmp-model.h \ | |
232 | -n m16_model.c -m tmp-model.c \ | |
233 | -n m16_support.h -hf tmp-support.h \ | |
234 | -n m16_support.c -f tmp-support.c \ | |
235 | # | |
236 | $(srcdir)/../../move-if-change tmp-icache.h m16_icache.h | |
237 | $(srcdir)/../../move-if-change tmp-icache.c m16_icache.c | |
238 | $(srcdir)/../../move-if-change tmp-idecode.h m16_idecode.h | |
239 | $(srcdir)/../../move-if-change tmp-idecode.c m16_idecode.c | |
240 | $(srcdir)/../../move-if-change tmp-semantics.h m16_semantics.h | |
241 | $(srcdir)/../../move-if-change tmp-semantics.c m16_semantics.c | |
242 | $(srcdir)/../../move-if-change tmp-model.h m16_model.h | |
243 | $(srcdir)/../../move-if-change tmp-model.c m16_model.c | |
244 | $(srcdir)/../../move-if-change tmp-support.h m16_support.h | |
245 | $(srcdir)/../../move-if-change tmp-support.c m16_support.c | |
246 | ../igen/igen \ | |
247 | $(IGEN_TRACE) \ | |
248 | -I $(srcdir) \ | |
249 | -Werror \ | |
250 | -Wnodiscard \ | |
251 | @sim_igen_flags@ \ | |
252 | -G gen-direct-access \ | |
253 | -G gen-zero-r0 \ | |
254 | -B 32 \ | |
255 | -H 31 \ | |
256 | -i $(IGEN_INSN) \ | |
257 | -o $(IGEN_DC) \ | |
258 | -P m32_ \ | |
259 | -x \ | |
260 | -n m32_icache.h -hc tmp-icache.h \ | |
261 | -n m32_icache.c -c tmp-icache.c \ | |
262 | -n m32_semantics.h -hs tmp-semantics.h \ | |
263 | -n m32_semantics.c -s tmp-semantics.c \ | |
264 | -n m32_idecode.h -hd tmp-idecode.h \ | |
265 | -n m32_idecode.c -d tmp-idecode.c \ | |
266 | -n m32_model.h -hm tmp-model.h \ | |
267 | -n m32_model.c -m tmp-model.c \ | |
268 | -n m32_support.h -hf tmp-support.h \ | |
269 | -n m32_support.c -f tmp-support.c \ | |
270 | # | |
271 | $(srcdir)/../../move-if-change tmp-icache.h m32_icache.h | |
272 | $(srcdir)/../../move-if-change tmp-icache.c m32_icache.c | |
273 | $(srcdir)/../../move-if-change tmp-idecode.h m32_idecode.h | |
274 | $(srcdir)/../../move-if-change tmp-idecode.c m32_idecode.c | |
275 | $(srcdir)/../../move-if-change tmp-semantics.h m32_semantics.h | |
276 | $(srcdir)/../../move-if-change tmp-semantics.c m32_semantics.c | |
277 | $(srcdir)/../../move-if-change tmp-model.h m32_model.h | |
278 | $(srcdir)/../../move-if-change tmp-model.c m32_model.c | |
279 | $(srcdir)/../../move-if-change tmp-support.h m32_support.h | |
280 | $(srcdir)/../../move-if-change tmp-support.c m32_support.c | |
281 | ../igen/igen \ | |
282 | $(IGEN_TRACE) \ | |
283 | -I $(srcdir) \ | |
284 | -Werror \ | |
285 | -Wnodiscard \ | |
286 | -Wnowidth \ | |
287 | @sim_igen_flags@ @sim_m16_flags@ \ | |
288 | -G gen-direct-access \ | |
289 | -G gen-zero-r0 \ | |
290 | -i $(IGEN_INSN) \ | |
291 | -n itable.h -ht tmp-itable.h \ | |
292 | -n itable.c -t tmp-itable.c \ | |
293 | # | |
294 | $(srcdir)/../../move-if-change tmp-itable.h itable.h | |
295 | $(srcdir)/../../move-if-change tmp-itable.c itable.c | |
296 | touch tmp-m16 | |
297 | ||
298 | ||
4c54fc26 CD |
299 | BUILT_SRC_FROM_MULTI = @sim_multi_src@ |
300 | SIM_MULTI_IGEN_CONFIGS = @sim_multi_igen_configs@ | |
301 | ||
302 | $(BUILT_SRC_FROM_MULTI): tmp-multi | |
303 | tmp-multi: tmp-mach-multi tmp-itable-multi tmp-run-multi targ-vals.h | |
304 | tmp-mach-multi: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE) | |
305 | for t in $(SIM_MULTI_IGEN_CONFIGS); do \ | |
306 | p=`echo $${t} | sed -e 's/:.*//'` ; \ | |
307 | m=`echo $${t} | sed -e 's/.*:\(.*\):.*/\1/'` ; \ | |
308 | f=`echo $${t} | sed -e 's/.*://'` ; \ | |
309 | case $${p} in \ | |
310 | m16*) e="-B 16 -H 15 -o $(M16_DC) -F 16" ;; \ | |
311 | *) e="-B 32 -H 31 -o $(IGEN_DC) -F $${f}" ;; \ | |
312 | esac; \ | |
313 | ../igen/igen \ | |
314 | $(IGEN_TRACE) \ | |
315 | $${e} \ | |
316 | -I $(srcdir) \ | |
317 | -Werror \ | |
318 | -Wnodiscard \ | |
319 | -N 0 \ | |
320 | -M $${m} \ | |
321 | -G gen-direct-access \ | |
322 | -G gen-zero-r0 \ | |
323 | -i $(IGEN_INSN) \ | |
324 | -P $${p}_ \ | |
325 | -x \ | |
326 | -n $${p}_icache.h -hc tmp-icache.h \ | |
327 | -n $${p}_icache.c -c tmp-icache.c \ | |
328 | -n $${p}_semantics.h -hs tmp-semantics.h \ | |
329 | -n $${p}_semantics.c -s tmp-semantics.c \ | |
330 | -n $${p}_idecode.h -hd tmp-idecode.h \ | |
331 | -n $${p}_idecode.c -d tmp-idecode.c \ | |
332 | -n $${p}_model.h -hm tmp-model.h \ | |
333 | -n $${p}_model.c -m tmp-model.c \ | |
334 | -n $${p}_support.h -hf tmp-support.h \ | |
335 | -n $${p}_support.c -f tmp-support.c \ | |
336 | -n $${p}_engine.h -he tmp-engine.h \ | |
337 | -n $${p}_engine.c -e tmp-engine.c \ | |
338 | ; \ | |
339 | $(srcdir)/../../move-if-change tmp-icache.h $${p}_icache.h ; \ | |
340 | $(srcdir)/../../move-if-change tmp-icache.c $${p}_icache.c ; \ | |
341 | $(srcdir)/../../move-if-change tmp-idecode.h $${p}_idecode.h ; \ | |
342 | $(srcdir)/../../move-if-change tmp-idecode.c $${p}_idecode.c ; \ | |
343 | $(srcdir)/../../move-if-change tmp-semantics.h $${p}_semantics.h ; \ | |
344 | $(srcdir)/../../move-if-change tmp-semantics.c $${p}_semantics.c ; \ | |
345 | $(srcdir)/../../move-if-change tmp-model.h $${p}_model.h ; \ | |
346 | $(srcdir)/../../move-if-change tmp-model.c $${p}_model.c ; \ | |
347 | $(srcdir)/../../move-if-change tmp-support.h $${p}_support.h ; \ | |
348 | $(srcdir)/../../move-if-change tmp-support.c $${p}_support.c ; \ | |
349 | $(srcdir)/../../move-if-change tmp-engine.h $${p}_engine.h ; \ | |
350 | $(srcdir)/../../move-if-change tmp-engine.c $${p}_engine.c ; \ | |
351 | done | |
352 | touch tmp-mach-multi | |
353 | tmp-itable-multi: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE) | |
354 | ../igen/igen \ | |
355 | $(IGEN_TRACE) \ | |
356 | -I $(srcdir) \ | |
357 | -Werror \ | |
358 | -Wnodiscard \ | |
359 | -Wnowidth \ | |
360 | -N 0 \ | |
361 | @sim_multi_flags@ \ | |
362 | -G gen-direct-access \ | |
363 | -G gen-zero-r0 \ | |
364 | -i $(IGEN_INSN) \ | |
365 | -n itable.h -ht tmp-itable.h \ | |
366 | -n itable.c -t tmp-itable.c \ | |
367 | # | |
368 | $(srcdir)/../../move-if-change tmp-itable.h itable.h | |
369 | $(srcdir)/../../move-if-change tmp-itable.c itable.c | |
370 | touch tmp-itable-multi | |
371 | tmp-run-multi: $(srcdir)/m16run.c | |
372 | for t in $(SIM_MULTI_IGEN_CONFIGS); do \ | |
373 | case $${t} in \ | |
80551777 | 374 | m16*) \ |
4c54fc26 CD |
375 | m=`echo $${t} | sed -e 's/^m16//' -e 's/:.*//'`; \ |
376 | sed < $(srcdir)/m16run.c > tmp-run \ | |
377 | -e "s/^sim_/m16$${m}_/" \ | |
378 | -e "s/m16_/m16$${m}_/" \ | |
379 | -e "s/m32_/m32$${m}_/" ; \ | |
380 | $(srcdir)/../../move-if-change tmp-run m16$${m}_run.c ; \ | |
381 | esac \ | |
382 | done | |
383 | touch tmp-run-multi | |
384 | ||
c906108c SS |
385 | clean-extra: |
386 | rm -f $(BUILT_SRC_FROM_GEN) | |
387 | rm -f $(BUILT_SRC_FROM_IGEN) | |
388 | rm -f $(BUILT_SRC_FROM_M16) | |
4c54fc26 | 389 | rm -f $(BUILT_SRC_FROM_MULTI) |
c906108c | 390 | rm -f tmp-* |
071da002 | 391 | rm -f m16*.o m32*.o itable*.o |
c906108c | 392 | |
4c54fc26 CD |
393 | distclean-extra: |
394 | rm -f multi-include.h multi-run.c |