aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-04-22 19:51:54 -0600
committerTom Tromey <tom@tromey.com>2021-04-22 19:51:54 -0600
commitb396d3a16efd205e4adceec4fe39153a1196a15a (patch)
treed393acde622600855f0b6c519c21c96bd576c0eb
parentbe866656a017ef667a775f89f95b96e36f9738ab (diff)
downloadgdb-b396d3a16efd205e4adceec4fe39153a1196a15a.zip
gdb-b396d3a16efd205e4adceec4fe39153a1196a15a.tar.gz
gdb-b396d3a16efd205e4adceec4fe39153a1196a15a.tar.bz2
Introduce stamp file for hw-config.h
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". sim/common/ChangeLog 2021-04-22 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.
-rw-r--r--sim/common/ChangeLog6
-rw-r--r--sim/common/Make-common.in7
2 files changed, 11 insertions, 2 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 42b0266..f4225f9 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,11 @@
2021-04-22 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.
+
+2021-04-22 Tom Tromey <tom@tromey.com>
+
* Make-common.in (mostlyclean): Now an alias for clean, not
distclean.
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 3d3aaf1..ed3b171 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -437,7 +437,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)"; \
@@ -451,7 +452,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) \
@@ -506,6 +508,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) ; \