[2/3] sim: build: hoist lists of hw devices up
Commit Message
We need these in the top-level to generate libsim.a, but also in the
subdirs to generate hw-config.h. Move it to the local.mk, and pass
it down when running recursive make. This avoids duplication, and
makes it available to both. We can simplify this once we move the
various steps up to the top-level too.
---
sim/Makefile.in | 198 +++++++++++++++++++++++---------------
sim/bfin/Makefile.in | 35 +------
sim/bfin/local.mk | 34 +++++++
sim/common/Make-common.in | 2 +-
sim/cris/Makefile.in | 6 +-
sim/cris/local.mk | 3 +
sim/lm32/Makefile.in | 6 +-
sim/lm32/local.mk | 3 +
sim/m32r/Makefile.in | 6 +-
sim/m32r/local.mk | 3 +
sim/m68hc11/Makefile.in | 4 +-
sim/m68hc11/local.mk | 3 +
sim/mips/Makefile.in | 4 +-
sim/mips/local.mk | 3 +
sim/mn10300/Makefile.in | 4 +-
sim/mn10300/local.mk | 3 +
16 files changed, 190 insertions(+), 127 deletions(-)
@@ -17,6 +17,8 @@
## COMMON_PRE_CONFIG_FRAG
+arch = bfin
+
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
bfin-sim.o \
@@ -26,39 +28,6 @@ SIM_OBJS = \
machs.o \
sim-resume.o
-SIM_EXTRA_HW_DEVICES = \
- bfin_cec \
- bfin_ctimer \
- bfin_dma \
- bfin_dmac \
- bfin_ebiu_amc \
- bfin_ebiu_ddrc \
- bfin_ebiu_sdc \
- bfin_emac \
- bfin_eppi \
- bfin_evt \
- bfin_gpio \
- bfin_gpio2 \
- bfin_gptimer \
- bfin_jtag \
- bfin_mmu \
- bfin_nfc \
- bfin_otp \
- bfin_pfmon \
- bfin_pint \
- bfin_pll \
- bfin_ppi \
- bfin_rtc \
- bfin_sic \
- bfin_spi \
- bfin_trace \
- bfin_twi \
- bfin_uart \
- bfin_uart2 \
- bfin_wdog \
- bfin_wp \
- eth_phy
-
SIM_EXTRA_CFLAGS = $(SDL_CFLAGS)
## COMMON_POST_CONFIG_FRAG
@@ -24,6 +24,40 @@
noinst_PROGRAMS += %D%/run
+%C%_SIM_EXTRA_HW_DEVICES = \
+ bfin_cec \
+ bfin_ctimer \
+ bfin_dma \
+ bfin_dmac \
+ bfin_ebiu_amc \
+ bfin_ebiu_ddrc \
+ bfin_ebiu_sdc \
+ bfin_emac \
+ bfin_eppi \
+ bfin_evt \
+ bfin_gpio \
+ bfin_gpio2 \
+ bfin_gptimer \
+ bfin_jtag \
+ bfin_mmu \
+ bfin_nfc \
+ bfin_otp \
+ bfin_pfmon \
+ bfin_pint \
+ bfin_pll \
+ bfin_ppi \
+ bfin_rtc \
+ bfin_sic \
+ bfin_spi \
+ bfin_trace \
+ bfin_twi \
+ bfin_uart \
+ bfin_uart2 \
+ bfin_wdog \
+ bfin_wp \
+ eth_phy
+AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
+
%D%/linux-fixed-code.h: @MAINT@ $(srcdir)/%D%/linux-fixed-code.s %D%/local.mk %D%/$(am__dirstamp)
$(AM_V_GEN)$(AS_FOR_TARGET_BFIN) $(srcdir)/%D%/linux-fixed-code.s -o %D%/linux-fixed-code.o
$(AM_V_at)(\
@@ -136,7 +136,7 @@ BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(CSEARCH)
COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(SIM_EXTRA_CFLAGS)
-SIM_HW_DEVICES = $(SIM_HW_DEVICES_) $(SIM_EXTRA_HW_DEVICES)
+SIM_HW_DEVICES = $(SIM_HW_DEVICES_) $($(arch)_SIM_EXTRA_HW_DEVICES)
SIM_NEW_COMMON_OBJS = $(SIM_NEW_COMMON_OBJS_) $(SIM_HW_OBJS)
LIBIBERTY_LIB = ../../libiberty/libiberty.a
@@ -19,6 +19,8 @@
## COMMON_PRE_CONFIG_FRAG
+arch = cris
+
CRISV10F_OBJS = crisv10f.o cpuv10.o decodev10.o modelv10.o mloopv10f.o
CRISV32F_OBJS = crisv32f.o cpuv32.o decodev32.o modelv32.o mloopv32f.o
@@ -31,14 +33,10 @@ SIM_OBJS = \
$(CRISV32F_OBJS) \
traps.o
-SIM_EXTRA_HW_DEVICES = rv cris cris_900000xx
-
SIM_EXTRA_CLEAN = cris-clean
## COMMON_POST_CONFIG_FRAG
-arch = cris
-
cris-clean:
-rm -f stamp-arch
-rm -f tmp-*
@@ -24,6 +24,9 @@
noinst_PROGRAMS += %D%/run
+%C%_SIM_EXTRA_HW_DEVICES = rv cris cris_900000xx
+AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
+
## rvdummy is just used for testing -- it runs on the same host as `run`.
## It does nothing if --enable-sim-hardware isn't active.
%C%_rvdummy_SOURCES = %D%/rvdummy.c
@@ -3,6 +3,8 @@
## COMMON_PRE_CONFIG_FRAG
+arch = lm32
+
# List of object files, less common parts.
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
@@ -12,14 +14,10 @@ SIM_OBJS = \
cpu.o decode.o sem.o model.o mloop.o \
lm32.o traps.o user.o
-SIM_EXTRA_HW_DEVICES = lm32cpu lm32timer lm32uart
-
SIM_EXTRA_CLEAN = lm32-clean
## COMMON_POST_CONFIG_FRAG
-arch = lm32
-
lm32-clean:
rm -f stamp-arch stamp-cpu
rm -f tmp-*
@@ -24,6 +24,9 @@
noinst_PROGRAMS += %D%/run
+%C%_SIM_EXTRA_HW_DEVICES = lm32cpu lm32timer lm32uart
+AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
+
%C%_BUILD_OUTPUTS = \
%D%/eng.h \
%D%/mloop.c \
@@ -19,6 +19,8 @@
## COMMON_PRE_CONFIG_FRAG
+arch = m32r
+
M32R_OBJS = m32r.o cpu.o decode.o sem.o model.o mloop.o
M32RX_OBJS = m32rx.o cpux.o decodex.o modelx.o mloopx.o
M32R2_OBJS = m32r2.o cpu2.o decode2.o model2.o mloop2.o
@@ -33,8 +35,6 @@ SIM_OBJS = \
$(M32R2_OBJS) \
traps.o
-SIM_EXTRA_HW_DEVICES = m32r_cache m32r_uart
-
SIM_EXTRA_CLEAN = m32r-clean
# Some modules don't build cleanly yet.
@@ -42,8 +42,6 @@ cpu.o cpu2.o cpux.o m32r.o m32r2.o m32rx.o mloop.o mloop2.o mloopx.o sem.o sim-i
## COMMON_POST_CONFIG_FRAG
-arch = m32r
-
m32r-clean:
rm -f stamp-arch stamp-cpu stamp-xcpu stamp-2cpu
rm -f tmp-*
@@ -24,6 +24,9 @@
noinst_PROGRAMS += %D%/run
+%C%_SIM_EXTRA_HW_DEVICES = m32r_cache m32r_uart
+AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
+
%C%_BUILD_OUTPUTS = \
%D%/eng.h \
%D%/mloop.c \
@@ -17,6 +17,8 @@
## COMMON_PRE_CONFIG_FRAG
+arch = m68hc11
+
M68HC11_OBJS = interp.o m68hc11int.o m68hc12int.o \
emulos.o interrupts.o m68hc11_sim.o
@@ -24,8 +26,6 @@ SIM_OBJS = $(M68HC11_OBJS) \
$(SIM_NEW_COMMON_OBJS) \
sim-resume.o
-SIM_EXTRA_HW_DEVICES = m68hc11 m68hc11sio m68hc11eepr m68hc11tim m68hc11spi nvram
-
# We must use 32-bit addresses to support memory bank switching.
# The WORD_BITSIZE is normally 16 but must be switched (temporarily)
# to 32 to avoid a bug in the sim-common which uses 'unsigned_word'
@@ -24,6 +24,9 @@
noinst_PROGRAMS += %D%/run
+%C%_SIM_EXTRA_HW_DEVICES = m68hc11 m68hc11sio m68hc11eepr m68hc11tim m68hc11spi nvram
+AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
+
%C%_BUILD_OUTPUTS = \
%D%/gencode$(EXEEXT) \
%D%/m68hc11int.c \
@@ -3,6 +3,8 @@
## COMMON_PRE_CONFIG_FRAG
+arch = mips
+
# Object files created by various simulator generators.
@@ -64,8 +66,6 @@ SIM_OBJS = \
sim-main.o \
sim-resume.o \
-SIM_EXTRA_HW_DEVICES = tx3904cpu tx3904irc tx3904tmr tx3904sio
-
# List of flags to always pass to $(CC).
SIM_SUBTARGET=@SIM_SUBTARGET@
SIM_EXTRA_CFLAGS = $(SIM_SUBTARGET)
@@ -23,3 +23,6 @@
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
+
+%C%_SIM_EXTRA_HW_DEVICES = tx3904cpu tx3904irc tx3904tmr tx3904sio
+AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
@@ -17,6 +17,8 @@
## COMMON_PRE_CONFIG_FRAG
+arch = mn10300
+
MN10300_OBJS = \
itable.o semantics.o idecode.o icache.o engine.o irun.o support.o \
$(SIM_NEW_COMMON_OBJS) \
@@ -25,8 +27,6 @@ MN10300_OBJS = \
SIM_OBJS = $(MN10300_OBJS) interp.o
-SIM_EXTRA_HW_DEVICES = mn103cpu mn103int mn103tim mn103ser mn103iop
-
# List of extra flags to always pass to $(CC).
SIM_EXTRA_CFLAGS = \
-DPOLL_QUIT_INTERVAL=0x20 \
@@ -24,6 +24,9 @@
noinst_PROGRAMS += %D%/run
+%C%_SIM_EXTRA_HW_DEVICES = mn103cpu mn103int mn103tim mn103ser mn103iop
+AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
+
%C%_BUILT_SRC_FROM_IGEN = \
%D%/icache.h \
%D%/icache.c \