# Makefile for Lattice Mico32 simulator.
|
# Makefile for Lattice Mico32 simulator.
|
# Contributed by Jon Beniston
|
# Contributed by Jon Beniston
|
|
|
## COMMON_PRE_CONFIG_FRAG
|
## COMMON_PRE_CONFIG_FRAG
|
|
|
# List of object files, less common parts.
|
# List of object files, less common parts.
|
SIM_OBJS = \
|
SIM_OBJS = \
|
$(SIM_NEW_COMMON_OBJS) \
|
$(SIM_NEW_COMMON_OBJS) \
|
sim-cpu.o \
|
sim-cpu.o \
|
sim-hload.o \
|
sim-hload.o \
|
sim-hrw.o \
|
sim-hrw.o \
|
sim-model.o \
|
sim-model.o \
|
sim-reg.o \
|
sim-reg.o \
|
sim-signal.o \
|
sim-signal.o \
|
cgen-utils.o cgen-trace.o cgen-scache.o \
|
cgen-utils.o cgen-trace.o cgen-scache.o \
|
cgen-run.o sim-reason.o sim-engine.o sim-stop.o \
|
cgen-run.o sim-reason.o sim-engine.o sim-stop.o \
|
sim-if.o arch.o \
|
sim-if.o arch.o \
|
cpu.o decode.o sem.o model.o mloop.o \
|
cpu.o decode.o sem.o model.o mloop.o \
|
lm32.o traps.o user.o
|
lm32.o traps.o user.o
|
|
|
# List of extra dependencies.
|
# List of extra dependencies.
|
# Generally this consists of simulator specific files included by sim-main.h.
|
# Generally this consists of simulator specific files included by sim-main.h.
|
SIM_EXTRA_DEPS = $(CGEN_INCLUDE_DEPS) $(srcdir)/../../opcodes/lm32-desc.h
|
SIM_EXTRA_DEPS = $(CGEN_INCLUDE_DEPS) $(srcdir)/../../opcodes/lm32-desc.h
|
|
|
# List of flags to always pass to $(CC).
|
# List of flags to always pass to $(CC).
|
#SIM_EXTRA_CFLAGS =
|
#SIM_EXTRA_CFLAGS =
|
|
|
# List of main object files for `run'.
|
# List of main object files for `run'.
|
SIM_RUN_OBJS = nrun.o
|
SIM_RUN_OBJS = nrun.o
|
|
|
SIM_EXTRA_CLEAN = lm32-clean
|
SIM_EXTRA_CLEAN = lm32-clean
|
|
|
# This selects the lm32 newlib/libgloss syscall definitions.
|
# This selects the lm32 newlib/libgloss syscall definitions.
|
NL_TARGET = -DNL_TARGET_lm32
|
NL_TARGET = -DNL_TARGET_lm32
|
|
|
## COMMON_POST_CONFIG_FRAG
|
## COMMON_POST_CONFIG_FRAG
|
|
|
arch = lm32
|
arch = lm32
|
|
|
arch.o: arch.c $(SIM_MAIN_DEPS)
|
arch.o: arch.c $(SIM_MAIN_DEPS)
|
|
|
traps.o: traps.c targ-vals.h $(SIM_MAIN_DEPS)
|
traps.o: traps.c targ-vals.h $(SIM_MAIN_DEPS)
|
|
|
sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h
|
sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h
|
|
|
LM32BF_INCLUDE_DEPS = \
|
LM32BF_INCLUDE_DEPS = \
|
$(CGEN_MAIN_CPU_DEPS) \
|
$(CGEN_MAIN_CPU_DEPS) \
|
cpu.h decode.h eng.h
|
cpu.h decode.h eng.h
|
|
|
lm32.o: lm32.c $(LM32BF_INCLUDE_DEPS)
|
lm32.o: lm32.c $(LM32BF_INCLUDE_DEPS)
|
|
|
# FIXME: Use of `mono' is wip.
|
# FIXME: Use of `mono' is wip.
|
mloop.c eng.h: stamp-mloop
|
mloop.c eng.h: stamp-mloop
|
stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
|
stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
|
$(SHELL) $(srccom)/genmloop.sh \
|
$(SHELL) $(srccom)/genmloop.sh \
|
-mono -fast -pbb -switch sem-switch.c \
|
-mono -fast -pbb -switch sem-switch.c \
|
-cpu lm32bf -infile $(srcdir)/mloop.in
|
-cpu lm32bf -infile $(srcdir)/mloop.in
|
$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
|
$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
|
$(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
|
$(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
|
touch stamp-mloop
|
touch stamp-mloop
|
mloop.o: mloop.c sem-switch.c
|
mloop.o: mloop.c sem-switch.c
|
|
|
cpu.o: cpu.c $(LM32BF_INCLUDE_DEPS)
|
cpu.o: cpu.c $(LM32BF_INCLUDE_DEPS)
|
decode.o: decode.c $(LM32BF_INCLUDE_DEPS)
|
decode.o: decode.c $(LM32BF_INCLUDE_DEPS)
|
sem.o: sem.c $(LM32BF_INCLUDE_DEPS)
|
sem.o: sem.c $(LM32BF_INCLUDE_DEPS)
|
model.o: model.c $(LM32BF_INCLUDE_DEPS)
|
model.o: model.c $(LM32BF_INCLUDE_DEPS)
|
|
|
lm32-clean:
|
lm32-clean:
|
rm -f mloop.c eng.h stamp-mloop
|
rm -f mloop.c eng.h stamp-mloop
|
rm -f stamp-arch stamp-cpu
|
rm -f stamp-arch stamp-cpu
|
rm -f tmp-*
|
rm -f tmp-*
|
|
|
# cgen support, enable with --enable-cgen-maint
|
# cgen support, enable with --enable-cgen-maint
|
CGEN_MAINT = ; @true
|
CGEN_MAINT = ; @true
|
# The following line is commented in or out depending upon --enable-cgen-maint.
|
# The following line is commented in or out depending upon --enable-cgen-maint.
|
@CGEN_MAINT@CGEN_MAINT =
|
@CGEN_MAINT@CGEN_MAINT =
|
|
|
stamp-arch: $(CGEN_READ_SCM) $(CGEN_ARCH_SCM) $(CPU_DIR)/lm32.cpu
|
stamp-arch: $(CGEN_READ_SCM) $(CGEN_ARCH_SCM) $(CPU_DIR)/lm32.cpu
|
$(MAKE) cgen-arch $(CGEN_FLAGS_TO_PASS) mach=all \
|
$(MAKE) cgen-arch $(CGEN_FLAGS_TO_PASS) mach=all \
|
archfile=$(CPU_DIR)/lm32.cpu \
|
archfile=$(CPU_DIR)/lm32.cpu \
|
FLAGS="with-scache with-profile=fn"
|
FLAGS="with-scache with-profile=fn"
|
touch stamp-arch
|
touch stamp-arch
|
arch.h arch.c cpuall.h: $(CGEN_MAINT) stamp-arch
|
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
|
stamp-cpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CPU_DIR)/lm32.cpu
|
$(MAKE) cgen-cpu-decode $(CGEN_FLAGS_TO_PASS) \
|
$(MAKE) cgen-cpu-decode $(CGEN_FLAGS_TO_PASS) \
|
cpu=lm32bf mach=lm32 SUFFIX= \
|
cpu=lm32bf mach=lm32 SUFFIX= \
|
archfile=$(CPU_DIR)/lm32.cpu \
|
archfile=$(CPU_DIR)/lm32.cpu \
|
FLAGS="with-scache with-profile=fn" \
|
FLAGS="with-scache with-profile=fn" \
|
EXTRAFILES="$(CGEN_CPU_SEM) $(CGEN_CPU_SEMSW)"
|
EXTRAFILES="$(CGEN_CPU_SEM) $(CGEN_CPU_SEMSW)"
|
touch stamp-cpu
|
touch stamp-cpu
|
cpu.h sem.c sem-switch.c model.c decode.c decode.h: $(CGEN_MAINT) stamp-cpu
|
cpu.h sem.c sem-switch.c model.c decode.c decode.h: $(CGEN_MAINT) stamp-cpu
|
|
|