aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2024-01-02 02:11:11 -0500
committerMike Frysinger <vapier@gentoo.org>2024-01-02 02:19:50 -0500
commit10f554512f768ce4af44fcdc82bb48356025c363 (patch)
tree2c329f774378973ea5a9aa2087edf45f8e82bc2c /sim/ppc
parent431d8a2ca40e21b1f0ff61b6283e57fe32e12168 (diff)
downloadgdb-10f554512f768ce4af44fcdc82bb48356025c363.zip
gdb-10f554512f768ce4af44fcdc82bb48356025c363.tar.gz
gdb-10f554512f768ce4af44fcdc82bb48356025c363.tar.bz2
sim: ppc: hoist hw.[ch] creation to top-level
Diffstat (limited to 'sim/ppc')
-rw-r--r--sim/ppc/Makefile.in37
-rw-r--r--sim/ppc/local.mk43
2 files changed, 45 insertions, 35 deletions
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 5717ddc..ed3185f 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -362,8 +362,7 @@ INLINE = \
inline.c
BUILT_SRC_WO_CONFIG = \
- pk.h \
- hw.h hw.c
+ pk.h
BUILT_SRC = \
$(BUILT_SRC_WO_CONFIG)
@@ -456,7 +455,7 @@ PACKAGE_SRC = pk_disklabel.c
PACKAGE_OBJ = $(PACKAGE_SRC:.c=.o)
-$(TARGETLIB): tmp-hw defines.h $(LIB_OBJ) $(GDB_OBJ)
+$(TARGETLIB): defines.h $(LIB_OBJ) $(GDB_OBJ)
$(ECHO_AR) $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
$(ECHO_RANLIB) $(RANLIB) $(TARGETLIB)
@@ -529,38 +528,6 @@ sim-fpu.o: $(srcdir)/../common/sim-fpu.c
options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) ../config.status Makefile
$(ECHO_CC) $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_ppc_opcode@"' '-DIGEN_FLAGS="$(ppc_IGEN_FLAGS)"' $(srcdir)/options.c
-# real hardware
-hw.c hw.h: tmp-hw; @true
-tmp-hw: Makefile $(HW_SRC) $(srcroot)/move-if-change
- $(ECHO_GEN)# The first for loop is to remove duplicates.
- $(SILENCE) f=""; \
- for i in $(HW_SRC) ; do \
- case " $$f " in \
- *" $$i "*) ;; \
- *) f="$$f $$i" ;; \
- esac ; \
- done ; \
- for hw in $$f ; do echo $$hw ; done \
- | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
- -e 's/^/extern const device_descriptor /' \
- -e 's/$$/_device_descriptor\[\];/' \
- > tmp-hw.h
- $(SILENCE) f=""; \
- for i in $(HW_SRC) ; do \
- case " $$f " in \
- *" $$i "*) ;; \
- *) f="$$f $$i" ;; \
- esac ; \
- done ; \
- for hw in $$f ; do echo $$hw ; done \
- | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
- -e 's/^/ /' \
- -e 's/$$/_device_descriptor,/' \
- > tmp-hw.c
- $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-hw.h hw.h
- $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-hw.c hw.c
- $(SILENCE) touch $@
-
hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H) $(HW_CPU_H) $(INTERRUPTS_H) $(CPU_H)
hw_com.o: hw_com.c $(DEVICE_TABLE_H)
hw_core.o: hw_core.c $(DEVICE_TABLE_H) $(COREFILE_H)
diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk
index 8b5a165..7d4ea35 100644
--- a/sim/ppc/local.mk
+++ b/sim/ppc/local.mk
@@ -177,5 +177,48 @@ MOSTLYCLEANFILES += $(%C%_IGEN_TOOLS) %D%/libigen.a
IGEN_OPCODE_RULES = @sim_ppc_opcode@
+## Real hardware.
+## NB: The first for loop is to remove duplicates.
+%C%_HW_SRC = $(sim_ppc_hw_src:%=%D%/%)
+%D%/hw.c %D%/hw.h: %D%/stamp-hw ; @true
+%D%/stamp-hw: Makefile $(%C%_HW_SRC) $(srcroot)/move-if-change
+ $(AM_V_GEN)\
+ f=""; \
+ for i in $(%C%_HW_SRC) ; do \
+ case " $$f " in \
+ *" $$i "*) ;; \
+ *) f="$$f $$i" ;; \
+ esac ; \
+ done ; \
+ for hw in $$f ; do echo $$hw ; done \
+ | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
+ -e 's/^/extern const device_descriptor /' \
+ -e 's/$$/_device_descriptor\[\];/' \
+ > %D%/hw.hin; \
+ f=""; \
+ for i in $(%C%_HW_SRC) ; do \
+ case " $$f " in \
+ *" $$i "*) ;; \
+ *) f="$$f $$i" ;; \
+ esac ; \
+ done ; \
+ for hw in $$f ; do echo $$hw ; done \
+ | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
+ -e 's/^/ /' \
+ -e 's/$$/_device_descriptor,/' \
+ > %D%/hw.cin
+ $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/hw.hin %D%/hw.h
+ $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/hw.cin %D%/hw.c
+ $(AM_V_at)touch $@
+
+BUILT_SOURCES += \
+ %D%/hw.h
+%C%_BUILD_OUTPUTS += \
+ %D%/hw.c \
+ %D%/hw.h \
+ %D%/stamp-hw
+SIM_ALL_RECURSIVE_DEPS += %D%/stamp-hw
+%D%/hw.c %D%/hw.h: %D%/stamp-igen
+
%C%docdir = $(docdir)/%C%
%C%doc_DATA = %D%/BUGS %D%/INSTALL %D%/README %D%/RUN