diff --git a/wiki/Makefile b/wiki/Makefile index a79c5fc..7b6c59e 100644 --- a/wiki/Makefile +++ b/wiki/Makefile @@ -1,10 +1,16 @@ SRC_MD_FILES != find source -name '*.md' -DST_HTML_FILES := $(SRC_MD_FILES:source/%.md=%.html) +DST_HTML_FILES := index.html $(SRC_MD_FILES:source/%.md=%.html) PANDOC != command -v pandoc 2> /dev/null +PHP != command -v php 2> /dev/null all: dep-pandoc $(DST_HTML_FILES) +index.html: index.php + +%.html: %.php dep-php + php $< > $@ + %.html: source/%.md $(info building $@) @$(PANDOC) \ @@ -19,12 +25,17 @@ all: dep-pandoc $(DST_HTML_FILES) clean: $(info removing generated files) - @rm $(DST_HTML_FILES) + -rm $(DST_HTML_FILES) -dep-pandoc: +dep-pandoc:: ifndef PANDOC $(error missing dependency 'pandoc'. please install and try again) endif +dep-php:: +ifndef PHP + $(error missing dependency 'php'. please install and try again) +endif + .PHONY: clean dep-pandoc