From a9ec31367187bc0159100688e13400ca86b2709a Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sun, 29 Mar 2020 23:24:35 +0200 Subject: 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. --- repo/www/Makefile | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'repo/www/Makefile') 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) -- cgit v1.2.3