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 10/10] sim: ppc: move defines.h generation to the top-level
Date: Tue,  2 Jan 2024 00:36:38 -0500	[thread overview]
Message-ID: <20240102053639.28290-10-vapier@gentoo.org> (raw)
In-Reply-To: <20240102053639.28290-1-vapier@gentoo.org>

Since we rely on the top-level config.h now, the defines.h generation
step should live here too.
---
 sim/Makefile.in     | 19 +++++++++++++------
 sim/ppc/Makefile.in | 10 ++--------
 sim/ppc/local.mk    |  9 +++++++++
 3 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 71199fc72ede..2f638b093939 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -489,7 +489,7 @@ PACKAGE_SRC = pk_disklabel.c
 PACKAGE_OBJ = $(PACKAGE_SRC:.c=.o)
 
 
-$(TARGETLIB): tmp-igen tmp-hw tmp-defines $(LIB_OBJ) $(GDB_OBJ)
+$(TARGETLIB): tmp-igen tmp-hw defines.h $(LIB_OBJ) $(GDB_OBJ)
 	$(ECHO_AR) $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
 	$(ECHO_RANLIB) $(RANLIB) $(TARGETLIB)
 
@@ -562,12 +562,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_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' $(srcdir)/options.c
 
-defines.h: tmp-defines; @true
-tmp-defines: Makefile
-	$(ECHO_GEN) sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < ../config.h > tmp-defines.h
-	$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-defines.h defines.h
-	$(SILENCE) touch $@
-
 #
 # Rules to create the built c source code files
 #
@@ -685,7 +679,7 @@ clean mostlyclean:
 	rm -f tmp-* *.[oasi] core $(BUILT_SRC_WO_CONFIG)
 
 distclean realclean: clean
-	rm -f TAGS Makefile config.cache config.status defines.h stamp-h config.log
+	rm -f TAGS Makefile config.cache config.status stamp-h config.log
 
 maintainer-clean: distclean
 	rm -f *~ *.log core *.core
diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk
index 8bcc7e7b9c39..e2d6197f5dd2 100644
--- a/sim/ppc/local.mk
+++ b/sim/ppc/local.mk
@@ -33,6 +33,15 @@ SIM_ALL_RECURSIVE_DEPS += common/libcommon.a
 
 noinst_PROGRAMS += %D%/run
 
+SIM_ALL_RECURSIVE_DEPS += %D%/defines.h
+%D%/defines.h: %D%/stamp-defines ; @true
+%D%/stamp-defines: config.h Makefile
+	$(AM_V_GEN)sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > %D%/defines.hin
+	$(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/defines.hin %D%/defines.h
+	$(AM_V_at)touch $@
+
+MOSTLYCLEANFILES += %D%/defines.h %D%/stamp-defines
+
 %D%/spreg.c: @MAINT@ %D%/ppc-spr-table %D%/spreg-gen.py %D%/$(am__dirstamp)
 	$(AM_V_GEN)$(srcdir)/%D%/spreg-gen.py --source $@.tmp
 	$(AM_V_at)$(SHELL) $(srcroot)/move-if-change $@.tmp $(srcdir)/%D%/spreg.c
-- 
2.43.0


  parent reply	other threads:[~2024-01-02  6:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02  5:36 [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 02/10] sim: ppc: move struct statfs " Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 03/10] sim: ppc: move termio defines to config.h Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 04/10] sim: ppc: switch struct member checks to AC_CHECK_MEMBER Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 05/10] sim: ppc: switch to AC_CACHE_CHECK Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 06/10] sim: ppc: move termios probes to top-level Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 07/10] sim: ppc: stop including headers from gdb/ Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 08/10] sim: ppc: drop custom config.h header Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 09/10] sim: ppc: drop configure compiler checks Mike Frysinger
2024-01-02  5:36 ` Mike Frysinger [this message]
2024-01-09 14:33 ` [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Tom Tromey
2024-01-09 17:50   ` Mike Frysinger
2024-01-09 19:05     ` Tom Tromey

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=20240102053639.28290-10-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).