1 # Makefile template for Configure for the MIPS simulator.
2 # Written by Cygnus Support.
6 ## COMMON_PRE_CONFIG_FRAG
9 srcroot
=$(srcdir)/..
/..
/
11 # Object files created by various simulator generators.
39 micromips16_support.o \
40 micromips16_semantics.o \
41 micromips16_idecode.o \
42 micromips16_icache.o \
44 micromips32_support.o \
45 micromips32_semantics.o \
46 micromips32_idecode.o \
47 micromips32_icache.o \
49 micromips_m32_support.o \
50 micromips_m32_semantics.o \
51 micromips_m32_idecode.o \
52 micromips_m32_icache.o \
58 SIM_MULTI_OBJ
= @sim_multi_obj@ \
62 MIPS_EXTRA_LIBS
= @mips_extra_libs@
66 $(SIM_@sim_gen@_OBJ
) \
67 $(SIM_NEW_COMMON_OBJS
) \
78 # List of flags to always pass to $(CC).
79 SIM_SUBTARGET
=@SIM_SUBTARGET@
80 SIM_EXTRA_CFLAGS
= $(SIM_SUBTARGET
)
82 SIM_EXTRA_CLEAN
= clean-extra
83 SIM_EXTRA_DISTCLEAN
= distclean-extra
85 SIM_EXTRA_ALL
= $(SIM_@sim_gen@_ALL
)
87 SIM_EXTRA_LIBS
= $(MIPS_EXTRA_LIBS
)
90 ## COMMON_POST_CONFIG_FRAG
92 interp.o
: $(srcdir)/interp.c config.h sim-main.h itable.h
94 m16run.o
: sim-main.h m16_idecode.h m32_idecode.h m16run.c
$(SIM_EXTRA_DEPS
)
96 micromipsrun.o
: sim-main.h micromips16_idecode.h micromips32_idecode.h \
97 micromips_m32_idecode.h micromipsrun.c
$(SIM_EXTRA_DEPS
)
99 multi-run.o
: multi-include.h tmp-mach-multi
102 cd ..
/igen
&& $(MAKE
)
104 IGEN_TRACE
= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries # -G trace-all
105 IGEN_INSN
=$(srcdir)/mips.igen
106 IGEN_DC
=$(srcdir)/mips.dc
107 M16_DC
=$(srcdir)/m16.dc
108 MICROMIPS32_DC
=$(srcdir)/micromips.dc
109 MICROMIPS16_DC
=$(srcdir)/micromips16.dc
111 $(srcdir)/micromipsdsp.igen \
112 $(srcdir)/micromips.igen \
114 $(srcdir)/m16e.igen \
115 $(srcdir)/mdmx.igen \
116 $(srcdir)/mips3d.igen \
121 $(srcdir)/dsp2.igen \
122 $(srcdir)/mips3264r2.igen \
124 # NB: Since these can be built by a number of generators, care
125 # must be taken to ensure that they are only dependant on
126 # one of those generators.
127 BUILT_SRC_FROM_GEN
= \
131 SIM_IGEN_ALL
= tmp-igen
132 SIM_M16_ALL
= tmp-m16
133 SIM_MICROMIPS_ALL
= tmp-micromips
134 SIM_MULTI_ALL
= tmp-multi
136 $(BUILT_SRC_FROM_GEN
): $(SIM_@sim_gen@_ALL
)
140 BUILT_SRC_FROM_IGEN
= \
155 $(BUILT_SRC_FROM_IGEN
): tmp-igen
157 tmp-igen
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
158 cd ..
/igen
&& $(MAKE
)
165 -G gen-direct-access \
172 -n icache.h
-hc tmp-icache.h \
173 -n icache.c
-c tmp-icache.c \
174 -n semantics.h
-hs tmp-semantics.h \
175 -n semantics.c
-s tmp-semantics.c \
176 -n idecode.h
-hd tmp-idecode.h \
177 -n idecode.c
-d tmp-idecode.c \
178 -n model.h
-hm tmp-model.h \
179 -n model.c
-m tmp-model.c \
180 -n support.h
-hf tmp-support.h \
181 -n support.c
-f tmp-support.c \
182 -n itable.h
-ht tmp-itable.h \
183 -n itable.c
-t tmp-itable.c \
184 -n engine.h
-he tmp-engine.h \
185 -n engine.c
-e tmp-engine.c \
186 -n irun.c
-r tmp-irun.c
187 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h icache.h
188 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c icache.c
189 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h idecode.h
190 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c idecode.c
191 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h semantics.h
192 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c semantics.c
193 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h model.h
194 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c model.c
195 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h support.h
196 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c support.c
197 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
198 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
199 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.h engine.h
200 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.c engine.c
201 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-irun.c irun.c
204 BUILT_SRC_FROM_M16
= \
227 $(BUILT_SRC_FROM_M16
): tmp-m16
229 tmp-m16
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
230 cd ..
/igen
&& $(MAKE
)
237 -G gen-direct-access \
245 -n m16_icache.h
-hc tmp-icache.h \
246 -n m16_icache.c
-c tmp-icache.c \
247 -n m16_semantics.h
-hs tmp-semantics.h \
248 -n m16_semantics.c
-s tmp-semantics.c \
249 -n m16_idecode.h
-hd tmp-idecode.h \
250 -n m16_idecode.c
-d tmp-idecode.c \
251 -n m16_model.h
-hm tmp-model.h \
252 -n m16_model.c
-m tmp-model.c \
253 -n m16_support.h
-hf tmp-support.h \
254 -n m16_support.c
-f tmp-support.c \
256 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h m16_icache.h
257 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c m16_icache.c
258 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h m16_idecode.h
259 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c m16_idecode.c
260 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h m16_semantics.h
261 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c m16_semantics.c
262 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h m16_model.h
263 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c m16_model.c
264 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h m16_support.h
265 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c m16_support.c
272 -G gen-direct-access \
280 -n m32_icache.h
-hc tmp-icache.h \
281 -n m32_icache.c
-c tmp-icache.c \
282 -n m32_semantics.h
-hs tmp-semantics.h \
283 -n m32_semantics.c
-s tmp-semantics.c \
284 -n m32_idecode.h
-hd tmp-idecode.h \
285 -n m32_idecode.c
-d tmp-idecode.c \
286 -n m32_model.h
-hm tmp-model.h \
287 -n m32_model.c
-m tmp-model.c \
288 -n m32_support.h
-hf tmp-support.h \
289 -n m32_support.c
-f tmp-support.c \
291 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h m32_icache.h
292 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c m32_icache.c
293 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h m32_idecode.h
294 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c m32_idecode.c
295 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
297 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
299 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h m32_model.h
300 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c m32_model.c
301 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h m32_support.h
302 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c m32_support.c
309 @sim_igen_flags@ @sim_m16_flags@ \
310 -G gen-direct-access \
313 -n itable.h
-ht tmp-itable.h \
314 -n itable.c
-t tmp-itable.c \
316 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
317 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
320 BUILT_SRC_FROM_MICROMIPS
= \
321 micromips16_icache.h \
322 micromips16_icache.c \
323 micromips16_idecode.h \
324 micromips16_idecode.c \
325 micromips16_semantics.h \
326 micromips16_semantics.c \
327 micromips16_model.h \
328 micromips16_model.c \
329 micromips16_support.h \
330 micromips16_support.c \
332 micromips32_icache.h \
333 micromips32_icache.c \
334 micromips32_idecode.h \
335 micromips32_idecode.c \
336 micromips32_semantics.h \
337 micromips32_semantics.c \
338 micromips32_model.h \
339 micromips32_model.c \
340 micromips32_support.h \
341 micromips32_support.c \
343 micromips_m32_icache.h \
344 micromips_m32_icache.c \
345 micromips_m32_idecode.h \
346 micromips_m32_idecode.c \
347 micromips_m32_semantics.h \
348 micromips_m32_semantics.c \
349 micromips_m32_model.h \
350 micromips_m32_model.c \
351 micromips_m32_support.h \
352 micromips_m32_support.c \
354 $(BUILT_SRC_FROM_MICROMIPS
): tmp-micromips
356 tmp-micromips
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
357 cd ..
/igen
&& $(MAKE
)
363 @sim_micromips16_flags@ \
364 -G gen-direct-access \
369 -o
$(MICROMIPS16_DC
) \
372 -n micromips16_icache.h
-hc tmp-icache.h \
373 -n micromips16_icache.c
-c tmp-icache.c \
374 -n micromips16_semantics.h
-hs tmp-semantics.h \
375 -n micromips16_semantics.c
-s tmp-semantics.c \
376 -n micromips16_idecode.h
-hd tmp-idecode.h \
377 -n micromips16_idecode.c
-d tmp-idecode.c \
378 -n micromips16_model.h
-hm tmp-model.h \
379 -n micromips16_model.c
-m tmp-model.c \
380 -n micromips16_support.h
-hf tmp-support.h \
381 -n micromips16_support.c
-f tmp-support.c \
383 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
385 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
387 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
388 micromips16_idecode.h
389 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
390 micromips16_idecode.c
391 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
392 micromips16_semantics.h
393 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
394 micromips16_semantics.c
395 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
397 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
399 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
400 micromips16_support.h
401 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
402 micromips16_support.c
403 cd ..
/igen
&& $(MAKE
)
409 @sim_micromips_flags@ \
410 -G gen-direct-access \
415 -o
$(MICROMIPS32_DC
) \
418 -n micromips32_icache.h
-hc tmp-icache.h \
419 -n micromips32_icache.c
-c tmp-icache.c \
420 -n micromips32_semantics.h
-hs tmp-semantics.h \
421 -n micromips32_semantics.c
-s tmp-semantics.c \
422 -n micromips32_idecode.h
-hd tmp-idecode.h \
423 -n micromips32_idecode.c
-d tmp-idecode.c \
424 -n micromips32_model.h
-hm tmp-model.h \
425 -n micromips32_model.c
-m tmp-model.c \
426 -n micromips32_support.h
-hf tmp-support.h \
427 -n micromips32_support.c
-f tmp-support.c \
429 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
431 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
433 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
434 micromips32_idecode.h
435 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
436 micromips32_idecode.c
437 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
438 micromips32_semantics.h
439 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
440 micromips32_semantics.c
441 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
443 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
445 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
446 micromips32_support.h
447 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
448 micromips32_support.c
455 -G gen-direct-access \
463 -n micromips_m32_icache.h
-hc tmp-icache.h \
464 -n micromips_m32_icache.c
-c tmp-icache.c \
465 -n micromips_m32_semantics.h
-hs tmp-semantics.h \
466 -n micromips_m32_semantics.c
-s tmp-semantics.c \
467 -n micromips_m32_idecode.h
-hd tmp-idecode.h \
468 -n micromips_m32_idecode.c
-d tmp-idecode.c \
469 -n micromips_m32_model.h
-hm tmp-model.h \
470 -n micromips_m32_model.c
-m tmp-model.c \
471 -n micromips_m32_support.h
-hf tmp-support.h \
472 -n micromips_m32_support.c
-f tmp-support.c \
474 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
475 micromips_m32_icache.h
476 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
477 micromips_m32_icache.c
478 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
479 micromips_m32_idecode.h
480 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
481 micromips_m32_idecode.c
482 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
483 micromips_m32_semantics.h
484 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
485 micromips_m32_semantics.c
486 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
487 micromips_m32_model.h
488 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
489 micromips_m32_model.c
490 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
491 micromips_m32_support.h
492 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
493 micromips_m32_support.c
500 @sim_igen_flags@ @sim_micromips_flags@ @sim_micromips16_flags@\
501 -G gen-direct-access \
504 -n itable.h
-ht tmp-itable.h \
505 -n itable.c
-t tmp-itable.c \
507 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
508 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
511 BUILT_SRC_FROM_MULTI
= @sim_multi_src@
512 SIM_MULTI_IGEN_CONFIGS
= @sim_multi_igen_configs@
514 $(BUILT_SRC_FROM_MULTI
): tmp-multi
515 tmp-multi
: tmp-mach-multi tmp-itable-multi tmp-run-multi targ-vals.h
516 tmp-mach-multi
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
517 for t in
$(SIM_MULTI_IGEN_CONFIGS
); do \
518 p
=`echo $${t} | sed -e 's/:.*//'` ; \
519 m
=`echo $${t} | sed -e 's/.*:\(.*\):.*/\1/'` ; \
520 f
=`echo $${t} | sed -e 's/.*://'` ; \
522 micromips16
*) e
="-B 16 -H 15 -o $(MICROMIPS16_DC) -F 16" ;; \
523 micromips32
* | micromips64
*) \
524 e
="-B 32 -H 31 -o $(MICROMIPS32_DC) -F $${f}" ;; \
526 e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}"; \
527 m
="mips32r2,mips3d,mdmx,dsp,dsp2,smartmips" ;; \
529 e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}"; \
530 m
="mips64r2,mips3d,mdmx,dsp,dsp2,smartmips" ;; \
531 m16
*) e
="-B 16 -H 15 -o $(M16_DC) -F 16" ;; \
532 *) e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}" ;; \
542 -G gen-direct-access \
547 -n
$${p}_icache.h
-hc tmp-icache.h \
548 -n
$${p}_icache.c
-c tmp-icache.c \
549 -n
$${p}_semantics.h
-hs tmp-semantics.h \
550 -n
$${p}_semantics.c
-s tmp-semantics.c \
551 -n
$${p}_idecode.h
-hd tmp-idecode.h \
552 -n
$${p}_idecode.c
-d tmp-idecode.c \
553 -n
$${p}_model.h
-hm tmp-model.h \
554 -n
$${p}_model.c
-m tmp-model.c \
555 -n
$${p}_support.h
-hf tmp-support.h \
556 -n
$${p}_support.c
-f tmp-support.c \
557 -n
$${p}_engine.h
-he tmp-engine.h \
558 -n
$${p}_engine.c
-e tmp-engine.c \
560 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
562 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
564 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
566 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
568 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
569 $${p}_semantics.h
; \
570 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
571 $${p}_semantics.c
; \
572 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
574 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
576 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
578 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
580 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.h \
582 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.c \
586 tmp-itable-multi
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
595 -G gen-direct-access \
598 -n itable.h
-ht tmp-itable.h \
599 -n itable.c
-t tmp-itable.c \
601 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
602 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
603 touch tmp-itable-multi
604 tmp-run-multi
: $(srcdir)/m16run.c
$(srcdir)/micromipsrun.c
605 for t in
$(SIM_MULTI_IGEN_CONFIGS
); do \
608 m
=`echo $${t} | sed -e 's/^m16//' -e 's/:.*//'`; \
609 sed
< $(srcdir)/m16run.c
> tmp-run \
610 -e
"s/^sim_/m16$${m}_/" \
611 -e
"s/m16_/m16$${m}_/" \
612 -e
"s/m32_/m32$${m}_/" ; \
613 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
617 m
=`echo $${t} | sed -e 's/^micromips32//' -e 's/:.*//'`; \
618 sed
< $(srcdir)/micromipsrun.c
> tmp-run \
619 -e
"s/^sim_/micromips32$${m}_/" \
620 -e
"s/micromips16_/micromips16$${m}_/" \
621 -e
"s/micromips32_/micromips32$${m}_/" \
622 -e
"s/m32_/m32$${m}_/" ; \
623 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
624 micromips
$${m}_run.c
; \
627 m
=`echo $${t} | sed -e 's/^micromips64//' -e 's/:.*//'`; \
628 sed
< $(srcdir)/micromipsrun.c
> tmp-run \
629 -e
"s/^sim_/micromips64$${m}_/" \
630 -e
"s/micromips16_/micromips16$${m}_/" \
631 -e
"s/micromips32_/micromips64$${m}_/" \
632 -e
"s/m32_/m64$${m}_/" ; \
633 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
634 micromips
$${m}_run.c
; \
641 rm -f
$(BUILT_SRC_FROM_GEN
)
642 rm -f
$(BUILT_SRC_FROM_IGEN
)
643 rm -f
$(BUILT_SRC_FROM_M16
)
644 rm -f
$(BUILT_SRC_FROM_MICROMIPS
)
645 rm -f
$(BUILT_SRC_FROM_MULTI
)
647 rm -f micromips16
*.o micromips32
*.o m16
*.o m32
*.o itable
*.o
650 rm -f multi-include.h multi-run.c