aboutsummaryrefslogtreecommitdiff
path: root/sim/lm32/Makefile.in
blob: 2daf74d637bc1e92f70fc4302f2e635c04797bd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Makefile for Lattice Mico32 simulator.
# Contributed by Jon Beniston <jon@beniston.com>

## COMMON_PRE_CONFIG_FRAG

# List of object files, less common parts.
SIM_OBJS = \
	$(SIM_NEW_COMMON_OBJS) \
        cgen-utils.o cgen-trace.o cgen-scache.o \
        cgen-run.o \
        sim-if.o arch.o \
        cpu.o decode.o sem.o model.o mloop.o \
        lm32.o traps.o user.o 

SIM_EXTRA_HW_DEVICES = lm32cpu lm32timer lm32uart

# List of extra dependencies.
# Generally this consists of simulator specific files included by sim-main.h.
SIM_EXTRA_DEPS = $(CGEN_INCLUDE_DEPS) $(srcdir)/../../opcodes/lm32-desc.h \
	eng.h

# List of flags to always pass to $(CC).
#SIM_EXTRA_CFLAGS =

SIM_EXTRA_CLEAN = lm32-clean

# Code doesn't build cleanly yet.
SIM_WERROR_CFLAGS =

## COMMON_POST_CONFIG_FRAG

arch = lm32 

LM32BF_INCLUDE_DEPS = \
	$(CGEN_MAIN_CPU_DEPS) \
	cpu.h decode.h eng.h

# FIXME: Use of `mono' is wip.
mloop.c eng.h: stamp-mloop
stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
	$(ECHO_STAMP) mloop.c eng.h
	$(SILENCE) $(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
		-mono -fast -pbb -switch sem-switch.c \
		-cpu lm32bf -infile $(srcdir)/mloop.in
	$(SILENCE) $(SHELL) $(srcroot)/move-if-change eng.hin eng.h
	$(SILENCE) $(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
	$(SILENCE) touch $@

lm32-clean:
	rm -f mloop.c eng.h stamp-mloop
	rm -f stamp-arch stamp-cpu 
	rm -f tmp-*

stamp-arch: $(CGEN_READ_SCM) $(CGEN_ARCH_SCM) $(CPU_DIR)/lm32.cpu
	$(MAKE) cgen-arch $(CGEN_FLAGS_TO_PASS) mach=all \
	  archfile=$(CPU_DIR)/lm32.cpu \
	  FLAGS="with-scache with-profile=fn"
	$(SILENCE) touch $@
arch.h arch.c cpuall.h: $(CGEN_MAINT) stamp-arch

stamp-cpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CPU_DIR)/lm32.cpu
	$(MAKE) cgen-cpu-decode $(CGEN_FLAGS_TO_PASS) \
	  cpu=lm32bf mach=lm32 SUFFIX= \
	  archfile=$(CPU_DIR)/lm32.cpu \
	  FLAGS="with-scache with-profile=fn" \
	  EXTRAFILES="$(CGEN_CPU_SEM) $(CGEN_CPU_SEMSW)"
	$(SILENCE) touch $@
cpu.h sem.c sem-switch.c model.c decode.c decode.h: $(CGEN_MAINT) stamp-cpu