From 533db96be6c6b97b4bf26203b429f24b2ad56cb4 Mon Sep 17 00:00:00 2001 From: Steve McIntyre Date: Wed, 6 Jun 2018 02:14:55 +0100 Subject: Major Makefile overhauls Add rules to generate the git revs cache in Makefile.common, referenced as $(VCSREVCACHE) Add an extra order-only prerequisite on $(VCSREVCACHE) for ~all rules converting .wml to .html, so that we'll make sure we have a cache built up-front before we start building anything. More factorisation of various year-based Makefiles to use a common Make.year set of rules. --- Makefile.common | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Makefile.common') diff --git a/Makefile.common b/Makefile.common index 9465f000bb4..9f9dfb7b398 100644 --- a/Makefile.common +++ b/Makefile.common @@ -10,6 +10,7 @@ ENGLISHDIR := $(ENGLISHSRCDIR) TEMPLDIR := $(ENGLISHDIR)/template/debian RELHTMLBASE := ../../www HTMLDIR = $(WMLBASE)/$(RELHTMLBASE)/$(CUR_DIR) +VCSREVCACHE = $(WMLBASE)/../.git-revs-cache.db LOCALEDIR := $(WMLBASE)/../locale/$(LANGUAGE)/LC_MESSAGES essential-locale-files := templates countries langs date @@ -90,6 +91,9 @@ cleandest:: $(existing-SUBS-cleandest) $(existing-SUBS-cleandest): -$(MAKE) -C $(patsubst %-cleandest,%,$@) cleandest +$(VCSREVCACHE): $(WMLBASE)/../.git/index + (cd $(WMLBASE)/.. && ./build_vcs_cache.pl) + # the rule for every wml file ifndef NOGENERICDEP @@ -99,7 +103,11 @@ else EXTRAWMLDEP := $(WMLRCDEP) $(GETTEXTDEP) $(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml $(TEMPLDIR)/translation-check.wml endif -%.$(LANGUAGE).html : %.wml $(EXTRAWMLDEP) +# The "| $(VCSREVCACHE)" here is an order-only prerequisite - always +# check that the prerequisite exists and is up to date, but don't +# rebuild everything whenever it's updated - see +# https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html +%.$(LANGUAGE).html : %.wml $(EXTRAWMLDEP) | $(VCSREVCACHE) $(WML) $(