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