aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-07-02 07:03:13 -0600
committerTom Tromey <tom@tromey.com>2018-07-09 08:03:49 -0600
commit1998086d5436499e8eaf16772e300459662c3d7c (patch)
tree5098b861df9369d030be868b520dbe253df32049 /gdb
parent4c7549492b301d7d118379c3e98afc0b364d1935 (diff)
downloadgdb-1998086d5436499e8eaf16772e300459662c3d7c.zip
gdb-1998086d5436499e8eaf16772e300459662c3d7c.tar.gz
gdb-1998086d5436499e8eaf16772e300459662c3d7c.tar.bz2
Use a stamp file for init.c
This introduces a stamp file for init.c. This prevents constant rebuilds of init.o, by arranging for init.c to only be modified when its contents change. (FWIW this is a standard idiom in use by Automake and by gdb itself for many years.) gdb/ChangeLog 2018-07-09 Tom Tromey <tom@tromey.com> * Makefile.in (init.c): Depend on stamp-init. (stamp-init): New rule, from init.c rule. (clean mostlyclean): Remove stamp-init.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/Makefile.in9
2 files changed, 11 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 93f972b3..7e39800 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-07-09 Tom Tromey <tom@tromey.com>
+ * Makefile.in (init.c): Depend on stamp-init.
+ (stamp-init): New rule, from init.c rule.
+ (clean mostlyclean): Remove stamp-init.
+
+2018-07-09 Tom Tromey <tom@tromey.com>
+
* Makefile.in (INIT_FILES): Remove CONFIG_SRCS,
SUBDIR_GCC_COMPILE_SRCS.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index b35ca2e..d14e867 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1849,7 +1849,8 @@ test-cp-name-parser$(EXEEXT): test-cp-name-parser.o $(LIBIBERTY)
# in sub-directories such as cli/ and mi/.
INIT_FILES = $(COMMON_OBS)
-init.c: $(INIT_FILES)
+init.c: stamp-init; @true
+stamp-init: $(INIT_FILES)
@$(ECHO_INIT_C) echo "Making init.c"
@rm -f init.c-tmp init.l-tmp
@touch init.c-tmp
@@ -1879,8 +1880,8 @@ init.c: $(INIT_FILES)
@echo '{' >>init.c-tmp
@sed -e 's/\(.*\)/ _initialize_\1 ();/' <init.l-tmp >>init.c-tmp
@echo '}' >>init.c-tmp
- @rm init.l-tmp
- @mv init.c-tmp init.c
+ @$(SHELL) $(srcdir)/../move-if-change init.c-tmp init.c
+ @echo stamp > stamp-init
.PRECIOUS: init.c
@@ -1947,7 +1948,7 @@ tags: TAGS
clean mostlyclean: $(CONFIG_CLEAN)
@$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(CLEANDIRS)" subdir_do
rm -f *.o *.a $(ADD_FILES) *~ init.c-tmp init.l-tmp version.c-tmp
- rm -f init.c version.c
+ rm -f init.c stamp-init version.c
rm -f gdb$(EXEEXT) core make.log
rm -f gdb[0-9]$(EXEEXT)
rm -f test-cp-name-parser$(EXEEXT)