summaryrefslogtreecommitdiff
path: root/repo/www/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'repo/www/Makefile')
-rw-r--r--repo/www/Makefile16
1 files changed, 10 insertions, 6 deletions
diff --git a/repo/www/Makefile b/repo/www/Makefile
index 9050626..fdc0112 100644
--- a/repo/www/Makefile
+++ b/repo/www/Makefile
@@ -1,5 +1,3 @@
-# TODO: add a target for the file tree; use it in generate-* scripts.
-
TOP_DIR = ../..
OUT_DIR = $(TOP_DIR)/public
TEXT_FILES = md org
@@ -12,12 +10,18 @@ text_folders = $(call dirnames,$(shell git ls-files $(text_patterns)))
all: site
+# Maps folders to their contents (files and subfolders).
+site_tree = site-tree.json
# Defines $(pages) and $(indices).
dependencies = deps.mk
-include $(dependencies)
-$(dependencies): $(text_folders)
- ./generate-deps.py "$(TEXT_FILES)" $(OUT_DIR)
+$(site_tree): $(text_folders)
+ ./generate-tree.py -o $@ $(TEXT_FILES)
+
+$(dependencies): $(site_tree)
+ ./generate-deps.py $< $@ $(OUT_DIR)
+
+include $(dependencies)
site: $(pages) $(indices)
@@ -33,7 +37,7 @@ $(pages):
# ⚠ When tweaking this rule, check whether it still works for the
# top-level index.html.
$(indices): $(OUT_DIR)/%index.html:
- ./generate-index.py "$(TEXT_FILES)" "$(patsubst %/,%,$*)" $@
+ ./generate-index.py $(site_tree) "$(patsubst %/,%,$*)" $@
clean:
-rm $(dependencies)