do the Makefile checking using make itself

This commit is contained in:
nhmall
2023-11-20 22:14:22 -05:00
parent 18962b41d9
commit 4a08f20090
5 changed files with 46 additions and 64 deletions

View File

@@ -1,57 +0,0 @@
# NetHack 3.7 general-pre.370 $NHDT-Date: 1599687610 2020/09/09 21:40:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.11 $
ifdef MAKEFILE_TOP
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(dir $(mkfile_path))
SUPATH :=$(mkfile_dir)sys/unix/
#$(info $(.VARIABLES))
ifeq ($(MAKELEVEL),0)
notified=No
touchquiet=
# Check the placed Makefiles against the time stamp
# of their source in sys/unix, and report if appropriate.
MFCHECKDAT := $(shell [ $(SUPATH)Makefile.dat -nt $(mkfile_dir)dat/Makefile ] \
&& echo "outdated")
MFCHECKSRC := $(shell [ $(SUPATH)Makefile.src -nt $(mkfile_dir)src/Makefile ] \
&& echo "outdated")
MFCHECKUTL := $(shell [ $(SUPATH)Makefile.utl -nt $(mkfile_dir)util/Makefile ] \
&& echo "outdated")
MFCHECKDOC := $(shell [ $(SUPATH)Makefile.doc -nt $(mkfile_dir)doc/Makefile ] \
&& echo "outdated")
MFCHECKTOP := $(shell [ $(SUPATH)Makefile.top -nt $(mkfile_dir)Makefile ] \
&& echo "outdated")
ifeq ($(MFCHECKDAT),outdated)
$(info Attention: ../sys/unix/Makefile.dat is newer than dat/Makefile)
notified=Yes
touchquiet += dat/Makefile
endif
ifeq ($(MFCHECKSRC),outdated)
$(info Attention: ../sys/unix/Makefile.src is newer than src/Makefile)
notified=Yes
touchquiet += src/Makefile
endif
ifeq ($(MFCHECKUTL),outdated)
$(info Attention: ../sys/unix/Makefile.utl is newer than util/Makefile)
notified=Yes
touchquiet += util/Makefile
endif
ifeq ($(MFCHECKDOC),outdated)
$(info Attention: ../sys/unix/Makefile.doc is newer than doc/Makefile)
notified=Yes
touchquiet += doc/Makefile
endif
ifeq ($(MFCHECKTOP),outdated)
$(info Attention: ../sys/unix/Makefile.top is newer than Makefile)
notified=Yes
touchquiet += Makefile
endif
ifeq ("$(notified)","Yes")
$(info You should consider re-executing sys/unix/setup.sh)
ifneq ("$(touchquiet)","")
$(info or to quiet this message: 'touch $(touchquiet)')
endif
$(info )
endif # notified
endif # MAKELEVEL = 0
endif # MAKEFILE_TOP
# --- end of general-post.370