SRC_HTMLS := $(shell find src -name '*.src.html') SRC_MDS := $(shell find src -name '*.src.md') GEN_HTMLS := $(SRC_HTMLS:%.src.html=%.gen.html) GEN_MDS := $(SRC_MDS:%.src.md=%.gen.html) GEN_FILES := $(GEN_HTMLS) $(GEN_MDS) DIST_FILES := $(GEN_FILES:src/%.gen.html=dist/%.html) PANDOC_GEN := pandoc --standalone --wrap=none --template src/templates/main.html --metadata-file src/meta.yml .PHONY: build build: $(GEN_FILES) $(info HTML generated) %.gen.html: %.src.html $(PANDOC_GEN) --output $@ $< %.gen.html: %.src.md $(PANDOC_GEN) --output $@ $< dist: $(DIST_FILES) $(info Distributed folder generated) dist/%.html: src/%.gen.html mkdir --parents $(dir $@) cp $< $@ .PHONY: clean clean: rm -f $(GEN_FILES) .PHONY: debug debug: $(info SRC_HTMLS $(SRC_HTMLS)) $(info SRC_MDS $(SRC_MDS)) $(info GEN_HTMLS $(GEN_HTMLS)) $(info GEN_MDS $(GEN_MDS)) $(info GEN_FILES $(GEN_FILES)) $(info DIST_FILES $(DIST_FILES))