summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-10-30 16:21:23 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-10-30 16:21:23 +0100
commitdfae8ae26dfbc859fd4c49d32cfa380ea260f2bc (patch)
tree5296c44e08b0ef4f50a752c0b514f9641152078b /Makefile
parent613c9c22f839452aae7cf64ae641b668451ec412 (diff)
Update lots of shit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 23 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 611a214..13e5828 100644
--- a/Makefile
+++ b/Makefile
@@ -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 $< $@