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 SIM_EXTRA_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
101 IGEN_TRACE= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries # -G trace-all
102 IGEN_INSN=$(srcdir)/mips.igen
103 IGEN_DC=$(srcdir)/mips.dc
104 M16_DC=$(srcdir)/m16.dc
105 MICROMIPS32_DC=$(srcdir)/micromips.dc
106 MICROMIPS16_DC=$(srcdir)/micromips16.dc
108 $(srcdir)/micromipsdsp.igen \
109 $(srcdir)/micromips.igen \
111 $(srcdir)/m16e.igen \
112 $(srcdir)/mdmx.igen \
113 $(srcdir)/mips3d.igen \
118 $(srcdir)/dsp2.igen \
119 $(srcdir)/mips3264r2.igen \
121 # NB: Since these can be built by a number of generators, care
122 # must be taken to ensure that they are only dependant on
123 # one of those generators.
124 BUILT_SRC_FROM_GEN = \
128 SIM_IGEN_ALL = tmp-igen
129 SIM_M16_ALL = tmp-m16
130 SIM_MICROMIPS_ALL = tmp-micromips
131 SIM_MULTI_ALL = tmp-multi
133 $(BUILT_SRC_FROM_GEN): $(SIM_@sim_gen@_ALL)
137 BUILT_SRC_FROM_IGEN = \
152 $(BUILT_SRC_FROM_IGEN): tmp-igen
154 tmp-igen: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE)
155 cd ../igen && $(MAKE)
162 -G gen-direct-access \
169 -n icache.h -hc tmp-icache.h \
170 -n icache.c -c tmp-icache.c \
171 -n semantics.h -hs tmp-semantics.h \
172 -n semantics.c -s tmp-semantics.c \
173 -n idecode.h -hd tmp-idecode.h \
174 -n idecode.c -d tmp-idecode.c \
175 -n model.h -hm tmp-model.h \
176 -n model.c -m tmp-model.c \
177 -n support.h -hf tmp-support.h \
178 -n support.c -f tmp-support.c \
179 -n itable.h -ht tmp-itable.h \
180 -n itable.c -t tmp-itable.c \
181 -n engine.h -he tmp-engine.h \
182 -n engine.c -e tmp-engine.c \
183 -n irun.c -r tmp-irun.c
184 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h icache.h
185 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c icache.c
186 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h idecode.h
187 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c idecode.c
188 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h semantics.h
189 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c semantics.c
190 $(SHELL) $(srcdir)/../../move-if-change tmp-model.h model.h
191 $(SHELL) $(srcdir)/../../move-if-change tmp-model.c model.c
192 $(SHELL) $(srcdir)/../../move-if-change tmp-support.h support.h
193 $(SHELL) $(srcdir)/../../move-if-change tmp-support.c support.c
194 $(SHELL) $(srcdir)/../../move-if-change tmp-itable.h itable.h
195 $(SHELL) $(srcdir)/../../move-if-change tmp-itable.c itable.c
196 $(SHELL) $(srcdir)/../../move-if-change tmp-engine.h engine.h
197 $(SHELL) $(srcdir)/../../move-if-change tmp-engine.c engine.c
198 $(SHELL) $(srcdir)/../../move-if-change tmp-irun.c irun.c
201 BUILT_SRC_FROM_M16 = \
224 $(BUILT_SRC_FROM_M16): tmp-m16
226 tmp-m16: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE)
227 cd ../igen && $(MAKE)
234 -G gen-direct-access \
242 -n m16_icache.h -hc tmp-icache.h \
243 -n m16_icache.c -c tmp-icache.c \
244 -n m16_semantics.h -hs tmp-semantics.h \
245 -n m16_semantics.c -s tmp-semantics.c \
246 -n m16_idecode.h -hd tmp-idecode.h \
247 -n m16_idecode.c -d tmp-idecode.c \
248 -n m16_model.h -hm tmp-model.h \
249 -n m16_model.c -m tmp-model.c \
250 -n m16_support.h -hf tmp-support.h \
251 -n m16_support.c -f tmp-support.c \
253 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h m16_icache.h
254 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c m16_icache.c
255 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h m16_idecode.h
256 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c m16_idecode.c
257 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h m16_semantics.h
258 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c m16_semantics.c
259 $(SHELL) $(srcdir)/../../move-if-change tmp-model.h m16_model.h
260 $(SHELL) $(srcdir)/../../move-if-change tmp-model.c m16_model.c
261 $(SHELL) $(srcdir)/../../move-if-change tmp-support.h m16_support.h
262 $(SHELL) $(srcdir)/../../move-if-change tmp-support.c m16_support.c
269 -G gen-direct-access \
277 -n m32_icache.h -hc tmp-icache.h \
278 -n m32_icache.c -c tmp-icache.c \
279 -n m32_semantics.h -hs tmp-semantics.h \
280 -n m32_semantics.c -s tmp-semantics.c \
281 -n m32_idecode.h -hd tmp-idecode.h \
282 -n m32_idecode.c -d tmp-idecode.c \
283 -n m32_model.h -hm tmp-model.h \
284 -n m32_model.c -m tmp-model.c \
285 -n m32_support.h -hf tmp-support.h \
286 -n m32_support.c -f tmp-support.c \
288 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h m32_icache.h
289 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c m32_icache.c
290 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h m32_idecode.h
291 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c m32_idecode.c
292 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h \
294 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c \
296 $(SHELL) $(srcdir)/../../move-if-change tmp-model.h m32_model.h
297 $(SHELL) $(srcdir)/../../move-if-change tmp-model.c m32_model.c
298 $(SHELL) $(srcdir)/../../move-if-change tmp-support.h m32_support.h
299 $(SHELL) $(srcdir)/../../move-if-change tmp-support.c m32_support.c
306 @sim_igen_flags@ @sim_m16_flags@ \
307 -G gen-direct-access \
310 -n itable.h -ht tmp-itable.h \
311 -n itable.c -t tmp-itable.c \
313 $(SHELL) $(srcdir)/../../move-if-change tmp-itable.h itable.h
314 $(SHELL) $(srcdir)/../../move-if-change tmp-itable.c itable.c
317 BUILT_SRC_FROM_MICROMIPS = \
318 micromips16_icache.h \
319 micromips16_icache.c \
320 micromips16_idecode.h \
321 micromips16_idecode.c \
322 micromips16_semantics.h \
323 micromips16_semantics.c \
324 micromips16_model.h \
325 micromips16_model.c \
326 micromips16_support.h \
327 micromips16_support.c \
329 micromips32_icache.h \
330 micromips32_icache.c \
331 micromips32_idecode.h \
332 micromips32_idecode.c \
333 micromips32_semantics.h \
334 micromips32_semantics.c \
335 micromips32_model.h \
336 micromips32_model.c \
337 micromips32_support.h \
338 micromips32_support.c \
340 micromips_m32_icache.h \
341 micromips_m32_icache.c \
342 micromips_m32_idecode.h \
343 micromips_m32_idecode.c \
344 micromips_m32_semantics.h \
345 micromips_m32_semantics.c \
346 micromips_m32_model.h \
347 micromips_m32_model.c \
348 micromips_m32_support.h \
349 micromips_m32_support.c \
351 $(BUILT_SRC_FROM_MICROMIPS): tmp-micromips
353 tmp-micromips: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE)
354 cd ../igen && $(MAKE)
360 @sim_micromips16_flags@ \
361 -G gen-direct-access \
366 -o $(MICROMIPS16_DC) \
369 -n micromips16_icache.h -hc tmp-icache.h \
370 -n micromips16_icache.c -c tmp-icache.c \
371 -n micromips16_semantics.h -hs tmp-semantics.h \
372 -n micromips16_semantics.c -s tmp-semantics.c \
373 -n micromips16_idecode.h -hd tmp-idecode.h \
374 -n micromips16_idecode.c -d tmp-idecode.c \
375 -n micromips16_model.h -hm tmp-model.h \
376 -n micromips16_model.c -m tmp-model.c \
377 -n micromips16_support.h -hf tmp-support.h \
378 -n micromips16_support.c -f tmp-support.c \
380 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h \
382 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c \
384 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h \
385 micromips16_idecode.h
386 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c \
387 micromips16_idecode.c
388 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h \
389 micromips16_semantics.h
390 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c \
391 micromips16_semantics.c
392 $(SHELL) $(srcdir)/../../move-if-change tmp-model.h \
394 $(SHELL) $(srcdir)/../../move-if-change tmp-model.c \
396 $(SHELL) $(srcdir)/../../move-if-change tmp-support.h \
397 micromips16_support.h
398 $(SHELL) $(srcdir)/../../move-if-change tmp-support.c \
399 micromips16_support.c
400 cd ../igen && $(MAKE)
406 @sim_micromips_flags@ \
407 -G gen-direct-access \
412 -o $(MICROMIPS32_DC) \
415 -n micromips32_icache.h -hc tmp-icache.h \
416 -n micromips32_icache.c -c tmp-icache.c \
417 -n micromips32_semantics.h -hs tmp-semantics.h \
418 -n micromips32_semantics.c -s tmp-semantics.c \
419 -n micromips32_idecode.h -hd tmp-idecode.h \
420 -n micromips32_idecode.c -d tmp-idecode.c \
421 -n micromips32_model.h -hm tmp-model.h \
422 -n micromips32_model.c -m tmp-model.c \
423 -n micromips32_support.h -hf tmp-support.h \
424 -n micromips32_support.c -f tmp-support.c \
426 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h \
428 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c \
430 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h \
431 micromips32_idecode.h
432 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c \
433 micromips32_idecode.c
434 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h \
435 micromips32_semantics.h
436 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c \
437 micromips32_semantics.c
438 $(SHELL) $(srcdir)/../../move-if-change tmp-model.h \
440 $(SHELL) $(srcdir)/../../move-if-change tmp-model.c \
442 $(SHELL) $(srcdir)/../../move-if-change tmp-support.h \
443 micromips32_support.h
444 $(SHELL) $(srcdir)/../../move-if-change tmp-support.c \
445 micromips32_support.c
452 -G gen-direct-access \
460 -n micromips_m32_icache.h -hc tmp-icache.h \
461 -n micromips_m32_icache.c -c tmp-icache.c \
462 -n micromips_m32_semantics.h -hs tmp-semantics.h \
463 -n micromips_m32_semantics.c -s tmp-semantics.c \
464 -n micromips_m32_idecode.h -hd tmp-idecode.h \
465 -n micromips_m32_idecode.c -d tmp-idecode.c \
466 -n micromips_m32_model.h -hm tmp-model.h \
467 -n micromips_m32_model.c -m tmp-model.c \
468 -n micromips_m32_support.h -hf tmp-support.h \
469 -n micromips_m32_support.c -f tmp-support.c \
471 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h \
472 micromips_m32_icache.h
473 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c \
474 micromips_m32_icache.c
475 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h \
476 micromips_m32_idecode.h
477 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c \
478 micromips_m32_idecode.c
479 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h \
480 micromips_m32_semantics.h
481 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c \
482 micromips_m32_semantics.c
483 $(SHELL) $(srcdir)/../../move-if-change tmp-model.h \
484 micromips_m32_model.h
485 $(SHELL) $(srcdir)/../../move-if-change tmp-model.c \
486 micromips_m32_model.c
487 $(SHELL) $(srcdir)/../../move-if-change tmp-support.h \
488 micromips_m32_support.h
489 $(SHELL) $(srcdir)/../../move-if-change tmp-support.c \
490 micromips_m32_support.c
497 @sim_igen_flags@ @sim_micromips_flags@ @sim_micromips16_flags@\
498 -G gen-direct-access \
501 -n itable.h -ht tmp-itable.h \
502 -n itable.c -t tmp-itable.c \
504 $(SHELL) $(srcdir)/../../move-if-change tmp-itable.h itable.h
505 $(SHELL) $(srcdir)/../../move-if-change tmp-itable.c itable.c
508 BUILT_SRC_FROM_MULTI = @sim_multi_src@
509 SIM_MULTI_IGEN_CONFIGS = @sim_multi_igen_configs@
511 $(BUILT_SRC_FROM_MULTI): tmp-multi
512 tmp-multi: tmp-mach-multi tmp-itable-multi tmp-run-multi targ-vals.h
513 tmp-mach-multi: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE)
514 for t in $(SIM_MULTI_IGEN_CONFIGS); do \
515 p=`echo $${t} | sed -e 's/:.*//'` ; \
516 m=`echo $${t} | sed -e 's/.*:\(.*\):.*/\1/'` ; \
517 f=`echo $${t} | sed -e 's/.*://'` ; \
519 micromips16*) e="-B 16 -H 15 -o $(MICROMIPS16_DC) -F 16" ;; \
520 micromips32* | micromips64*) \
521 e="-B 32 -H 31 -o $(MICROMIPS32_DC) -F $${f}" ;; \
523 e="-B 32 -H 31 -o $(IGEN_DC) -F $${f}"; \
524 m="mips32r2,mips3d,mdmx,dsp,dsp2,smartmips" ;; \
526 e="-B 32 -H 31 -o $(IGEN_DC) -F $${f}"; \
527 m="mips64r2,mips3d,mdmx,dsp,dsp2,smartmips" ;; \
528 m16*) e="-B 16 -H 15 -o $(M16_DC) -F 16" ;; \
529 *) e="-B 32 -H 31 -o $(IGEN_DC) -F $${f}" ;; \
539 -G gen-direct-access \
544 -n $${p}_icache.h -hc tmp-icache.h \
545 -n $${p}_icache.c -c tmp-icache.c \
546 -n $${p}_semantics.h -hs tmp-semantics.h \
547 -n $${p}_semantics.c -s tmp-semantics.c \
548 -n $${p}_idecode.h -hd tmp-idecode.h \
549 -n $${p}_idecode.c -d tmp-idecode.c \
550 -n $${p}_model.h -hm tmp-model.h \
551 -n $${p}_model.c -m tmp-model.c \
552 -n $${p}_support.h -hf tmp-support.h \
553 -n $${p}_support.c -f tmp-support.c \
554 -n $${p}_engine.h -he tmp-engine.h \
555 -n $${p}_engine.c -e tmp-engine.c \
557 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h \
559 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c \
561 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h \
563 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c \
565 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h \
566 $${p}_semantics.h ; \
567 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c \
568 $${p}_semantics.c ; \
569 $(SHELL) $(srcdir)/../../move-if-change tmp-model.h \
571 $(SHELL) $(srcdir)/../../move-if-change tmp-model.c \
573 $(SHELL) $(srcdir)/../../move-if-change tmp-support.h \
575 $(SHELL) $(srcdir)/../../move-if-change tmp-support.c \
577 $(SHELL) $(srcdir)/../../move-if-change tmp-engine.h \
579 $(SHELL) $(srcdir)/../../move-if-change tmp-engine.c \
583 tmp-itable-multi: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE)
592 -G gen-direct-access \
595 -n itable.h -ht tmp-itable.h \
596 -n itable.c -t tmp-itable.c \
598 $(SHELL) $(srcdir)/../../move-if-change tmp-itable.h itable.h
599 $(SHELL) $(srcdir)/../../move-if-change tmp-itable.c itable.c
600 touch tmp-itable-multi
601 tmp-run-multi: $(srcdir)/m16run.c $(srcdir)/micromipsrun.c
602 for t in $(SIM_MULTI_IGEN_CONFIGS); do \
605 m=`echo $${t} | sed -e 's/^m16//' -e 's/:.*//'`; \
606 sed < $(srcdir)/m16run.c > tmp-run \
607 -e "s/^sim_/m16$${m}_/" \
608 -e "s/m16_/m16$${m}_/" \
609 -e "s/m32_/m32$${m}_/" ; \
610 $(SHELL) $(srcdir)/../../move-if-change tmp-run \
614 m=`echo $${t} | sed -e 's/^micromips32//' -e 's/:.*//'`; \
615 sed < $(srcdir)/micromipsrun.c > tmp-run \
616 -e "s/^sim_/micromips32$${m}_/" \
617 -e "s/micromips16_/micromips16$${m}_/" \
618 -e "s/micromips32_/micromips32$${m}_/" \
619 -e "s/m32_/m32$${m}_/" ; \
620 $(SHELL) $(srcdir)/../../move-if-change tmp-run \
621 micromips$${m}_run.c ; \
624 m=`echo $${t} | sed -e 's/^micromips64//' -e 's/:.*//'`; \
625 sed < $(srcdir)/micromipsrun.c > tmp-run \
626 -e "s/^sim_/micromips64$${m}_/" \
627 -e "s/micromips16_/micromips16$${m}_/" \
628 -e "s/micromips32_/micromips64$${m}_/" \
629 -e "s/m32_/m64$${m}_/" ; \
630 $(SHELL) $(srcdir)/../../move-if-change tmp-run \
631 micromips$${m}_run.c ; \
638 rm -f $(BUILT_SRC_FROM_GEN)
639 rm -f $(BUILT_SRC_FROM_IGEN)
640 rm -f $(BUILT_SRC_FROM_M16)
641 rm -f $(BUILT_SRC_FROM_MICROMIPS)
642 rm -f $(BUILT_SRC_FROM_MULTI)
644 rm -f micromips16*.o micromips32*.o m16*.o m32*.o itable*.o
647 rm -f multi-include.h multi-run.c