1# Makefile for Lattice Mico32 simulator. 2# Contributed by Jon Beniston <jon@beniston.com> 3 4## COMMON_PRE_CONFIG_FRAG 5 6# List of object files, less common parts. 7SIM_OBJS = \ 8 $(SIM_NEW_COMMON_OBJS) \ 9 sim-hload.o \ 10 sim-model.o \ 11 sim-reg.o \ 12 sim-signal.o \ 13 cgen-utils.o cgen-trace.o cgen-scache.o \ 14 cgen-run.o sim-reason.o sim-stop.o \ 15 sim-if.o arch.o \ 16 cpu.o decode.o sem.o model.o mloop.o \ 17 lm32.o traps.o user.o 18 19# List of extra dependencies. 20# Generally this consists of simulator specific files included by sim-main.h. 21SIM_EXTRA_DEPS = $(CGEN_INCLUDE_DEPS) $(srcdir)/../../opcodes/lm32-desc.h 22 23# List of flags to always pass to $(CC). 24#SIM_EXTRA_CFLAGS = 25 26SIM_EXTRA_CLEAN = lm32-clean 27 28# This selects the lm32 newlib/libgloss syscall definitions. 29NL_TARGET = -DNL_TARGET_lm32 30 31## COMMON_POST_CONFIG_FRAG 32 33arch = lm32 34 35arch.o: arch.c $(SIM_MAIN_DEPS) 36 37traps.o: traps.c targ-vals.h $(SIM_MAIN_DEPS) 38 39sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h 40 41LM32BF_INCLUDE_DEPS = \ 42 $(CGEN_MAIN_CPU_DEPS) \ 43 cpu.h decode.h eng.h 44 45lm32.o: lm32.c $(LM32BF_INCLUDE_DEPS) 46 47# FIXME: Use of `mono' is wip. 48mloop.c eng.h: stamp-mloop 49stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile 50 $(SHELL) $(srccom)/genmloop.sh \ 51 -mono -fast -pbb -switch sem-switch.c \ 52 -cpu lm32bf -infile $(srcdir)/mloop.in 53 $(SHELL) $(srcroot)/move-if-change eng.hin eng.h 54 $(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c 55 touch stamp-mloop 56mloop.o: mloop.c sem-switch.c 57 58cpu.o: cpu.c $(LM32BF_INCLUDE_DEPS) 59decode.o: decode.c $(LM32BF_INCLUDE_DEPS) 60sem.o: sem.c $(LM32BF_INCLUDE_DEPS) 61model.o: model.c $(LM32BF_INCLUDE_DEPS) 62 63lm32-clean: 64 rm -f mloop.c eng.h stamp-mloop 65 rm -f stamp-arch stamp-cpu 66 rm -f tmp-* 67 68# cgen support, enable with --enable-cgen-maint 69CGEN_MAINT = ; @true 70# The following line is commented in or out depending upon --enable-cgen-maint. 71@CGEN_MAINT@CGEN_MAINT = 72 73stamp-arch: $(CGEN_READ_SCM) $(CGEN_ARCH_SCM) $(CPU_DIR)/lm32.cpu 74 $(MAKE) cgen-arch $(CGEN_FLAGS_TO_PASS) mach=all \ 75 archfile=$(CPU_DIR)/lm32.cpu \ 76 FLAGS="with-scache with-profile=fn" 77 touch stamp-arch 78arch.h arch.c cpuall.h: $(CGEN_MAINT) stamp-arch 79 80stamp-cpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CPU_DIR)/lm32.cpu 81 $(MAKE) cgen-cpu-decode $(CGEN_FLAGS_TO_PASS) \ 82 cpu=lm32bf mach=lm32 SUFFIX= \ 83 archfile=$(CPU_DIR)/lm32.cpu \ 84 FLAGS="with-scache with-profile=fn" \ 85 EXTRAFILES="$(CGEN_CPU_SEM) $(CGEN_CPU_SEMSW)" 86 touch stamp-cpu 87cpu.h sem.c sem-switch.c model.c decode.c decode.h: $(CGEN_MAINT) stamp-cpu 88