public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 02/10] Introduce stamp file for hw-config.h
Date: Thu,  8 Apr 2021 14:33:04 -0600	[thread overview]
Message-ID: <20210408203312.2938165-3-tom@tromey.com> (raw)
In-Reply-To: <20210408203312.2938165-1-tom@tromey.com>

This adds a stamp file for hw-config.h, to avoid unnecessary rebuilds.
It also arranges to remove hw-config.h in "mostlyclean", because the
file is created by "make".

2021-04-08  Tom Tromey  <tom@tromey.com>

	* Make-common.in (stamp-hw): New target.
	(hw-config.h): Depend on stamp-hw.
	(mostlyclean): Remove stamp-hw and hw-config.h.
---
 sim/common/ChangeLog      | 6 ++++++
 sim/common/Make-common.in | 7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 34e8d5c5298..f1ebc5e30c7 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -438,7 +438,8 @@ $(all_object_files) : $(generated_files)
 @GMAKE_TRUE@-include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files))
 
 # FIXME This is one very simple-minded way of generating the file hw-config.h
-hw-config.h: Makefile.in $(srccom)/Make-common.in config.status Makefile
+hw-config.h: stamp-hw ; @true
+stamp-hw: Makefile.in $(srccom)/Make-common.in config.status Makefile
 	rm -f tmp-hw.h
 	echo "/* generated by Makefile */" > tmp-hw.h
 	sim_hw="$(SIM_HW)"; \
@@ -452,7 +453,8 @@ hw-config.h: Makefile.in $(srccom)/Make-common.in config.status Makefile
 	done >> tmp-hw.h
 	echo "  NULL," >> tmp-hw.h
 	echo "};" >> tmp-hw.h
-	mv tmp-hw.h hw-config.h
+	$(SHELL) $(srcroot)/move-if-change tmp-hw.h hw-config.h
+	@echo stamp > stamp-hw
 
 test-hw-events: $(srccom)/hw-events.c libsim.a
 	$(CC) $(ALL_CFLAGS) -DMAIN -o test-hw-events$(EXEEXT) \
@@ -507,6 +509,7 @@ TAGS: force
 mostlyclean clean: $(SIM_EXTRA_CLEAN)
 	rm -f *.[oa] *~ core
 	rm -f run$(EXEEXT) libsim.a
+	rm -f hw-config.h stamp-hw
 	rm -f gentmap targ-map.c targ-vals.h stamp-tvals
 	if [ ! -f Make-common.in ] ; then \
 		rm -f $(BUILT_SRC_FROM_COMMON) ; \
-- 
2.26.2


  parent reply	other threads:[~2021-04-08 20:33 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08 20:33 [PATCH 00/10] sim build improvements Tom Tromey
2021-04-08 20:33 ` [PATCH 01/10] Make mostlyclean an alias for clean Tom Tromey
2021-04-09  0:25   ` Mike Frysinger
2021-04-08 20:33 ` Tom Tromey [this message]
2021-04-09  0:25   ` [PATCH 02/10] Introduce stamp file for hw-config.h Mike Frysinger
2021-04-08 20:33 ` [PATCH 03/10] Add stamp files for generated files in sim/ppc Tom Tromey
2021-04-09  0:25   ` Mike Frysinger
2021-04-08 20:33 ` [PATCH 04/10] Require GNU make Tom Tromey
2021-04-09  0:31   ` Mike Frysinger
2021-04-09 17:18     ` Tom Tromey
2021-04-09 22:45       ` Mike Frysinger
2021-04-21 23:14         ` Tom Tromey
2021-04-22  3:17           ` Mike Frysinger
2021-04-22 14:14             ` Tom Tromey
2021-04-08 20:33 ` [PATCH 05/10] Remove and modernize dependencies in sim Tom Tromey
2021-04-11 17:50   ` Mike Frysinger
2021-04-22 14:15     ` Tom Tromey
2021-04-23  0:44       ` Mike Frysinger
2021-04-08 20:33 ` [PATCH 06/10] Remove INCLUDE variable from some sim Makefiles Tom Tromey
2021-04-09  0:27   ` Mike Frysinger
2021-04-08 20:33 ` [PATCH 07/10] Remove LIBS from two " Tom Tromey
2021-04-09  0:27   ` Mike Frysinger
2021-04-08 20:33 ` [PATCH 08/10] Define autoconf substitution variables early in Make-common.in Tom Tromey
2021-04-09  0:44   ` Mike Frysinger
2021-04-08 20:33 ` [PATCH 09/10] Use prologue and epilogue Makefile fragments Tom Tromey
2021-04-08 20:33 ` [PATCH 10/10] Do not check for sys/time.h or sys/times.h Tom Tromey
2021-04-09  0:35   ` Mike Frysinger
2021-04-09 17:18     ` Tom Tromey
2021-04-09  0:26 ` [PATCH 00/10] sim build improvements Mike Frysinger
2021-04-09 17:14   ` Tom Tromey
2021-04-09 22:27     ` Mike Frysinger

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=20210408203312.2938165-3-tom@tromey.com \
    --to=tom@tromey.com \
    --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).