diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2020-03-29 23:24:35 +0200 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2020-03-29 23:24:35 +0200 |
| commit | a9ec31367187bc0159100688e13400ca86b2709a (patch) | |
| tree | acffacad68843b10cfb7ab895af30402d61b0160 /repo/www/Makefile | |
| parent | 006c863ee184389324d7346f65e93728d8d587b9 (diff) | |
| download | memory-leaks-a9ec31367187bc0159100688e13400ca86b2709a.tar.xz | |
Unify recipe for regular and automated indices
Also don't run pandoc in a pipeline within a Makefile recipe: pipefail
is not set, so generate-index.py failures will not be bubbled up.
Diffstat (limited to 'repo/www/Makefile')
| -rw-r--r-- | repo/www/Makefile | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/repo/www/Makefile b/repo/www/Makefile index 913aa65..bc9933a 100644 --- a/repo/www/Makefile +++ b/repo/www/Makefile @@ -9,8 +9,8 @@ dirname = $(patsubst %/,%,$(dir $(1))) text_patterns = $(foreach ext,$(TEXT_FILES),'$(TOP_DIR)/**.$(ext)') text_folders = $(sort $(call dirname,$(shell git ls-files $(text_patterns)))) - page_folders = $(patsubst $(TOP_DIR)%,$(OUT_DIR)%,$(text_folders)) +indices = $(addsuffix /index.html,$(page_folders)) all: site @@ -20,7 +20,7 @@ include $(dependencies) $(dependencies): generate-deps.py $(text_folders) python3 $< "$(TEXT_FILES)" $(OUT_DIR) -site: $(pages) $(indices) $(autoindices) +site: $(pages) $(indices) $(page_folders): mkdir -p $@ @@ -28,14 +28,10 @@ $(page_folders): $(pages): pandoc -s $< -o $@ -$(indices): - python3 generate-index.py "$(TEXT_FILES)" $(dir $<) | pandoc -s > $@ - # ⚠ When tweaking this rule, check whether it still works for the -# top-level index.html, i.e. when there is no top-level README. -$(autoindices): \ -$(OUT_DIR)%/index.html: $(TOP_DIR)% generate-index.py | $(OUT_DIR)% - python3 generate-index.py "$(TEXT_FILES)" $< | pandoc -s > $@ +# top-level index.html. +$(indices): $(OUT_DIR)%/index.html: $(TOP_DIR)% generate-index.py | $(OUT_DIR)% + python3 generate-index.py "$(TEXT_FILES)" "$<" $@ clean: -rm $(dependencies) |
