Commit | Line | Data |
---|---|---|
c28c63d8 JB |
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. | |
7 | SIM_OBJS = \ | |
8 | $(SIM_NEW_COMMON_OBJS) \ | |
c28c63d8 | 9 | cgen-utils.o cgen-trace.o cgen-scache.o \ |
797eee42 | 10 | cgen-run.o \ |
c28c63d8 JB |
11 | sim-if.o arch.o \ |
12 | cpu.o decode.o sem.o model.o mloop.o \ | |
13 | lm32.o traps.o user.o | |
b97514f2 | 14 | |
be0387ee MF |
15 | SIM_EXTRA_HW_DEVICES = lm32cpu lm32timer lm32uart |
16 | ||
c28c63d8 JB |
17 | # List of extra dependencies. |
18 | # Generally this consists of simulator specific files included by sim-main.h. | |
e7d8f1da TT |
19 | SIM_EXTRA_DEPS = $(CGEN_INCLUDE_DEPS) $(srcdir)/../../opcodes/lm32-desc.h \ |
20 | eng.h | |
c28c63d8 JB |
21 | |
22 | # List of flags to always pass to $(CC). | |
23 | #SIM_EXTRA_CFLAGS = | |
24 | ||
c28c63d8 JB |
25 | SIM_EXTRA_CLEAN = lm32-clean |
26 | ||
982c3a65 MF |
27 | # Code doesn't build cleanly yet. |
28 | SIM_WERROR_CFLAGS = | |
29 | ||
c28c63d8 JB |
30 | ## COMMON_POST_CONFIG_FRAG |
31 | ||
32 | arch = lm32 | |
33 | ||
c28c63d8 JB |
34 | LM32BF_INCLUDE_DEPS = \ |
35 | $(CGEN_MAIN_CPU_DEPS) \ | |
36 | cpu.h decode.h eng.h | |
37 | ||
c28c63d8 JB |
38 | # FIXME: Use of `mono' is wip. |
39 | mloop.c eng.h: stamp-mloop | |
40 | stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile | |
599a6ff0 | 41 | $(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \ |
c28c63d8 JB |
42 | -mono -fast -pbb -switch sem-switch.c \ |
43 | -cpu lm32bf -infile $(srcdir)/mloop.in | |
44 | $(SHELL) $(srcroot)/move-if-change eng.hin eng.h | |
45 | $(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c | |
46 | touch stamp-mloop | |
c28c63d8 JB |
47 | |
48 | lm32-clean: | |
49 | rm -f mloop.c eng.h stamp-mloop | |
50 | rm -f stamp-arch stamp-cpu | |
51 | rm -f tmp-* | |
52 | ||
c92e840b | 53 | stamp-arch: $(CGEN_READ_SCM) $(CGEN_ARCH_SCM) $(CPU_DIR)/lm32.cpu |
c28c63d8 | 54 | $(MAKE) cgen-arch $(CGEN_FLAGS_TO_PASS) mach=all \ |
c92e840b | 55 | archfile=$(CPU_DIR)/lm32.cpu \ |
c28c63d8 JB |
56 | FLAGS="with-scache with-profile=fn" |
57 | touch stamp-arch | |
58 | arch.h arch.c cpuall.h: $(CGEN_MAINT) stamp-arch | |
59 | ||
c92e840b | 60 | stamp-cpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CPU_DIR)/lm32.cpu |
c28c63d8 JB |
61 | $(MAKE) cgen-cpu-decode $(CGEN_FLAGS_TO_PASS) \ |
62 | cpu=lm32bf mach=lm32 SUFFIX= \ | |
c92e840b | 63 | archfile=$(CPU_DIR)/lm32.cpu \ |
c28c63d8 JB |
64 | FLAGS="with-scache with-profile=fn" \ |
65 | EXTRAFILES="$(CGEN_CPU_SEM) $(CGEN_CPU_SEMSW)" | |
66 | touch stamp-cpu | |
67 | cpu.h sem.c sem-switch.c model.c decode.c decode.h: $(CGEN_MAINT) stamp-cpu |