site/wiki/Makefile

41 lines
811 B
Makefile
Raw Normal View History

SRC_MD_FILES != find source -name '*.md'
DST_HTML_FILES := $(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: dep-php index.html
2019-12-08 07:37:04 +00:00
%.html: %.php
php $< > $@
%.html: source/%.md
2019-10-01 16:59:22 +00:00
$(info building $@)
2019-09-24 15:07:46 +00:00
@$(PANDOC) \
--template wiki.tmpl \
--lua-filter header-permalinks.lua \
--title-prefix "tilde.club wiki" \
2019-09-23 03:46:32 +00:00
--variable toc-title:"table of contents" \
--standalone \
--table-of-contents \
--output $@ \
$<
clean:
2019-10-01 16:59:22 +00:00
$(info removing generated files)
-rm $(DST_HTML_FILES)
dep-pandoc::
2019-10-01 16:59:22 +00:00
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
2019-10-01 16:59:22 +00:00
.PHONY: clean dep-pandoc