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
85 ## COMMON_POST_CONFIG_FRAG
87 IGEN_TRACE
= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries # -G trace-all
88 IGEN_INSN
=$(srcdir)/mips.igen
89 IGEN_DC
=$(srcdir)/mips.dc
90 M16_DC
=$(srcdir)/m16.dc
91 MICROMIPS32_DC
=$(srcdir)/micromips.dc
92 MICROMIPS16_DC
=$(srcdir)/micromips16.dc
94 $(srcdir)/micromipsdsp.igen \
95 $(srcdir)/micromips.igen \
99 $(srcdir)/mips3d.igen \
104 $(srcdir)/dsp2.igen \
105 $(srcdir)/mips3264r2.igen \
107 # NB: Since these can be built by a number of generators, care
108 # must be taken to ensure that they are only dependant on
109 # one of those generators.
110 BUILT_SRC_FROM_GEN
= \
114 SIM_IGEN_ALL
= tmp-igen
115 SIM_M16_ALL
= tmp-m16
116 SIM_MICROMIPS_ALL
= tmp-micromips
117 SIM_MULTI_ALL
= tmp-multi
119 $(BUILT_SRC_FROM_GEN
): $(SIM_@sim_gen@_ALL
)
123 BUILT_SRC_FROM_IGEN
= \
138 $(BUILT_SRC_FROM_IGEN
): tmp-igen
140 tmp-igen
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
147 -G gen-direct-access \
154 -n icache.h
-hc tmp-icache.h \
155 -n icache.c
-c tmp-icache.c \
156 -n semantics.h
-hs tmp-semantics.h \
157 -n semantics.c
-s tmp-semantics.c \
158 -n idecode.h
-hd tmp-idecode.h \
159 -n idecode.c
-d tmp-idecode.c \
160 -n model.h
-hm tmp-model.h \
161 -n model.c
-m tmp-model.c \
162 -n support.h
-hf tmp-support.h \
163 -n support.c
-f tmp-support.c \
164 -n itable.h
-ht tmp-itable.h \
165 -n itable.c
-t tmp-itable.c \
166 -n engine.h
-he tmp-engine.h \
167 -n engine.c
-e tmp-engine.c \
168 -n irun.c
-r tmp-irun.c
169 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h icache.h
170 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c icache.c
171 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h idecode.h
172 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c idecode.c
173 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h semantics.h
174 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c semantics.c
175 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h model.h
176 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c model.c
177 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h support.h
178 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c support.c
179 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
180 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
181 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.h engine.h
182 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.c engine.c
183 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-irun.c irun.c
186 BUILT_SRC_FROM_M16
= \
209 $(BUILT_SRC_FROM_M16
): tmp-m16
211 tmp-m16
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
218 -G gen-direct-access \
226 -n m16_icache.h
-hc tmp-icache.h \
227 -n m16_icache.c
-c tmp-icache.c \
228 -n m16_semantics.h
-hs tmp-semantics.h \
229 -n m16_semantics.c
-s tmp-semantics.c \
230 -n m16_idecode.h
-hd tmp-idecode.h \
231 -n m16_idecode.c
-d tmp-idecode.c \
232 -n m16_model.h
-hm tmp-model.h \
233 -n m16_model.c
-m tmp-model.c \
234 -n m16_support.h
-hf tmp-support.h \
235 -n m16_support.c
-f tmp-support.c \
237 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h m16_icache.h
238 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c m16_icache.c
239 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h m16_idecode.h
240 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c m16_idecode.c
241 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h m16_semantics.h
242 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c m16_semantics.c
243 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h m16_model.h
244 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c m16_model.c
245 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h m16_support.h
246 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c m16_support.c
253 -G gen-direct-access \
261 -n m32_icache.h
-hc tmp-icache.h \
262 -n m32_icache.c
-c tmp-icache.c \
263 -n m32_semantics.h
-hs tmp-semantics.h \
264 -n m32_semantics.c
-s tmp-semantics.c \
265 -n m32_idecode.h
-hd tmp-idecode.h \
266 -n m32_idecode.c
-d tmp-idecode.c \
267 -n m32_model.h
-hm tmp-model.h \
268 -n m32_model.c
-m tmp-model.c \
269 -n m32_support.h
-hf tmp-support.h \
270 -n m32_support.c
-f tmp-support.c \
272 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h m32_icache.h
273 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c m32_icache.c
274 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h m32_idecode.h
275 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c m32_idecode.c
276 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
278 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
280 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h m32_model.h
281 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c m32_model.c
282 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h m32_support.h
283 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c m32_support.c
290 @sim_igen_flags@ @sim_m16_flags@ \
291 -G gen-direct-access \
294 -n itable.h
-ht tmp-itable.h \
295 -n itable.c
-t tmp-itable.c \
297 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
298 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
301 BUILT_SRC_FROM_MICROMIPS
= \
302 micromips16_icache.h \
303 micromips16_icache.c \
304 micromips16_idecode.h \
305 micromips16_idecode.c \
306 micromips16_semantics.h \
307 micromips16_semantics.c \
308 micromips16_model.h \
309 micromips16_model.c \
310 micromips16_support.h \
311 micromips16_support.c \
313 micromips32_icache.h \
314 micromips32_icache.c \
315 micromips32_idecode.h \
316 micromips32_idecode.c \
317 micromips32_semantics.h \
318 micromips32_semantics.c \
319 micromips32_model.h \
320 micromips32_model.c \
321 micromips32_support.h \
322 micromips32_support.c \
324 micromips_m32_icache.h \
325 micromips_m32_icache.c \
326 micromips_m32_idecode.h \
327 micromips_m32_idecode.c \
328 micromips_m32_semantics.h \
329 micromips_m32_semantics.c \
330 micromips_m32_model.h \
331 micromips_m32_model.c \
332 micromips_m32_support.h \
333 micromips_m32_support.c \
335 $(BUILT_SRC_FROM_MICROMIPS
): tmp-micromips
337 tmp-micromips
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
343 @sim_micromips16_flags@ \
344 -G gen-direct-access \
349 -o
$(MICROMIPS16_DC
) \
352 -n micromips16_icache.h
-hc tmp-icache.h \
353 -n micromips16_icache.c
-c tmp-icache.c \
354 -n micromips16_semantics.h
-hs tmp-semantics.h \
355 -n micromips16_semantics.c
-s tmp-semantics.c \
356 -n micromips16_idecode.h
-hd tmp-idecode.h \
357 -n micromips16_idecode.c
-d tmp-idecode.c \
358 -n micromips16_model.h
-hm tmp-model.h \
359 -n micromips16_model.c
-m tmp-model.c \
360 -n micromips16_support.h
-hf tmp-support.h \
361 -n micromips16_support.c
-f tmp-support.c \
363 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
365 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
367 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
368 micromips16_idecode.h
369 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
370 micromips16_idecode.c
371 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
372 micromips16_semantics.h
373 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
374 micromips16_semantics.c
375 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
377 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
379 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
380 micromips16_support.h
381 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
382 micromips16_support.c
388 @sim_micromips_flags@ \
389 -G gen-direct-access \
394 -o
$(MICROMIPS32_DC
) \
397 -n micromips32_icache.h
-hc tmp-icache.h \
398 -n micromips32_icache.c
-c tmp-icache.c \
399 -n micromips32_semantics.h
-hs tmp-semantics.h \
400 -n micromips32_semantics.c
-s tmp-semantics.c \
401 -n micromips32_idecode.h
-hd tmp-idecode.h \
402 -n micromips32_idecode.c
-d tmp-idecode.c \
403 -n micromips32_model.h
-hm tmp-model.h \
404 -n micromips32_model.c
-m tmp-model.c \
405 -n micromips32_support.h
-hf tmp-support.h \
406 -n micromips32_support.c
-f tmp-support.c \
408 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
410 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
412 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
413 micromips32_idecode.h
414 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
415 micromips32_idecode.c
416 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
417 micromips32_semantics.h
418 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
419 micromips32_semantics.c
420 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
422 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
424 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
425 micromips32_support.h
426 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
427 micromips32_support.c
434 -G gen-direct-access \
442 -n micromips_m32_icache.h
-hc tmp-icache.h \
443 -n micromips_m32_icache.c
-c tmp-icache.c \
444 -n micromips_m32_semantics.h
-hs tmp-semantics.h \
445 -n micromips_m32_semantics.c
-s tmp-semantics.c \
446 -n micromips_m32_idecode.h
-hd tmp-idecode.h \
447 -n micromips_m32_idecode.c
-d tmp-idecode.c \
448 -n micromips_m32_model.h
-hm tmp-model.h \
449 -n micromips_m32_model.c
-m tmp-model.c \
450 -n micromips_m32_support.h
-hf tmp-support.h \
451 -n micromips_m32_support.c
-f tmp-support.c \
453 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
454 micromips_m32_icache.h
455 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
456 micromips_m32_icache.c
457 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
458 micromips_m32_idecode.h
459 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
460 micromips_m32_idecode.c
461 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
462 micromips_m32_semantics.h
463 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
464 micromips_m32_semantics.c
465 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
466 micromips_m32_model.h
467 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
468 micromips_m32_model.c
469 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
470 micromips_m32_support.h
471 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
472 micromips_m32_support.c
479 @sim_igen_flags@ @sim_micromips_flags@ @sim_micromips16_flags@\
480 -G gen-direct-access \
483 -n itable.h
-ht tmp-itable.h \
484 -n itable.c
-t tmp-itable.c \
486 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
487 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
490 BUILT_SRC_FROM_MULTI
= @sim_multi_src@
491 SIM_MULTI_IGEN_CONFIGS
= @sim_multi_igen_configs@
493 $(BUILT_SRC_FROM_MULTI
): tmp-multi
494 tmp-multi
: tmp-mach-multi tmp-itable-multi tmp-run-multi targ-vals.h
495 tmp-mach-multi
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
496 for t in
$(SIM_MULTI_IGEN_CONFIGS
); do \
497 p
=`echo $${t} | sed -e 's/:.*//'` ; \
498 m
=`echo $${t} | sed -e 's/.*:\(.*\):.*/\1/'` ; \
499 f
=`echo $${t} | sed -e 's/.*://'` ; \
501 micromips16
*) e
="-B 16 -H 15 -o $(MICROMIPS16_DC) -F 16" ;; \
502 micromips32
* | micromips64
*) \
503 e
="-B 32 -H 31 -o $(MICROMIPS32_DC) -F $${f}" ;; \
505 e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}"; \
506 m
="mips32r2,mips3d,mdmx,dsp,dsp2,smartmips" ;; \
508 e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}"; \
509 m
="mips64r2,mips3d,mdmx,dsp,dsp2,smartmips" ;; \
510 m16
*) e
="-B 16 -H 15 -o $(M16_DC) -F 16" ;; \
511 *) e
="-B 32 -H 31 -o $(IGEN_DC) -F $${f}" ;; \
521 -G gen-direct-access \
526 -n
$${p}_icache.h
-hc tmp-icache.h \
527 -n
$${p}_icache.c
-c tmp-icache.c \
528 -n
$${p}_semantics.h
-hs tmp-semantics.h \
529 -n
$${p}_semantics.c
-s tmp-semantics.c \
530 -n
$${p}_idecode.h
-hd tmp-idecode.h \
531 -n
$${p}_idecode.c
-d tmp-idecode.c \
532 -n
$${p}_model.h
-hm tmp-model.h \
533 -n
$${p}_model.c
-m tmp-model.c \
534 -n
$${p}_support.h
-hf tmp-support.h \
535 -n
$${p}_support.c
-f tmp-support.c \
536 -n
$${p}_engine.h
-he tmp-engine.h \
537 -n
$${p}_engine.c
-e tmp-engine.c \
539 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.h \
541 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-icache.c \
543 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.h \
545 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-idecode.c \
547 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.h \
548 $${p}_semantics.h
; \
549 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-semantics.c \
550 $${p}_semantics.c
; \
551 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.h \
553 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-model.c \
555 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.h \
557 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-support.c \
559 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.h \
561 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-engine.c \
565 tmp-itable-multi
: $(IGEN_INSN
) $(IGEN_DC
) ..
/igen
/igen
$(IGEN_INCLUDE
)
574 -G gen-direct-access \
577 -n itable.h
-ht tmp-itable.h \
578 -n itable.c
-t tmp-itable.c \
580 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.h itable.h
581 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-itable.c itable.c
582 touch tmp-itable-multi
583 tmp-run-multi
: $(srcdir)/m16run.c
$(srcdir)/micromipsrun.c
584 for t in
$(SIM_MULTI_IGEN_CONFIGS
); do \
587 m
=`echo $${t} | sed -e 's/^m16//' -e 's/:.*//'`; \
588 sed
< $(srcdir)/m16run.c
> tmp-run \
589 -e
"s/^sim_/m16$${m}_/" \
590 -e
"s/m16_/m16$${m}_/" \
591 -e
"s/m32_/m32$${m}_/" ; \
592 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
596 m
=`echo $${t} | sed -e 's/^micromips32//' -e 's/:.*//'`; \
597 sed
< $(srcdir)/micromipsrun.c
> tmp-run \
598 -e
"s/^sim_/micromips32$${m}_/" \
599 -e
"s/micromips16_/micromips16$${m}_/" \
600 -e
"s/micromips32_/micromips32$${m}_/" \
601 -e
"s/m32_/m32$${m}_/" ; \
602 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
603 micromips
$${m}_run.c
; \
606 m
=`echo $${t} | sed -e 's/^micromips64//' -e 's/:.*//'`; \
607 sed
< $(srcdir)/micromipsrun.c
> tmp-run \
608 -e
"s/^sim_/micromips64$${m}_/" \
609 -e
"s/micromips16_/micromips16$${m}_/" \
610 -e
"s/micromips32_/micromips64$${m}_/" \
611 -e
"s/m32_/m64$${m}_/" ; \
612 $(SHELL
) $(srcdir)/..
/..
/move-if-change tmp-run \
613 micromips
$${m}_run.c
; \
620 rm -f
$(BUILT_SRC_FROM_GEN
)
621 rm -f
$(BUILT_SRC_FROM_IGEN
)
622 rm -f
$(BUILT_SRC_FROM_M16
)
623 rm -f
$(BUILT_SRC_FROM_MICROMIPS
)
624 rm -f
$(BUILT_SRC_FROM_MULTI
)
626 rm -f micromips16
*.o micromips32
*.o m16
*.o m32
*.o itable
*.o
629 rm -f multi-include.h multi-run.c