1 # Makefile template for Configure for the MIPS simulator.
2 # Written by Cygnus Support.
4 ## COMMON_PRE_CONFIG_FRAG
6 # Object files created by various simulator generators.
34 micromips16_support.o \
35 micromips16_semantics.o \
36 micromips16_idecode.o \
37 micromips16_icache.o \
39 micromips32_support.o \
40 micromips32_semantics.o \
41 micromips32_idecode.o \
42 micromips32_icache.o \
44 micromips_m32_support.o \
45 micromips_m32_semantics.o \
46 micromips_m32_idecode.o \
47 micromips_m32_icache.o \
53 SIM_MULTI_OBJ
= @sim_multi_obj@ \
59 $(SIM_@sim_gen@_OBJ
) \
60 $(SIM_NEW_COMMON_OBJS
) \
67 SIM_EXTRA_HW_DEVICES
= tx3904cpu tx3904irc tx3904tmr tx3904sio
69 # List of flags to always pass to $(CC).
70 SIM_SUBTARGET
=@SIM_SUBTARGET@
71 SIM_EXTRA_CFLAGS
= $(SIM_SUBTARGET
)
73 SIM_EXTRA_CLEAN
= clean-extra
74 SIM_EXTRA_DISTCLEAN
= distclean-extra
76 all: $(SIM_@sim_gen@_ALL
)
78 SIM_EXTRA_DEPS
= itable.h
80 ## COMMON_POST_CONFIG_FRAG
82 IGEN_TRACE
= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries # -G trace-all
83 IGEN_INSN
=$(srcdir)/mips.igen
84 IGEN_DC
=$(srcdir)/mips.dc
85 M16_DC
=$(srcdir)/m16.dc
86 MICROMIPS32_DC
=$(srcdir)/micromips.dc
87 MICROMIPS16_DC
=$(srcdir)/micromips16.dc
89 $(srcdir)/micromipsdsp.igen \
90 $(srcdir)/micromips.igen \
94 $(srcdir)/mips3d.igen \
100 $(srcdir)/mips3264r2.igen \
101 $(srcdir)/mips3264r6.igen \
103 # NB: Since these can be built by a number of generators, care
104 # must be taken to ensure that they are only dependant on
105 # one of those generators.
106 BUILT_SRC_FROM_GEN
= \
110 SIM_IGEN_ALL
= tmp-igen
111 SIM_M16_ALL
= tmp-m16
112 SIM_MICROMIPS_ALL
= tmp-micromips
113 SIM_MULTI_ALL
= tmp-multi
115 $(BUILT_SRC_FROM_GEN
): $(SIM_@sim_gen@_ALL
)
119 BUILT_SRC_FROM_IGEN
= \
134 $(BUILT_SRC_FROM_IGEN
): tmp-igen
136 tmp-igen
: $(IGEN_INSN
) $(IGEN_DC
) $(IGEN
) $(IGEN_INCLUDE
)
137 $(ECHO_IGEN
) $(IGEN_RUN
) \
143 -G gen-direct-access \
150 -n icache.h
-hc tmp-icache.h \
151 -n icache.c
-c tmp-icache.c \
152 -n semantics.h
-hs tmp-semantics.h \
153 -n semantics.c
-s tmp-semantics.c \
154 -n idecode.h
-hd tmp-idecode.h \
155 -n idecode.c
-d tmp-idecode.c \
156 -n model.h
-hm tmp-model.h \
157 -n model.c
-m tmp-model.c \
158 -n support.h
-hf tmp-support.h \
159 -n support.c
-f tmp-support.c \
160 -n itable.h
-ht tmp-itable.h \
161 -n itable.c
-t tmp-itable.c \
162 -n engine.h
-he tmp-engine.h \
163 -n engine.c
-e tmp-engine.c \
164 -n irun.c
-r tmp-irun.c
165 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-icache.h icache.h
166 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-icache.c icache.c
167 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-idecode.h idecode.h
168 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-idecode.c idecode.c
169 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-semantics.h semantics.h
170 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-semantics.c semantics.c
171 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-model.h model.h
172 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-model.c model.c
173 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-support.h support.h
174 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-support.c support.c
175 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-itable.h itable.h
176 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-itable.c itable.c
177 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-engine.h engine.h
178 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-engine.c engine.c
179 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-irun.c irun.c
182 BUILT_SRC_FROM_M16
= \
205 $(BUILT_SRC_FROM_M16
): tmp-m16
207 tmp-m16
: $(IGEN_INSN
) $(IGEN_DC
) $(IGEN
) $(IGEN_INCLUDE
)
208 $(ECHO_IGEN
) $(IGEN_RUN
) \
214 -G gen-direct-access \
222 -n m16_icache.h
-hc tmp-icache.h \
223 -n m16_icache.c
-c tmp-icache.c \
224 -n m16_semantics.h
-hs tmp-semantics.h \
225 -n m16_semantics.c
-s tmp-semantics.c \
226 -n m16_idecode.h
-hd tmp-idecode.h \
227 -n m16_idecode.c
-d tmp-idecode.c \
228 -n m16_model.h
-hm tmp-model.h \
229 -n m16_model.c
-m tmp-model.c \
230 -n m16_support.h
-hf tmp-support.h \
231 -n m16_support.c
-f tmp-support.c \
233 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-icache.h m16_icache.h
234 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-icache.c m16_icache.c
235 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-idecode.h m16_idecode.h
236 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-idecode.c m16_idecode.c
237 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-semantics.h m16_semantics.h
238 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-semantics.c m16_semantics.c
239 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-model.h m16_model.h
240 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-model.c m16_model.c
241 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-support.h m16_support.h
242 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-support.c m16_support.c
243 $(ECHO_IGEN
) $(IGEN_RUN
) \
249 -G gen-direct-access \
257 -n m32_icache.h
-hc tmp-icache.h \
258 -n m32_icache.c
-c tmp-icache.c \
259 -n m32_semantics.h
-hs tmp-semantics.h \
260 -n m32_semantics.c
-s tmp-semantics.c \
261 -n m32_idecode.h
-hd tmp-idecode.h \
262 -n m32_idecode.c
-d tmp-idecode.c \
263 -n m32_model.h
-hm tmp-model.h \
264 -n m32_model.c
-m tmp-model.c \
265 -n m32_support.h
-hf tmp-support.h \
266 -n m32_support.c
-f tmp-support.c \
268 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-icache.h m32_icache.h
269 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-icache.c m32_icache.c
270 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-idecode.h m32_idecode.h
271 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-idecode.c m32_idecode.c
272 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-semantics.h m32_semantics.h
273 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-semantics.c m32_semantics.c
274 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-model.h m32_model.h
275 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-model.c m32_model.c
276 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-support.h m32_support.h
277 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-support.c m32_support.c
278 $(ECHO_IGEN
) $(IGEN_RUN
) \
284 @sim_igen_flags@ @sim_m16_flags@ \
285 -G gen-direct-access \
288 -n itable.h
-ht tmp-itable.h \
289 -n itable.c
-t tmp-itable.c \
291 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-itable.h itable.h
292 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-itable.c itable.c
295 BUILT_SRC_FROM_MICROMIPS
= \
296 micromips16_icache.h \
297 micromips16_icache.c \
298 micromips16_idecode.h \
299 micromips16_idecode.c \
300 micromips16_semantics.h \
301 micromips16_semantics.c \
302 micromips16_model.h \
303 micromips16_model.c \
304 micromips16_support.h \
305 micromips16_support.c \
307 micromips32_icache.h \
308 micromips32_icache.c \
309 micromips32_idecode.h \
310 micromips32_idecode.c \
311 micromips32_semantics.h \
312 micromips32_semantics.c \
313 micromips32_model.h \
314 micromips32_model.c \
315 micromips32_support.h \
316 micromips32_support.c \
318 micromips_m32_icache.h \
319 micromips_m32_icache.c \
320 micromips_m32_idecode.h \
321 micromips_m32_idecode.c \
322 micromips_m32_semantics.h \
323 micromips_m32_semantics.c \
324 micromips_m32_model.h \
325 micromips_m32_model.c \
326 micromips_m32_support.h \
327 micromips_m32_support.c \
329 $(BUILT_SRC_FROM_MICROMIPS
): tmp-micromips
331 tmp-micromips
: $(IGEN_INSN
) $(IGEN_DC
) $(IGEN
) $(IGEN_INCLUDE
)
332 $(ECHO_IGEN
) $(IGEN_RUN
) \
337 @sim_micromips16_flags@ \
338 -G gen-direct-access \
343 -o
$(MICROMIPS16_DC
) \
346 -n micromips16_icache.h
-hc tmp-icache.h \
347 -n micromips16_icache.c
-c tmp-icache.c \
348 -n micromips16_semantics.h
-hs tmp-semantics.h \
349 -n micromips16_semantics.c
-s tmp-semantics.c \
350 -n micromips16_idecode.h
-hd tmp-idecode.h \
351 -n micromips16_idecode.c
-d tmp-idecode.c \
352 -n micromips16_model.h
-hm tmp-model.h \
353 -n micromips16_model.c
-m tmp-model.c \
354 -n micromips16_support.h
-hf tmp-support.h \
355 -n micromips16_support.c
-f tmp-support.c \
357 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-icache.h micromips16_icache.h
358 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-icache.c micromips16_icache.c
359 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-idecode.h micromips16_idecode.h
360 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-idecode.c micromips16_idecode.c
361 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-semantics.h micromips16_semantics.h
362 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-semantics.c micromips16_semantics.c
363 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-model.h micromips16_model.h
364 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-model.c micromips16_model.c
365 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-support.h micromips16_support.h
366 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-support.c micromips16_support.c
367 $(ECHO_IGEN
) $(IGEN_RUN
) \
372 @sim_micromips_flags@ \
373 -G gen-direct-access \
378 -o
$(MICROMIPS32_DC
) \
381 -n micromips32_icache.h
-hc tmp-icache.h \
382 -n micromips32_icache.c
-c tmp-icache.c \
383 -n micromips32_semantics.h
-hs tmp-semantics.h \
384 -n micromips32_semantics.c
-s tmp-semantics.c \
385 -n micromips32_idecode.h
-hd tmp-idecode.h \
386 -n micromips32_idecode.c
-d tmp-idecode.c \
387 -n micromips32_model.h
-hm tmp-model.h \
388 -n micromips32_model.c
-m tmp-model.c \
389 -n micromips32_support.h
-hf tmp-support.h \
390 -n micromips32_support.c
-f tmp-support.c \
392 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-icache.h micromips32_icache.h
393 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-icache.c micromips32_icache.c
394 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-idecode.h micromips32_idecode.h
395 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-idecode.c micromips32_idecode.c
396 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-semantics.h micromips32_semantics.h
397 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-semantics.c micromips32_semantics.c
398 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-model.h micromips32_model.h
399 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-model.c micromips32_model.c
400 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-support.h micromips32_support.h
401 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-support.c micromips32_support.c
402 $(ECHO_IGEN
) $(IGEN_RUN
) \
408 -G gen-direct-access \
416 -n micromips_m32_icache.h
-hc tmp-icache.h \
417 -n micromips_m32_icache.c
-c tmp-icache.c \
418 -n micromips_m32_semantics.h
-hs tmp-semantics.h \
419 -n micromips_m32_semantics.c
-s tmp-semantics.c \
420 -n micromips_m32_idecode.h
-hd tmp-idecode.h \
421 -n micromips_m32_idecode.c
-d tmp-idecode.c \
422 -n micromips_m32_model.h
-hm tmp-model.h \
423 -n micromips_m32_model.c
-m tmp-model.c \
424 -n micromips_m32_support.h
-hf tmp-support.h \
425 -n micromips_m32_support.c
-f tmp-support.c \
427 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-icache.h micromips_m32_icache.h
428 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-icache.c micromips_m32_icache.c
429 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-idecode.h micromips_m32_idecode.h
430 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-idecode.c micromips_m32_idecode.c
431 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-semantics.h micromips_m32_semantics.h
432 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-semantics.c micromips_m32_semantics.c
433 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-model.h micromips_m32_model.h
434 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-model.c micromips_m32_model.c
435 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-support.h micromips_m32_support.h
436 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-support.c micromips_m32_support.c
437 $(ECHO_IGEN
) $(IGEN_RUN
) \
443 @sim_igen_flags@ @sim_micromips_flags@ @sim_micromips16_flags@\
444 -G gen-direct-access \
447 -n itable.h
-ht tmp-itable.h \
448 -n itable.c
-t tmp-itable.c \
450 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-itable.h itable.h
451 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-itable.c itable.c
454 BUILT_SRC_FROM_MULTI
= @sim_multi_src@
455 SIM_MULTI_IGEN_CONFIGS
= @sim_multi_igen_configs@
457 $(BUILT_SRC_FROM_MULTI
): tmp-multi
458 tmp-multi
: tmp-mach-multi tmp-itable-multi tmp-run-multi
459 tmp-mach-multi
: $(IGEN_INSN
) $(IGEN_DC
) $(IGEN
) $(IGEN_INCLUDE
)
460 for t in
$(SIM_MULTI_IGEN_CONFIGS
); do \
461 p
=`echo $${t} | sed -e 's/:.*//'` ; \
462 m
=`echo $${t} | sed -e 's/.*:\(.*\):.*/\1/'` ; \
463 f
=`echo $${t} | sed -e 's/.*://'` ; \
465 micromips16
*) e
="-B 16 -H 15 -o $(MICROMIPS16_DC) -F 16" ;; \
466 micromips32
* | micromips64
*) \
467 e
="-B 32 -H 31 -o $(MICROMIPS32_DC) -F $${f}" ;; \
469 e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}"; \
470 m
="mips32r2,mips3d,mdmx,dsp,dsp2,smartmips" ;; \
472 e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}"; \
473 m
="mips64r2,mips3d,mdmx,dsp,dsp2,smartmips" ;; \
474 m16
*) e
="-B 16 -H 15 -o $(M16_DC) -F 16" ;; \
475 *) e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}" ;; \
485 -G gen-direct-access \
490 -n
$${p}_icache.h
-hc tmp-icache.h \
491 -n
$${p}_icache.c
-c tmp-icache.c \
492 -n
$${p}_semantics.h
-hs tmp-semantics.h \
493 -n
$${p}_semantics.c
-s tmp-semantics.c \
494 -n
$${p}_idecode.h
-hd tmp-idecode.h \
495 -n
$${p}_idecode.c
-d tmp-idecode.c \
496 -n
$${p}_model.h
-hm tmp-model.h \
497 -n
$${p}_model.c
-m tmp-model.c \
498 -n
$${p}_support.h
-hf tmp-support.h \
499 -n
$${p}_support.c
-f tmp-support.c \
500 -n
$${p}_engine.h
-he tmp-engine.h \
501 -n
$${p}_engine.c
-e tmp-engine.c \
503 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
505 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
507 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
509 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
511 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
512 $${p}_semantics.h
; \
513 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
514 $${p}_semantics.c
; \
515 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
517 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
519 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
521 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
523 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.h \
525 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.c \
529 tmp-itable-multi
: $(IGEN_INSN
) $(IGEN_DC
) $(IGEN
) $(IGEN_INCLUDE
)
530 $(ECHO_IGEN
) $(IGEN_RUN
) \
538 -G gen-direct-access \
541 -n itable.h
-ht tmp-itable.h \
542 -n itable.c
-t tmp-itable.c \
544 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-itable.h itable.h
545 $(SILENCE
) $(SHELL
) $(srcroot
)/move-if-change tmp-itable.c itable.c
547 tmp-run-multi
: $(srcdir)/m16run.c
$(srcdir)/micromipsrun.c
548 for t in
$(SIM_MULTI_IGEN_CONFIGS
); do \
551 m
=`echo $${t} | sed -e 's/^m16//' -e 's/:.*//'`; \
552 sed
< $(srcdir)/m16run.c
> tmp-run \
553 -e
"s/^sim_/m16$${m}_/" \
554 -e
"/include/s/sim-engine/m16$${m}_engine/" \
555 -e
"s/m16_/m16$${m}_/" \
556 -e
"s/m32_/m32$${m}_/" ; \
557 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
561 m
=`echo $${t} | sed -e 's/^micromips32//' -e 's/:.*//'`; \
562 sed
< $(srcdir)/micromipsrun.c
> tmp-run \
563 -e
"s/^sim_/micromips32$${m}_/" \
564 -e
"/include/s/sim-engine/micromips32$${m}_engine/" \
565 -e
"s/micromips16_/micromips16$${m}_/" \
566 -e
"s/micromips32_/micromips32$${m}_/" \
567 -e
"s/m32_/m32$${m}_/" ; \
568 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
569 micromips
$${m}_run.c
; \
572 m
=`echo $${t} | sed -e 's/^micromips64//' -e 's/:.*//'`; \
573 sed
< $(srcdir)/micromipsrun.c
> tmp-run \
574 -e
"s/^sim_/micromips64$${m}_/" \
575 -e
"/include/s/sim-engine/micromips64$${m}_engine/" \
576 -e
"s/micromips16_/micromips16$${m}_/" \
577 -e
"s/micromips32_/micromips64$${m}_/" \
578 -e
"s/m32_/m64$${m}_/" ; \
579 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
580 micromips
$${m}_run.c
; \
587 rm -f
$(BUILT_SRC_FROM_GEN
)
588 rm -f
$(BUILT_SRC_FROM_IGEN
)
589 rm -f
$(BUILT_SRC_FROM_M16
)
590 rm -f
$(BUILT_SRC_FROM_MICROMIPS
)
591 rm -f
$(BUILT_SRC_FROM_MULTI
)
593 rm -f micromips16
*.o micromips32
*.o m16
*.o m32
*.o itable
*.o
596 rm -f multi-include.h multi-run.c