tackle delayed front-page problem: force processing order for recursive Make jobs

svn path=/trunk/; revision=35050
This commit is contained in:
2017-02-15 17:30:31 +00:00
parent 7a73de1413
commit 1fd7423d9b
2 changed files with 46 additions and 27 deletions

View File

@@ -6,12 +6,15 @@ all: subdirs localmenus date_today SOURCEUPDATES
# Dive into subdirectories
# -----------------------------------------------------------------------------
SUBDIRS := $(shell find */* -name "Makefile" | xargs --max-args=1 dirname)
SUBDIRS := $(shell find */* -name "Makefile" | xargs dirname)
.PHONY: subdirs $(SUBDIRS)
subdirs: $(SUBDIRS)
# run jobs for tools/ only after events/ and news/ have been completed
tools: | events news
$(SUBDIRS):
$(MAKE) -k -C $@ || true
@@ -54,11 +57,13 @@ d_year.en.xml: d_month.en.xml
grep -q '$(YEAR)' $@ || echo '$(YEAR)' >$@
.PHONY: SOURCEUPDATES
# finish jobs in subdirs before updating .sources
SOURCEUPDATES: | subdirs
SOURCEUPDATES: $(shell find ./ -name '*.sources')
SOURCEREQS = $(shell ./build/source_globber.sh sourceglobs $@ |sed -r 's;$$;.??.xml;g')
SOURCEDIRS = $(shell sed -rn 's;^(.*/)[^/]*:(\[\]|global)$$;\1;gp' $@)
.SECONDEXPANSION:
%.sources: $$(SOURCEREQS)
touch $@
%.sources: $$(SOURCEDIRS)
%.sources: $$(SOURCEDIRS) $$(SOURCEREQS)
touch $@