summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile13
-rw-r--r--include/footer.html2
-rw-r--r--include/lib.m41
-rw-r--r--src/srp/fw-ec/index.html2
4 files changed, 10 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index da2a9b6..b670d3d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,10 @@
.PHONY: check clean serve
-srcdirs := ${shell find src -type d}
-outdirs := ${srcdirs:src%=out%}
-sources := ${shell find src -type f -name 'index.html' -or -name '*.css' -or -name '*.svg'}
-outputs := ${sources:src/%=out/%}
+includes := ${wildcard include/*}
+srcdirs := ${shell find src -type d}
+outdirs := ${srcdirs:src%=out%}
+sources := ${shell find src -type f -name 'index.html' -or -name '*.css' -or -name '*.svg'}
+outputs := ${sources:src/%=out/%}
all: ${outdirs} ${outputs}
@@ -15,8 +16,8 @@ out/%: src/%
@cp $< $@
@printf 'CP\t%s\n' "$@"
-out/%.html: src/%.html include/head.html
- @m4 -P ${foreach dir,${^D},-I${dir}} $< >$@
+out/%.html: src/%.html ${includes}
+ @m4 -P ${foreach dir,${^D},-I${dir}} include/lib.m4 $< >$@
@printf 'M4\t%s\n' "$@"
src/srp/fw-ec/index.html: src/srp/fw-ec/led.diff.html
diff --git a/include/footer.html b/include/footer.html
index c1c20e2..700ae8a 100644
--- a/include/footer.html
+++ b/include/footer.html
@@ -1,4 +1,4 @@
<small>
Page last edited:
- m4_esyscmd(git log -1 --pretty='format:%cI' Makefile | xargs date +'%A %d %B %Y — %T %Z' -d)
+ m4_esyscmd(git log -1 --pretty='format:%cI' m4___caller__ | xargs date +'%A %d %B %Y — %T %Z' -d)
</small>
diff --git a/include/lib.m4 b/include/lib.m4
new file mode 100644
index 0000000..1adaa16
--- /dev/null
+++ b/include/lib.m4
@@ -0,0 +1 @@
+m4_define(m4_footer, `m4_define(`m4___caller__', m4___file__)m4_include(footer.html)')
diff --git a/src/srp/fw-ec/index.html b/src/srp/fw-ec/index.html
index c04da7f..d8a48ba 100644
--- a/src/srp/fw-ec/index.html
+++ b/src/srp/fw-ec/index.html
@@ -92,7 +92,7 @@
<hr>
<footer>
- m4_include(footer.html)
+ m4_footer
</footer>
</body>
</html>