public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH/submitted 3/3] sim: ppc: hoist pk.h creation to top-level
Date: Tue,  2 Jan 2024 02:25:08 -0500	[thread overview]
Message-ID: <20240102072508.10504-3-vapier@gentoo.org> (raw)
In-Reply-To: <20240102072508.10504-1-vapier@gentoo.org>

---
 sim/Makefile.in     | 22 ++++++++++++++++++++--
 sim/ppc/Makefile.in | 37 +++++--------------------------------
 sim/ppc/local.mk    | 24 ++++++++++++++++++++++++
 sim/ppc/pk.h        |  2 +-
 4 files changed, 50 insertions(+), 35 deletions(-)

diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index ed3185f399d4..68be55597497 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -361,12 +361,6 @@ INLINE = \
 	inline.h \
 	inline.c
 
-BUILT_SRC_WO_CONFIG = \
-	pk.h
-
-BUILT_SRC = \
-	$(BUILT_SRC_WO_CONFIG)
-
 LIB_INLINE_SRC = \
 	psim.c \
 	bits.c \
@@ -483,7 +477,7 @@ interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) $(OS_EMUL_H)
 
 # Given that inlines are turned on now, rebuild idecode whenever
 # anything changes.
-idecode.o: idecode.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(LIB_INLINE_SRC) $(BUILT_SRC)
+idecode.o: idecode.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(LIB_INLINE_SRC)
 
 # double.o: double.c dp-bit.c
 
@@ -525,7 +519,7 @@ sim-fpu.o: $(srcdir)/../common/sim-fpu.c
 	$(ECHO_CC) $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/sim-fpu.c 
 
 # Rebuild options whenever something changes so the date/time is up to date.
-options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) ../config.status Makefile
+options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) ../config.status Makefile
 	$(ECHO_CC) $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_ppc_opcode@"' '-DIGEN_FLAGS="$(ppc_IGEN_FLAGS)"' $(srcdir)/options.c
 
 hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H) $(HW_CPU_H) $(INTERRUPTS_H) $(CPU_H)
@@ -552,27 +546,6 @@ hw_vm.o: hw_vm.c $(DEVICE_TABLE_H) $(CPU_H)
 
 
 
-# real packages
-$(srcdir)/pk.h: $(MAINT) tmp-pk
-	@true
-tmp-pk: $(srcdir)/Makefile.in $(PACKAGE_SRC) $(srcroot)/move-if-change
-	$(ECHO_GEN)# The first for loop is to remove duplicates.
-	$(SILENCE) echo "/* Generated file by Makefile.in; do not edit.  */" > tmp-pk.h; \
-	f=""; \
-	for i in $(PACKAGE_SRC) ; do \
-	  case " $$f " in \
-	    *" $$i "*) ;; \
-	    *) f="$$f $$i" ;; \
-	  esac ; \
-	done ; \
-	for pk in $$f ; do echo $$pk ; done \
-	| sed -e 's/^.*pk_\(.*\)\.c/\1/' \
-		-e 's/^/extern package_create_instance_callback pk_/' \
-		-e 's/$$/_create_instance;/' \
-		>> tmp-pk.h
-	$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-pk.h $(srcdir)/pk.h
-	$(SILENCE) touch $@
-
 pk_disklabel.o: pk_disklabel.c $(DEVICE_TABLE_H) $(PK_H)
 # ignore this line, it stops make from getting confused
 
@@ -580,11 +553,11 @@ pk_disklabel.o: pk_disklabel.c $(DEVICE_TABLE_H) $(PK_H)
 
 tags etags: TAGS
 
-TAGS: $(BUILT_SRC)
-	etags $(srcdir)/*.h $(srcdir)/*.c $(BUILT_SRC)
+TAGS:
+	etags $(srcdir)/*.h $(srcdir)/*.c
 
 clean mostlyclean:
-	rm -f tmp-* *.[oasi] core $(BUILT_SRC_WO_CONFIG)
+	rm -f tmp-* *.[oasi] core
 
 distclean realclean: clean
 	rm -f TAGS Makefile
diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk
index 7d4ea357c30d..155d83a9470a 100644
--- a/sim/ppc/local.mk
+++ b/sim/ppc/local.mk
@@ -220,5 +220,29 @@ BUILT_SOURCES += \
 SIM_ALL_RECURSIVE_DEPS += %D%/stamp-hw
 %D%/hw.c %D%/hw.h: %D%/stamp-igen
 
+## Real packages
+## NB: The first for loop is to remove duplicates.
+%C%_PACKAGE_SRC = %D%/pk_disklabel.c
+$(srcdir)/%D%/pk.h: @MAINT@ %D%/stamp-pk ; @true
+%D%/stamp-pk: $(srcdir)/%D%/Makefile.in $(%C%_PACKAGE_SRC) $(srcroot)/move-if-change
+	$(AM_V_GEN)echo "/* Generated file by local.mk; do not edit.  */" > %D%/pk.hin; \
+	f=""; \
+	for i in $(%C%_PACKAGE_SRC) ; do \
+	  case " $$f " in \
+	    *" $$i "*) ;; \
+	    *) f="$$f $$i" ;; \
+	  esac ; \
+	done ; \
+	for pk in $$f ; do echo $$pk ; done \
+	| sed -e 's/^.*pk_\(.*\)\.c/\1/' \
+		-e 's/^/extern package_create_instance_callback pk_/' \
+		-e 's/$$/_create_instance;/' \
+		>> %D%/pk.hin
+	$(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/pk.hin $(srcdir)/%D%/pk.h
+	$(AM_V_at)touch $@
+
+%C%_BUILD_OUTPUTS += %D%/stamp-pk
+SIM_ALL_RECURSIVE_DEPS += %D%/stamp-pk
+
 %C%docdir = $(docdir)/%C%
 %C%doc_DATA = %D%/BUGS %D%/INSTALL %D%/README %D%/RUN
diff --git a/sim/ppc/pk.h b/sim/ppc/pk.h
index 92e49e9e8a45..2a6720473788 100644
--- a/sim/ppc/pk.h
+++ b/sim/ppc/pk.h
@@ -1,2 +1,2 @@
-/* Generated file by Makefile.in; do not edit.  */
+/* Generated file by local.mk; do not edit.  */
 extern package_create_instance_callback pk_disklabel_create_instance;
-- 
2.43.0


      parent reply	other threads:[~2024-01-02  8:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02  7:25 [PATCH/submitted 1/3] sim: ppc: hoist igen execution " Mike Frysinger
2024-01-02  7:25 ` [PATCH/submitted 2/3] sim: ppc: hoist hw.[ch] creation " Mike Frysinger
2024-01-02  7:25 ` Mike Frysinger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240102072508.10504-3-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).