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@ \
64 $(SIM_@sim_gen@_OBJ
) \
65 $(SIM_NEW_COMMON_OBJS
) \
73 # List of flags to always pass to $(CC).
74 SIM_SUBTARGET
=@SIM_SUBTARGET@
75 SIM_EXTRA_CFLAGS
= $(SIM_SUBTARGET
)
77 SIM_EXTRA_CLEAN
= clean-extra
78 SIM_EXTRA_DISTCLEAN
= distclean-extra
80 all: $(SIM_@sim_gen@_ALL
)
82 SIM_EXTRA_DEPS
= itable.h
84 # Code doesn't build cleanly yet.
87 ## COMMON_POST_CONFIG_FRAG
89 IGEN_TRACE
= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries # -G trace-all
90 IGEN_INSN
=$(srcdir)/mips.igen
91 IGEN_DC
=$(srcdir)/mips.dc
92 M16_DC
=$(srcdir)/m16.dc
93 MICROMIPS32_DC
=$(srcdir)/micromips.dc
94 MICROMIPS16_DC
=$(srcdir)/micromips16.dc
96 $(srcdir)/micromipsdsp.igen \
97 $(srcdir)/micromips.igen \
100 $(srcdir)/mdmx.igen \
101 $(srcdir)/mips3d.igen \
106 $(srcdir)/dsp2.igen \
107 $(srcdir)/mips3264r2.igen \
109 # NB: Since these can be built by a number of generators, care
110 # must be taken to ensure that they are only dependant on
111 # one of those generators.
112 BUILT_SRC_FROM_GEN
= \
116 SIM_IGEN_ALL
= tmp-igen
117 SIM_M16_ALL
= tmp-m16
118 SIM_MICROMIPS_ALL
= tmp-micromips
119 SIM_MULTI_ALL
= tmp-multi
121 $(BUILT_SRC_FROM_GEN
): $(SIM_@sim_gen@_ALL
)
125 BUILT_SRC_FROM_IGEN
= \
140 $(BUILT_SRC_FROM_IGEN
): tmp-igen
142 tmp-igen
: $(IGEN_INSN
) $(IGEN_DC
) $(IGEN
) $(IGEN_INCLUDE
)
149 -G gen-direct-access \
156 -n icache.h
-hc tmp-icache.h \
157 -n icache.c
-c tmp-icache.c \
158 -n semantics.h
-hs tmp-semantics.h \
159 -n semantics.c
-s tmp-semantics.c \
160 -n idecode.h
-hd tmp-idecode.h \
161 -n idecode.c
-d tmp-idecode.c \
162 -n model.h
-hm tmp-model.h \
163 -n model.c
-m tmp-model.c \
164 -n support.h
-hf tmp-support.h \
165 -n support.c
-f tmp-support.c \
166 -n itable.h
-ht tmp-itable.h \
167 -n itable.c
-t tmp-itable.c \
168 -n engine.h
-he tmp-engine.h \
169 -n engine.c
-e tmp-engine.c \
170 -n irun.c
-r tmp-irun.c
171 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h icache.h
172 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c icache.c
173 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h idecode.h
174 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c idecode.c
175 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h semantics.h
176 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c semantics.c
177 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h model.h
178 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c model.c
179 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h support.h
180 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c support.c
181 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
182 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
183 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.h engine.h
184 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.c engine.c
185 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-irun.c irun.c
188 BUILT_SRC_FROM_M16
= \
211 $(BUILT_SRC_FROM_M16
): tmp-m16
213 tmp-m16
: $(IGEN_INSN
) $(IGEN_DC
) $(IGEN
) $(IGEN_INCLUDE
)
220 -G gen-direct-access \
228 -n m16_icache.h
-hc tmp-icache.h \
229 -n m16_icache.c
-c tmp-icache.c \
230 -n m16_semantics.h
-hs tmp-semantics.h \
231 -n m16_semantics.c
-s tmp-semantics.c \
232 -n m16_idecode.h
-hd tmp-idecode.h \
233 -n m16_idecode.c
-d tmp-idecode.c \
234 -n m16_model.h
-hm tmp-model.h \
235 -n m16_model.c
-m tmp-model.c \
236 -n m16_support.h
-hf tmp-support.h \
237 -n m16_support.c
-f tmp-support.c \
239 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h m16_icache.h
240 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c m16_icache.c
241 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h m16_idecode.h
242 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c m16_idecode.c
243 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h m16_semantics.h
244 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c m16_semantics.c
245 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h m16_model.h
246 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c m16_model.c
247 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h m16_support.h
248 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c m16_support.c
255 -G gen-direct-access \
263 -n m32_icache.h
-hc tmp-icache.h \
264 -n m32_icache.c
-c tmp-icache.c \
265 -n m32_semantics.h
-hs tmp-semantics.h \
266 -n m32_semantics.c
-s tmp-semantics.c \
267 -n m32_idecode.h
-hd tmp-idecode.h \
268 -n m32_idecode.c
-d tmp-idecode.c \
269 -n m32_model.h
-hm tmp-model.h \
270 -n m32_model.c
-m tmp-model.c \
271 -n m32_support.h
-hf tmp-support.h \
272 -n m32_support.c
-f tmp-support.c \
274 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h m32_icache.h
275 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c m32_icache.c
276 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h m32_idecode.h
277 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c m32_idecode.c
278 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
280 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
282 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h m32_model.h
283 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c m32_model.c
284 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h m32_support.h
285 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c m32_support.c
292 @sim_igen_flags@ @sim_m16_flags@ \
293 -G gen-direct-access \
296 -n itable.h
-ht tmp-itable.h \
297 -n itable.c
-t tmp-itable.c \
299 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
300 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
303 BUILT_SRC_FROM_MICROMIPS
= \
304 micromips16_icache.h \
305 micromips16_icache.c \
306 micromips16_idecode.h \
307 micromips16_idecode.c \
308 micromips16_semantics.h \
309 micromips16_semantics.c \
310 micromips16_model.h \
311 micromips16_model.c \
312 micromips16_support.h \
313 micromips16_support.c \
315 micromips32_icache.h \
316 micromips32_icache.c \
317 micromips32_idecode.h \
318 micromips32_idecode.c \
319 micromips32_semantics.h \
320 micromips32_semantics.c \
321 micromips32_model.h \
322 micromips32_model.c \
323 micromips32_support.h \
324 micromips32_support.c \
326 micromips_m32_icache.h \
327 micromips_m32_icache.c \
328 micromips_m32_idecode.h \
329 micromips_m32_idecode.c \
330 micromips_m32_semantics.h \
331 micromips_m32_semantics.c \
332 micromips_m32_model.h \
333 micromips_m32_model.c \
334 micromips_m32_support.h \
335 micromips_m32_support.c \
337 $(BUILT_SRC_FROM_MICROMIPS
): tmp-micromips
339 tmp-micromips
: $(IGEN_INSN
) $(IGEN_DC
) $(IGEN
) $(IGEN_INCLUDE
)
345 @sim_micromips16_flags@ \
346 -G gen-direct-access \
351 -o
$(MICROMIPS16_DC
) \
354 -n micromips16_icache.h
-hc tmp-icache.h \
355 -n micromips16_icache.c
-c tmp-icache.c \
356 -n micromips16_semantics.h
-hs tmp-semantics.h \
357 -n micromips16_semantics.c
-s tmp-semantics.c \
358 -n micromips16_idecode.h
-hd tmp-idecode.h \
359 -n micromips16_idecode.c
-d tmp-idecode.c \
360 -n micromips16_model.h
-hm tmp-model.h \
361 -n micromips16_model.c
-m tmp-model.c \
362 -n micromips16_support.h
-hf tmp-support.h \
363 -n micromips16_support.c
-f tmp-support.c \
365 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
367 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
369 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
370 micromips16_idecode.h
371 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
372 micromips16_idecode.c
373 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
374 micromips16_semantics.h
375 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
376 micromips16_semantics.c
377 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
379 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
381 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
382 micromips16_support.h
383 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
384 micromips16_support.c
390 @sim_micromips_flags@ \
391 -G gen-direct-access \
396 -o
$(MICROMIPS32_DC
) \
399 -n micromips32_icache.h
-hc tmp-icache.h \
400 -n micromips32_icache.c
-c tmp-icache.c \
401 -n micromips32_semantics.h
-hs tmp-semantics.h \
402 -n micromips32_semantics.c
-s tmp-semantics.c \
403 -n micromips32_idecode.h
-hd tmp-idecode.h \
404 -n micromips32_idecode.c
-d tmp-idecode.c \
405 -n micromips32_model.h
-hm tmp-model.h \
406 -n micromips32_model.c
-m tmp-model.c \
407 -n micromips32_support.h
-hf tmp-support.h \
408 -n micromips32_support.c
-f tmp-support.c \
410 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
412 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
414 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
415 micromips32_idecode.h
416 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
417 micromips32_idecode.c
418 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
419 micromips32_semantics.h
420 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
421 micromips32_semantics.c
422 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
424 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
426 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
427 micromips32_support.h
428 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
429 micromips32_support.c
436 -G gen-direct-access \
444 -n micromips_m32_icache.h
-hc tmp-icache.h \
445 -n micromips_m32_icache.c
-c tmp-icache.c \
446 -n micromips_m32_semantics.h
-hs tmp-semantics.h \
447 -n micromips_m32_semantics.c
-s tmp-semantics.c \
448 -n micromips_m32_idecode.h
-hd tmp-idecode.h \
449 -n micromips_m32_idecode.c
-d tmp-idecode.c \
450 -n micromips_m32_model.h
-hm tmp-model.h \
451 -n micromips_m32_model.c
-m tmp-model.c \
452 -n micromips_m32_support.h
-hf tmp-support.h \
453 -n micromips_m32_support.c
-f tmp-support.c \
455 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
456 micromips_m32_icache.h
457 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
458 micromips_m32_icache.c
459 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
460 micromips_m32_idecode.h
461 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
462 micromips_m32_idecode.c
463 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
464 micromips_m32_semantics.h
465 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
466 micromips_m32_semantics.c
467 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
468 micromips_m32_model.h
469 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
470 micromips_m32_model.c
471 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
472 micromips_m32_support.h
473 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
474 micromips_m32_support.c
481 @sim_igen_flags@ @sim_micromips_flags@ @sim_micromips16_flags@\
482 -G gen-direct-access \
485 -n itable.h
-ht tmp-itable.h \
486 -n itable.c
-t tmp-itable.c \
488 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
489 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
492 BUILT_SRC_FROM_MULTI
= @sim_multi_src@
493 SIM_MULTI_IGEN_CONFIGS
= @sim_multi_igen_configs@
495 $(BUILT_SRC_FROM_MULTI
): tmp-multi
496 tmp-multi
: tmp-mach-multi tmp-itable-multi tmp-run-multi targ-vals.h
497 tmp-mach-multi
: $(IGEN_INSN
) $(IGEN_DC
) $(IGEN
) $(IGEN_INCLUDE
)
498 for t in
$(SIM_MULTI_IGEN_CONFIGS
); do \
499 p
=`echo $${t} | sed -e 's/:.*//'` ; \
500 m
=`echo $${t} | sed -e 's/.*:\(.*\):.*/\1/'` ; \
501 f
=`echo $${t} | sed -e 's/.*://'` ; \
503 micromips16
*) e
="-B 16 -H 15 -o $(MICROMIPS16_DC) -F 16" ;; \
504 micromips32
* | micromips64
*) \
505 e
="-B 32 -H 31 -o $(MICROMIPS32_DC) -F $${f}" ;; \
507 e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}"; \
508 m
="mips32r2,mips3d,mdmx,dsp,dsp2,smartmips" ;; \
510 e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}"; \
511 m
="mips64r2,mips3d,mdmx,dsp,dsp2,smartmips" ;; \
512 m16
*) e
="-B 16 -H 15 -o $(M16_DC) -F 16" ;; \
513 *) e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}" ;; \
523 -G gen-direct-access \
528 -n
$${p}_icache.h
-hc tmp-icache.h \
529 -n
$${p}_icache.c
-c tmp-icache.c \
530 -n
$${p}_semantics.h
-hs tmp-semantics.h \
531 -n
$${p}_semantics.c
-s tmp-semantics.c \
532 -n
$${p}_idecode.h
-hd tmp-idecode.h \
533 -n
$${p}_idecode.c
-d tmp-idecode.c \
534 -n
$${p}_model.h
-hm tmp-model.h \
535 -n
$${p}_model.c
-m tmp-model.c \
536 -n
$${p}_support.h
-hf tmp-support.h \
537 -n
$${p}_support.c
-f tmp-support.c \
538 -n
$${p}_engine.h
-he tmp-engine.h \
539 -n
$${p}_engine.c
-e tmp-engine.c \
541 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
543 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
545 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
547 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
549 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
550 $${p}_semantics.h
; \
551 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
552 $${p}_semantics.c
; \
553 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
555 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
557 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
559 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
561 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.h \
563 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.c \
567 tmp-itable-multi
: $(IGEN_INSN
) $(IGEN_DC
) $(IGEN
) $(IGEN_INCLUDE
)
576 -G gen-direct-access \
579 -n itable.h
-ht tmp-itable.h \
580 -n itable.c
-t tmp-itable.c \
582 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
583 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
584 touch tmp-itable-multi
585 tmp-run-multi
: $(srcdir)/m16run.c
$(srcdir)/micromipsrun.c
586 for t in
$(SIM_MULTI_IGEN_CONFIGS
); do \
589 m
=`echo $${t} | sed -e 's/^m16//' -e 's/:.*//'`; \
590 sed
< $(srcdir)/m16run.c
> tmp-run \
591 -e
"s/^sim_/m16$${m}_/" \
592 -e
"s/m16_/m16$${m}_/" \
593 -e
"s/m32_/m32$${m}_/" ; \
594 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
598 m
=`echo $${t} | sed -e 's/^micromips32//' -e 's/:.*//'`; \
599 sed
< $(srcdir)/micromipsrun.c
> tmp-run \
600 -e
"s/^sim_/micromips32$${m}_/" \
601 -e
"s/micromips16_/micromips16$${m}_/" \
602 -e
"s/micromips32_/micromips32$${m}_/" \
603 -e
"s/m32_/m32$${m}_/" ; \
604 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
605 micromips
$${m}_run.c
; \
608 m
=`echo $${t} | sed -e 's/^micromips64//' -e 's/:.*//'`; \
609 sed
< $(srcdir)/micromipsrun.c
> tmp-run \
610 -e
"s/^sim_/micromips64$${m}_/" \
611 -e
"s/micromips16_/micromips16$${m}_/" \
612 -e
"s/micromips32_/micromips64$${m}_/" \
613 -e
"s/m32_/m64$${m}_/" ; \
614 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
615 micromips
$${m}_run.c
; \
622 rm -f
$(BUILT_SRC_FROM_GEN
)
623 rm -f
$(BUILT_SRC_FROM_IGEN
)
624 rm -f
$(BUILT_SRC_FROM_M16
)
625 rm -f
$(BUILT_SRC_FROM_MICROMIPS
)
626 rm -f
$(BUILT_SRC_FROM_MULTI
)
628 rm -f micromips16
*.o micromips32
*.o m16
*.o m32
*.o itable
*.o
631 rm -f multi-include.h multi-run.c