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
) \
75 # List of flags to always pass to $(CC).
76 SIM_SUBTARGET
=@SIM_SUBTARGET@
77 SIM_EXTRA_CFLAGS
= $(SIM_SUBTARGET
)
79 SIM_EXTRA_CLEAN
= clean-extra
80 SIM_EXTRA_DISTCLEAN
= distclean-extra
82 all: $(SIM_@sim_gen@_ALL
)
84 SIM_EXTRA_LIBS
= $(MIPS_EXTRA_LIBS
)
87 ## COMMON_POST_CONFIG_FRAG
89 interp.o
: $(srcdir)/interp.c config.h sim-main.h itable.h
91 m16run.o
: sim-main.h m16_idecode.h m32_idecode.h m16run.c
$(SIM_EXTRA_DEPS
)
93 micromipsrun.o
: sim-main.h micromips16_idecode.h micromips32_idecode.h \
94 micromips_m32_idecode.h micromipsrun.c
$(SIM_EXTRA_DEPS
)
96 multi-run.o
: multi-include.h tmp-mach-multi
98 IGEN_TRACE
= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries # -G trace-all
99 IGEN_INSN
=$(srcdir)/mips.igen
100 IGEN_DC
=$(srcdir)/mips.dc
101 M16_DC
=$(srcdir)/m16.dc
102 MICROMIPS32_DC
=$(srcdir)/micromips.dc
103 MICROMIPS16_DC
=$(srcdir)/micromips16.dc
105 $(srcdir)/micromipsdsp.igen \
106 $(srcdir)/micromips.igen \
108 $(srcdir)/m16e.igen \
109 $(srcdir)/mdmx.igen \
110 $(srcdir)/mips3d.igen \
115 $(srcdir)/dsp2.igen \
116 $(srcdir)/mips3264r2.igen \
118 # NB: Since these can be built by a number of generators, care
119 # must be taken to ensure that they are only dependant on
120 # one of those generators.
121 BUILT_SRC_FROM_GEN
= \
125 SIM_IGEN_ALL
= tmp-igen
126 SIM_M16_ALL
= tmp-m16
127 SIM_MICROMIPS_ALL
= tmp-micromips
128 SIM_MULTI_ALL
= tmp-multi
130 $(BUILT_SRC_FROM_GEN
): $(SIM_@sim_gen@_ALL
)
134 BUILT_SRC_FROM_IGEN
= \
149 $(BUILT_SRC_FROM_IGEN
): tmp-igen
151 tmp-igen
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
158 -G gen-direct-access \
165 -n icache.h
-hc tmp-icache.h \
166 -n icache.c
-c tmp-icache.c \
167 -n semantics.h
-hs tmp-semantics.h \
168 -n semantics.c
-s tmp-semantics.c \
169 -n idecode.h
-hd tmp-idecode.h \
170 -n idecode.c
-d tmp-idecode.c \
171 -n model.h
-hm tmp-model.h \
172 -n model.c
-m tmp-model.c \
173 -n support.h
-hf tmp-support.h \
174 -n support.c
-f tmp-support.c \
175 -n itable.h
-ht tmp-itable.h \
176 -n itable.c
-t tmp-itable.c \
177 -n engine.h
-he tmp-engine.h \
178 -n engine.c
-e tmp-engine.c \
179 -n irun.c
-r tmp-irun.c
180 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h icache.h
181 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c icache.c
182 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h idecode.h
183 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c idecode.c
184 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h semantics.h
185 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c semantics.c
186 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h model.h
187 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c model.c
188 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h support.h
189 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c support.c
190 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
191 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
192 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.h engine.h
193 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.c engine.c
194 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-irun.c irun.c
197 BUILT_SRC_FROM_M16
= \
220 $(BUILT_SRC_FROM_M16
): tmp-m16
222 tmp-m16
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
229 -G gen-direct-access \
237 -n m16_icache.h
-hc tmp-icache.h \
238 -n m16_icache.c
-c tmp-icache.c \
239 -n m16_semantics.h
-hs tmp-semantics.h \
240 -n m16_semantics.c
-s tmp-semantics.c \
241 -n m16_idecode.h
-hd tmp-idecode.h \
242 -n m16_idecode.c
-d tmp-idecode.c \
243 -n m16_model.h
-hm tmp-model.h \
244 -n m16_model.c
-m tmp-model.c \
245 -n m16_support.h
-hf tmp-support.h \
246 -n m16_support.c
-f tmp-support.c \
248 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h m16_icache.h
249 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c m16_icache.c
250 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h m16_idecode.h
251 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c m16_idecode.c
252 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h m16_semantics.h
253 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c m16_semantics.c
254 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h m16_model.h
255 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c m16_model.c
256 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h m16_support.h
257 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c m16_support.c
264 -G gen-direct-access \
272 -n m32_icache.h
-hc tmp-icache.h \
273 -n m32_icache.c
-c tmp-icache.c \
274 -n m32_semantics.h
-hs tmp-semantics.h \
275 -n m32_semantics.c
-s tmp-semantics.c \
276 -n m32_idecode.h
-hd tmp-idecode.h \
277 -n m32_idecode.c
-d tmp-idecode.c \
278 -n m32_model.h
-hm tmp-model.h \
279 -n m32_model.c
-m tmp-model.c \
280 -n m32_support.h
-hf tmp-support.h \
281 -n m32_support.c
-f tmp-support.c \
283 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h m32_icache.h
284 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c m32_icache.c
285 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h m32_idecode.h
286 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c m32_idecode.c
287 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
289 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
291 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h m32_model.h
292 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c m32_model.c
293 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h m32_support.h
294 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c m32_support.c
301 @sim_igen_flags@ @sim_m16_flags@ \
302 -G gen-direct-access \
305 -n itable.h
-ht tmp-itable.h \
306 -n itable.c
-t tmp-itable.c \
308 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
309 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
312 BUILT_SRC_FROM_MICROMIPS
= \
313 micromips16_icache.h \
314 micromips16_icache.c \
315 micromips16_idecode.h \
316 micromips16_idecode.c \
317 micromips16_semantics.h \
318 micromips16_semantics.c \
319 micromips16_model.h \
320 micromips16_model.c \
321 micromips16_support.h \
322 micromips16_support.c \
324 micromips32_icache.h \
325 micromips32_icache.c \
326 micromips32_idecode.h \
327 micromips32_idecode.c \
328 micromips32_semantics.h \
329 micromips32_semantics.c \
330 micromips32_model.h \
331 micromips32_model.c \
332 micromips32_support.h \
333 micromips32_support.c \
335 micromips_m32_icache.h \
336 micromips_m32_icache.c \
337 micromips_m32_idecode.h \
338 micromips_m32_idecode.c \
339 micromips_m32_semantics.h \
340 micromips_m32_semantics.c \
341 micromips_m32_model.h \
342 micromips_m32_model.c \
343 micromips_m32_support.h \
344 micromips_m32_support.c \
346 $(BUILT_SRC_FROM_MICROMIPS
): tmp-micromips
348 tmp-micromips
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
354 @sim_micromips16_flags@ \
355 -G gen-direct-access \
360 -o
$(MICROMIPS16_DC
) \
363 -n micromips16_icache.h
-hc tmp-icache.h \
364 -n micromips16_icache.c
-c tmp-icache.c \
365 -n micromips16_semantics.h
-hs tmp-semantics.h \
366 -n micromips16_semantics.c
-s tmp-semantics.c \
367 -n micromips16_idecode.h
-hd tmp-idecode.h \
368 -n micromips16_idecode.c
-d tmp-idecode.c \
369 -n micromips16_model.h
-hm tmp-model.h \
370 -n micromips16_model.c
-m tmp-model.c \
371 -n micromips16_support.h
-hf tmp-support.h \
372 -n micromips16_support.c
-f tmp-support.c \
374 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
376 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
378 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
379 micromips16_idecode.h
380 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
381 micromips16_idecode.c
382 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
383 micromips16_semantics.h
384 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
385 micromips16_semantics.c
386 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
388 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
390 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
391 micromips16_support.h
392 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
393 micromips16_support.c
399 @sim_micromips_flags@ \
400 -G gen-direct-access \
405 -o
$(MICROMIPS32_DC
) \
408 -n micromips32_icache.h
-hc tmp-icache.h \
409 -n micromips32_icache.c
-c tmp-icache.c \
410 -n micromips32_semantics.h
-hs tmp-semantics.h \
411 -n micromips32_semantics.c
-s tmp-semantics.c \
412 -n micromips32_idecode.h
-hd tmp-idecode.h \
413 -n micromips32_idecode.c
-d tmp-idecode.c \
414 -n micromips32_model.h
-hm tmp-model.h \
415 -n micromips32_model.c
-m tmp-model.c \
416 -n micromips32_support.h
-hf tmp-support.h \
417 -n micromips32_support.c
-f tmp-support.c \
419 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
421 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
423 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
424 micromips32_idecode.h
425 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
426 micromips32_idecode.c
427 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
428 micromips32_semantics.h
429 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
430 micromips32_semantics.c
431 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
433 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
435 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
436 micromips32_support.h
437 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
438 micromips32_support.c
445 -G gen-direct-access \
453 -n micromips_m32_icache.h
-hc tmp-icache.h \
454 -n micromips_m32_icache.c
-c tmp-icache.c \
455 -n micromips_m32_semantics.h
-hs tmp-semantics.h \
456 -n micromips_m32_semantics.c
-s tmp-semantics.c \
457 -n micromips_m32_idecode.h
-hd tmp-idecode.h \
458 -n micromips_m32_idecode.c
-d tmp-idecode.c \
459 -n micromips_m32_model.h
-hm tmp-model.h \
460 -n micromips_m32_model.c
-m tmp-model.c \
461 -n micromips_m32_support.h
-hf tmp-support.h \
462 -n micromips_m32_support.c
-f tmp-support.c \
464 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
465 micromips_m32_icache.h
466 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
467 micromips_m32_icache.c
468 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
469 micromips_m32_idecode.h
470 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
471 micromips_m32_idecode.c
472 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
473 micromips_m32_semantics.h
474 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
475 micromips_m32_semantics.c
476 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
477 micromips_m32_model.h
478 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
479 micromips_m32_model.c
480 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
481 micromips_m32_support.h
482 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
483 micromips_m32_support.c
490 @sim_igen_flags@ @sim_micromips_flags@ @sim_micromips16_flags@\
491 -G gen-direct-access \
494 -n itable.h
-ht tmp-itable.h \
495 -n itable.c
-t tmp-itable.c \
497 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
498 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
501 BUILT_SRC_FROM_MULTI
= @sim_multi_src@
502 SIM_MULTI_IGEN_CONFIGS
= @sim_multi_igen_configs@
504 $(BUILT_SRC_FROM_MULTI
): tmp-multi
505 tmp-multi
: tmp-mach-multi tmp-itable-multi tmp-run-multi targ-vals.h
506 tmp-mach-multi
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
507 for t in
$(SIM_MULTI_IGEN_CONFIGS
); do \
508 p
=`echo $${t} | sed -e 's/:.*//'` ; \
509 m
=`echo $${t} | sed -e 's/.*:\(.*\):.*/\1/'` ; \
510 f
=`echo $${t} | sed -e 's/.*://'` ; \
512 micromips16
*) e
="-B 16 -H 15 -o $(MICROMIPS16_DC) -F 16" ;; \
513 micromips32
* | micromips64
*) \
514 e
="-B 32 -H 31 -o $(MICROMIPS32_DC) -F $${f}" ;; \
516 e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}"; \
517 m
="mips32r2,mips3d,mdmx,dsp,dsp2,smartmips" ;; \
519 e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}"; \
520 m
="mips64r2,mips3d,mdmx,dsp,dsp2,smartmips" ;; \
521 m16
*) e
="-B 16 -H 15 -o $(M16_DC) -F 16" ;; \
522 *) e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}" ;; \
532 -G gen-direct-access \
537 -n
$${p}_icache.h
-hc tmp-icache.h \
538 -n
$${p}_icache.c
-c tmp-icache.c \
539 -n
$${p}_semantics.h
-hs tmp-semantics.h \
540 -n
$${p}_semantics.c
-s tmp-semantics.c \
541 -n
$${p}_idecode.h
-hd tmp-idecode.h \
542 -n
$${p}_idecode.c
-d tmp-idecode.c \
543 -n
$${p}_model.h
-hm tmp-model.h \
544 -n
$${p}_model.c
-m tmp-model.c \
545 -n
$${p}_support.h
-hf tmp-support.h \
546 -n
$${p}_support.c
-f tmp-support.c \
547 -n
$${p}_engine.h
-he tmp-engine.h \
548 -n
$${p}_engine.c
-e tmp-engine.c \
550 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
552 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
554 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
556 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
558 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
559 $${p}_semantics.h
; \
560 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
561 $${p}_semantics.c
; \
562 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
564 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
566 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
568 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
570 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.h \
572 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.c \
576 tmp-itable-multi
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
585 -G gen-direct-access \
588 -n itable.h
-ht tmp-itable.h \
589 -n itable.c
-t tmp-itable.c \
591 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
592 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
593 touch tmp-itable-multi
594 tmp-run-multi
: $(srcdir)/m16run.c
$(srcdir)/micromipsrun.c
595 for t in
$(SIM_MULTI_IGEN_CONFIGS
); do \
598 m
=`echo $${t} | sed -e 's/^m16//' -e 's/:.*//'`; \
599 sed
< $(srcdir)/m16run.c
> tmp-run \
600 -e
"s/^sim_/m16$${m}_/" \
601 -e
"s/m16_/m16$${m}_/" \
602 -e
"s/m32_/m32$${m}_/" ; \
603 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
607 m
=`echo $${t} | sed -e 's/^micromips32//' -e 's/:.*//'`; \
608 sed
< $(srcdir)/micromipsrun.c
> tmp-run \
609 -e
"s/^sim_/micromips32$${m}_/" \
610 -e
"s/micromips16_/micromips16$${m}_/" \
611 -e
"s/micromips32_/micromips32$${m}_/" \
612 -e
"s/m32_/m32$${m}_/" ; \
613 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
614 micromips
$${m}_run.c
; \
617 m
=`echo $${t} | sed -e 's/^micromips64//' -e 's/:.*//'`; \
618 sed
< $(srcdir)/micromipsrun.c
> tmp-run \
619 -e
"s/^sim_/micromips64$${m}_/" \
620 -e
"s/micromips16_/micromips16$${m}_/" \
621 -e
"s/micromips32_/micromips64$${m}_/" \
622 -e
"s/m32_/m64$${m}_/" ; \
623 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
624 micromips
$${m}_run.c
; \
631 rm -f
$(BUILT_SRC_FROM_GEN
)
632 rm -f
$(BUILT_SRC_FROM_IGEN
)
633 rm -f
$(BUILT_SRC_FROM_M16
)
634 rm -f
$(BUILT_SRC_FROM_MICROMIPS
)
635 rm -f
$(BUILT_SRC_FROM_MULTI
)
637 rm -f micromips16
*.o micromips32
*.o m16
*.o m32
*.o itable
*.o
640 rm -f multi-include.h multi-run.c