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.
master
Benno Schulenberg 2017-05-09 14:49:21 +02:00
parent 858e75e4cf
commit 968c07fc81
1 changed files with 5 additions and 2 deletions

View File

@ -12,10 +12,13 @@ endif
nano.o: revision.h nano.o: revision.h
winio.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 $@ @[ -f $@ ] || touch $@
@echo "#define $(SOMETHING)" | cmp -s $@ - || \ @echo "#define $(SOMETHING)" | cmp -s $@ - || \
echo "#define $(SOMETHING)" > $@ echo "#define $(SOMETHING)" > $@
FORCE:
bin_PROGRAMS = nano bin_PROGRAMS = nano
nano_SOURCES = browser.c \ nano_SOURCES = browser.c \