commit 968c07fc8186092a1b06dc7efaeee96426798b67
parent 858e75e4cfe0beb0711acfe9fee7519162434b15
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Tue, 9 May 2017 14:49:21 +0200
build: use the "force" mechanism to always run the revision rule
Whenever 'make' is run, it should check whether the revision has
changed, and if so, it should update src/revision.h.
This portable FORCE mechanism should have been the replacement for
the phony target that was removed in a33a4f00, five commits ago.
This fixes https://savannah.gnu.org/bugs/?50956 in a better way.
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
@@ -12,10 +12,13 @@ endif
nano.o: revision.h
winio.o: revision.h
-revision.h:
+# Always run the commands in this rule. But update the target
+# only when the revision actually changed.
+revision.h: FORCE
@[ -f $@ ] || touch $@
@echo "#define $(SOMETHING)" | cmp -s $@ - || \
- echo "#define $(SOMETHING)" > $@
+ echo "#define $(SOMETHING)" > $@
+FORCE:
bin_PROGRAMS = nano
nano_SOURCES = browser.c \