diff options
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/GNUmakefile b/GNUmakefile index 1537cde..6807748 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -11,11 +11,12 @@ 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 '*.woff2') +sources := $(shell find src -type f \( \ + -name 'index.gsp' -or \ + -name '*.css' -or \ + -name '*.svg' -or \ + -name '*.woff2' \ +\)) # Different euro coin and -banknote page types eurocc := $(ezcodes:%=out/euro/%/index.html) @@ -37,13 +38,15 @@ gspdeps := lib.m4 src/nav.gsp src/head.gsp src/foot.gsp src/table-key.gsp # Dependencies for certain /euro files euroxyzdeps := src/euro/index.xyz.gsp src/euro/nav.xyz.gsp data/country-info -euroccdeps := $(subst xyz,ccoins,$(euroxyzdeps)) data/coins data/ccs data/errors +euroccdeps := $(subst xyz,ccoins,$(euroxyzdeps)) data/coins data/ccs data/extras eurocddeps := $(subst xyz,dcoins,$(euroxyzdeps)) data/coins euronddeps := $(subst xyz,dnotes,$(euroxyzdeps)) data/notes data/note-info 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 get data to pass to m4 +altnames = $(shell awk 'BEGIN { FS = "\t" } $$1 == toupper("$1") { print $$4 }' data/country-info) +demonym = $(shell awk 'BEGIN { FS = "\t" } $$1 == toupper("$1") { print $$2 }' data/country-info) +percentage = $(shell ./scripts/gen-stats $1) # Macros to handle dependencies for world pages wpath = $(if $(filter $2,o),\ @@ -64,7 +67,10 @@ out/%.html: src/%.gsp $(gspdeps) m4 -P lib.m4 $< | gsp >$@ $(eurocc): out/euro/%/index.html: $(gspdeps) $(euroccdeps) - m4 -P -D__coins -D__code=$* -D__demonym=$(call demonym,$*) \ + m4 -P -D__coins -D__code=$* \ + -D__demonym="$(call demonym,$*)" \ + -D__altnames="$(call altnames,$*)" \ + -D__percentage="$(call percentage,$*)" \ lib.m4 src/euro/index.ccoins.gsp | gsp >$@ $(eurocd): out/euro/%/index.html: $(eurocddeps) $(gspdeps) |