diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 37 |
1 files changed, 23 insertions, 14 deletions
@@ -10,9 +10,9 @@ ezcodes := $(shell \ # Source files that aren’t dynamically generated sources := \ - $(shell find src -type f -name 'index.gsp') \ - $(shell find src -type f -name '*.css') \ - $(shell find src -type f -name '*.svg') \ + $(shell find src -type f -name 'index.gsp') $(copysrc) \ + $(shell find src -type f -name '*.css') \ + $(shell find src -type f -name '*.svg') \ $(shell find src -type f -name '*.woff2') # Different euro coin and -banknote page types @@ -43,11 +43,21 @@ eurotndeps := src/euro/index.tnotes.gsp src/euro/nav.dnotes.gsp data/notes # Macro to get a countries demonym from their country code demonym = $(shell awk '$$1 == toupper("$1") { print $$2 }' data/country-info) +# Macros to handle dependencies for world pages +wpath = $(if $(filter $2,o),\ + out/world/$(if $(filter $2,c),coins,notes)/$1/index.html,\ + src/world/$(if $(filter $2,c),coins,notes)/$1/index.gsp\ +) +wout = $(foreach x,$1,$(call wpath,$x,o $2)) +_wdeps = $(wildcard data/world/*.$(if $(filter $1,br),bra,$1)) +wdeps = $(call wpath,$1,$2) $(call _wdeps,$1) $(gspdeps) + all: $(outdirs) $(outputs) $(outdirs)&: mkdir -p $(outdirs) +$(call wout,ez): $(call wdeps,ez) out/%.html: src/%.gsp $(gspdeps) m4 -P lib.m4 $< | gsp >$@ @@ -55,24 +65,23 @@ $(eurocc): out/euro/%/index.html: $(gspdeps) $(euroccdeps) m4 -P -D__coins -D__code=$* -D__demonym=$(call demonym,$*) \ lib.m4 src/euro/index.ccoins.gsp | gsp >$@ -$(eurocd): out/euro/%/index.html: $(gspdeps) $(eurocddeps) - m4 -P -D__coins -D__denom=$* lib.m4 src/euro/index.dcoins.gsp | gsp >$@ - -$(eurond): out/euro/%/index.html: $(gspdeps) $(euronddeps) - m4 -P -D__notes -D__denom=$* lib.m4 src/euro/index.dnotes.gsp | gsp >$@ +$(eurocd): $(eurocddeps) $(gspdeps) +$(eurond): $(euronddeps) $(gspdeps) +$(eurocd) $(eurond): out/euro/%/index.html: + m4 -P -D__notes -D__denom=$* lib.m4 $< | gsp >$@ -$(euront): out/euro/%/index.html: $(gspdeps) $(eurotndeps) - m4 -P -D__notes lib.m4 src/euro/index.tnotes.gsp | gsp >$@ +$(euront): out/euro/%/index.html: $(eurotndeps) $(gspdeps) + m4 -P -D__notes lib.m4 $< | gsp >$@ -out/world/coins/br/index.html: src/world/coins/br/index.gsp $(gspdeps) - m4 -P -D__coins lib.m4 src/world/coins/br/index.gsp | gsp >$@ +$(call wout,br,c): $(call wdeps,br,c) +$(call wout,us,c): $(call wdeps,us,c) +$(call wout,br us,c): + m4 -P -D__coins lib.m4 $< | gsp >$@ out/%.css: src/%.css cp $< $@ - out/%.svg: src/%.svg cp $< $@ - out/%.woff2: src/%.woff2 cp $< $@ |