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
) \
76 # List of flags to always pass to $(CC).
77 SIM_SUBTARGET
=@SIM_SUBTARGET@
78 SIM_EXTRA_CFLAGS
= $(SIM_SUBTARGET
)
80 SIM_EXTRA_CLEAN
= clean-extra
81 SIM_EXTRA_DISTCLEAN
= distclean-extra
83 SIM_EXTRA_ALL
= $(SIM_@sim_gen@_ALL
)
85 SIM_EXTRA_LIBS
= $(MIPS_EXTRA_LIBS
)
88 ## COMMON_POST_CONFIG_FRAG
90 interp.o
: $(srcdir)/interp.c config.h sim-main.h itable.h
92 m16run.o
: sim-main.h m16_idecode.h m32_idecode.h m16run.c
$(SIM_EXTRA_DEPS
)
94 micromipsrun.o
: sim-main.h micromips16_idecode.h micromips32_idecode.h \
95 micromips_m32_idecode.h micromipsrun.c
$(SIM_EXTRA_DEPS
)
97 multi-run.o
: multi-include.h tmp-mach-multi
100 cd ..
/igen
&& $(MAKE
)
102 IGEN_TRACE
= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries # -G trace-all
103 IGEN_INSN
=$(srcdir)/mips.igen
104 IGEN_DC
=$(srcdir)/mips.dc
105 M16_DC
=$(srcdir)/m16.dc
106 MICROMIPS32_DC
=$(srcdir)/micromips.dc
107 MICROMIPS16_DC
=$(srcdir)/micromips16.dc
109 $(srcdir)/micromipsdsp.igen \
110 $(srcdir)/micromips.igen \
112 $(srcdir)/m16e.igen \
113 $(srcdir)/mdmx.igen \
114 $(srcdir)/mips3d.igen \
119 $(srcdir)/dsp2.igen \
120 $(srcdir)/mips3264r2.igen \
122 # NB: Since these can be built by a number of generators, care
123 # must be taken to ensure that they are only dependant on
124 # one of those generators.
125 BUILT_SRC_FROM_GEN
= \
129 SIM_IGEN_ALL
= tmp-igen
130 SIM_M16_ALL
= tmp-m16
131 SIM_MICROMIPS_ALL
= tmp-micromips
132 SIM_MULTI_ALL
= tmp-multi
134 $(BUILT_SRC_FROM_GEN
): $(SIM_@sim_gen@_ALL
)
138 BUILT_SRC_FROM_IGEN
= \
153 $(BUILT_SRC_FROM_IGEN
): tmp-igen
155 tmp-igen
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
156 cd ..
/igen
&& $(MAKE
)
163 -G gen-direct-access \
170 -n icache.h
-hc tmp-icache.h \
171 -n icache.c
-c tmp-icache.c \
172 -n semantics.h
-hs tmp-semantics.h \
173 -n semantics.c
-s tmp-semantics.c \
174 -n idecode.h
-hd tmp-idecode.h \
175 -n idecode.c
-d tmp-idecode.c \
176 -n model.h
-hm tmp-model.h \
177 -n model.c
-m tmp-model.c \
178 -n support.h
-hf tmp-support.h \
179 -n support.c
-f tmp-support.c \
180 -n itable.h
-ht tmp-itable.h \
181 -n itable.c
-t tmp-itable.c \
182 -n engine.h
-he tmp-engine.h \
183 -n engine.c
-e tmp-engine.c \
184 -n irun.c
-r tmp-irun.c
185 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h icache.h
186 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c icache.c
187 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h idecode.h
188 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c idecode.c
189 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h semantics.h
190 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c semantics.c
191 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h model.h
192 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c model.c
193 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h support.h
194 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c support.c
195 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
196 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
197 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.h engine.h
198 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.c engine.c
199 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-irun.c irun.c
202 BUILT_SRC_FROM_M16
= \
225 $(BUILT_SRC_FROM_M16
): tmp-m16
227 tmp-m16
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
228 cd ..
/igen
&& $(MAKE
)
235 -G gen-direct-access \
243 -n m16_icache.h
-hc tmp-icache.h \
244 -n m16_icache.c
-c tmp-icache.c \
245 -n m16_semantics.h
-hs tmp-semantics.h \
246 -n m16_semantics.c
-s tmp-semantics.c \
247 -n m16_idecode.h
-hd tmp-idecode.h \
248 -n m16_idecode.c
-d tmp-idecode.c \
249 -n m16_model.h
-hm tmp-model.h \
250 -n m16_model.c
-m tmp-model.c \
251 -n m16_support.h
-hf tmp-support.h \
252 -n m16_support.c
-f tmp-support.c \
254 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h m16_icache.h
255 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c m16_icache.c
256 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h m16_idecode.h
257 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c m16_idecode.c
258 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h m16_semantics.h
259 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c m16_semantics.c
260 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h m16_model.h
261 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c m16_model.c
262 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h m16_support.h
263 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c m16_support.c
270 -G gen-direct-access \
278 -n m32_icache.h
-hc tmp-icache.h \
279 -n m32_icache.c
-c tmp-icache.c \
280 -n m32_semantics.h
-hs tmp-semantics.h \
281 -n m32_semantics.c
-s tmp-semantics.c \
282 -n m32_idecode.h
-hd tmp-idecode.h \
283 -n m32_idecode.c
-d tmp-idecode.c \
284 -n m32_model.h
-hm tmp-model.h \
285 -n m32_model.c
-m tmp-model.c \
286 -n m32_support.h
-hf tmp-support.h \
287 -n m32_support.c
-f tmp-support.c \
289 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h m32_icache.h
290 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c m32_icache.c
291 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h m32_idecode.h
292 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c m32_idecode.c
293 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
295 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
297 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h m32_model.h
298 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c m32_model.c
299 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h m32_support.h
300 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c m32_support.c
307 @sim_igen_flags@ @sim_m16_flags@ \
308 -G gen-direct-access \
311 -n itable.h
-ht tmp-itable.h \
312 -n itable.c
-t tmp-itable.c \
314 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
315 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
318 BUILT_SRC_FROM_MICROMIPS
= \
319 micromips16_icache.h \
320 micromips16_icache.c \
321 micromips16_idecode.h \
322 micromips16_idecode.c \
323 micromips16_semantics.h \
324 micromips16_semantics.c \
325 micromips16_model.h \
326 micromips16_model.c \
327 micromips16_support.h \
328 micromips16_support.c \
330 micromips32_icache.h \
331 micromips32_icache.c \
332 micromips32_idecode.h \
333 micromips32_idecode.c \
334 micromips32_semantics.h \
335 micromips32_semantics.c \
336 micromips32_model.h \
337 micromips32_model.c \
338 micromips32_support.h \
339 micromips32_support.c \
341 micromips_m32_icache.h \
342 micromips_m32_icache.c \
343 micromips_m32_idecode.h \
344 micromips_m32_idecode.c \
345 micromips_m32_semantics.h \
346 micromips_m32_semantics.c \
347 micromips_m32_model.h \
348 micromips_m32_model.c \
349 micromips_m32_support.h \
350 micromips_m32_support.c \
352 $(BUILT_SRC_FROM_MICROMIPS
): tmp-micromips
354 tmp-micromips
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
355 cd ..
/igen
&& $(MAKE
)
361 @sim_micromips16_flags@ \
362 -G gen-direct-access \
367 -o
$(MICROMIPS16_DC
) \
370 -n micromips16_icache.h
-hc tmp-icache.h \
371 -n micromips16_icache.c
-c tmp-icache.c \
372 -n micromips16_semantics.h
-hs tmp-semantics.h \
373 -n micromips16_semantics.c
-s tmp-semantics.c \
374 -n micromips16_idecode.h
-hd tmp-idecode.h \
375 -n micromips16_idecode.c
-d tmp-idecode.c \
376 -n micromips16_model.h
-hm tmp-model.h \
377 -n micromips16_model.c
-m tmp-model.c \
378 -n micromips16_support.h
-hf tmp-support.h \
379 -n micromips16_support.c
-f tmp-support.c \
381 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
383 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
385 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
386 micromips16_idecode.h
387 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
388 micromips16_idecode.c
389 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
390 micromips16_semantics.h
391 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
392 micromips16_semantics.c
393 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
395 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
397 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
398 micromips16_support.h
399 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
400 micromips16_support.c
401 cd ..
/igen
&& $(MAKE
)
407 @sim_micromips_flags@ \
408 -G gen-direct-access \
413 -o
$(MICROMIPS32_DC
) \
416 -n micromips32_icache.h
-hc tmp-icache.h \
417 -n micromips32_icache.c
-c tmp-icache.c \
418 -n micromips32_semantics.h
-hs tmp-semantics.h \
419 -n micromips32_semantics.c
-s tmp-semantics.c \
420 -n micromips32_idecode.h
-hd tmp-idecode.h \
421 -n micromips32_idecode.c
-d tmp-idecode.c \
422 -n micromips32_model.h
-hm tmp-model.h \
423 -n micromips32_model.c
-m tmp-model.c \
424 -n micromips32_support.h
-hf tmp-support.h \
425 -n micromips32_support.c
-f tmp-support.c \
427 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
429 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
431 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
432 micromips32_idecode.h
433 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
434 micromips32_idecode.c
435 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
436 micromips32_semantics.h
437 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
438 micromips32_semantics.c
439 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
441 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
443 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
444 micromips32_support.h
445 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
446 micromips32_support.c
453 -G gen-direct-access \
461 -n micromips_m32_icache.h
-hc tmp-icache.h \
462 -n micromips_m32_icache.c
-c tmp-icache.c \
463 -n micromips_m32_semantics.h
-hs tmp-semantics.h \
464 -n micromips_m32_semantics.c
-s tmp-semantics.c \
465 -n micromips_m32_idecode.h
-hd tmp-idecode.h \
466 -n micromips_m32_idecode.c
-d tmp-idecode.c \
467 -n micromips_m32_model.h
-hm tmp-model.h \
468 -n micromips_m32_model.c
-m tmp-model.c \
469 -n micromips_m32_support.h
-hf tmp-support.h \
470 -n micromips_m32_support.c
-f tmp-support.c \
472 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
473 micromips_m32_icache.h
474 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
475 micromips_m32_icache.c
476 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
477 micromips_m32_idecode.h
478 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
479 micromips_m32_idecode.c
480 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
481 micromips_m32_semantics.h
482 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
483 micromips_m32_semantics.c
484 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
485 micromips_m32_model.h
486 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
487 micromips_m32_model.c
488 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
489 micromips_m32_support.h
490 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
491 micromips_m32_support.c
498 @sim_igen_flags@ @sim_micromips_flags@ @sim_micromips16_flags@\
499 -G gen-direct-access \
502 -n itable.h
-ht tmp-itable.h \
503 -n itable.c
-t tmp-itable.c \
505 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
506 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
509 BUILT_SRC_FROM_MULTI
= @sim_multi_src@
510 SIM_MULTI_IGEN_CONFIGS
= @sim_multi_igen_configs@
512 $(BUILT_SRC_FROM_MULTI
): tmp-multi
513 tmp-multi
: tmp-mach-multi tmp-itable-multi tmp-run-multi targ-vals.h
514 tmp-mach-multi
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
515 for t in
$(SIM_MULTI_IGEN_CONFIGS
); do \
516 p
=`echo $${t} | sed -e 's/:.*//'` ; \
517 m
=`echo $${t} | sed -e 's/.*:\(.*\):.*/\1/'` ; \
518 f
=`echo $${t} | sed -e 's/.*://'` ; \
520 micromips16
*) e
="-B 16 -H 15 -o $(MICROMIPS16_DC) -F 16" ;; \
521 micromips32
* | micromips64
*) \
522 e
="-B 32 -H 31 -o $(MICROMIPS32_DC) -F $${f}" ;; \
524 e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}"; \
525 m
="mips32r2,mips3d,mdmx,dsp,dsp2,smartmips" ;; \
527 e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}"; \
528 m
="mips64r2,mips3d,mdmx,dsp,dsp2,smartmips" ;; \
529 m16
*) e
="-B 16 -H 15 -o $(M16_DC) -F 16" ;; \
530 *) e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}" ;; \
540 -G gen-direct-access \
545 -n
$${p}_icache.h
-hc tmp-icache.h \
546 -n
$${p}_icache.c
-c tmp-icache.c \
547 -n
$${p}_semantics.h
-hs tmp-semantics.h \
548 -n
$${p}_semantics.c
-s tmp-semantics.c \
549 -n
$${p}_idecode.h
-hd tmp-idecode.h \
550 -n
$${p}_idecode.c
-d tmp-idecode.c \
551 -n
$${p}_model.h
-hm tmp-model.h \
552 -n
$${p}_model.c
-m tmp-model.c \
553 -n
$${p}_support.h
-hf tmp-support.h \
554 -n
$${p}_support.c
-f tmp-support.c \
555 -n
$${p}_engine.h
-he tmp-engine.h \
556 -n
$${p}_engine.c
-e tmp-engine.c \
558 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
560 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
562 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
564 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
566 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
567 $${p}_semantics.h
; \
568 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
569 $${p}_semantics.c
; \
570 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
572 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
574 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
576 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
578 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.h \
580 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.c \
584 tmp-itable-multi
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
593 -G gen-direct-access \
596 -n itable.h
-ht tmp-itable.h \
597 -n itable.c
-t tmp-itable.c \
599 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
600 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
601 touch tmp-itable-multi
602 tmp-run-multi
: $(srcdir)/m16run.c
$(srcdir)/micromipsrun.c
603 for t in
$(SIM_MULTI_IGEN_CONFIGS
); do \
606 m
=`echo $${t} | sed -e 's/^m16//' -e 's/:.*//'`; \
607 sed
< $(srcdir)/m16run.c
> tmp-run \
608 -e
"s/^sim_/m16$${m}_/" \
609 -e
"s/m16_/m16$${m}_/" \
610 -e
"s/m32_/m32$${m}_/" ; \
611 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
615 m
=`echo $${t} | sed -e 's/^micromips32//' -e 's/:.*//'`; \
616 sed
< $(srcdir)/micromipsrun.c
> tmp-run \
617 -e
"s/^sim_/micromips32$${m}_/" \
618 -e
"s/micromips16_/micromips16$${m}_/" \
619 -e
"s/micromips32_/micromips32$${m}_/" \
620 -e
"s/m32_/m32$${m}_/" ; \
621 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
622 micromips
$${m}_run.c
; \
625 m
=`echo $${t} | sed -e 's/^micromips64//' -e 's/:.*//'`; \
626 sed
< $(srcdir)/micromipsrun.c
> tmp-run \
627 -e
"s/^sim_/micromips64$${m}_/" \
628 -e
"s/micromips16_/micromips16$${m}_/" \
629 -e
"s/micromips32_/micromips64$${m}_/" \
630 -e
"s/m32_/m64$${m}_/" ; \
631 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
632 micromips
$${m}_run.c
; \
639 rm -f
$(BUILT_SRC_FROM_GEN
)
640 rm -f
$(BUILT_SRC_FROM_IGEN
)
641 rm -f
$(BUILT_SRC_FROM_M16
)
642 rm -f
$(BUILT_SRC_FROM_MICROMIPS
)
643 rm -f
$(BUILT_SRC_FROM_MULTI
)
645 rm -f micromips16
*.o micromips32
*.o m16
*.o m32
*.o itable
*.o
648 rm -f multi-include.h multi-run.c