PREFIX ?= ./public tmpdir ?= /tmp all = $(addprefix ${PREFIX}/, $(addsuffix .html, $(basename $(wildcard *.md)))) files = $(addprefix ${PREFIX}/, gpg_pubkey.asc gpg_pubkey_leah.asc ssh_pubkey.asc ssh_pubkey_leah.asc $(wildcard assets/*)) install: ${all} ${files} show: @echo ${all} @echo ${static} ${PREFIX}: mkdir -p ${PREFIX} ${PREFIX}/assets: mkdir -p ${PREFIX}/assets ${PREFIX}/%.html: %.md template.html ${PREFIX} pandoc --standalone --template template.html $< -o $@ ${PREFIX}/gpg_pubkey.asc: files/gpg_pubkey.asc cp files/gpg_pubkey.asc ${PREFIX}/gpg_pubkey.asc ${PREFIX}/gpg_pubkey_leah.asc: files/gpg_pubkey_leah.asc cp files/gpg_pubkey_leah.asc ${PREFIX}/gpg_pubkey_leah.asc ${PREFIX}/ssh_pubkey.asc: files/ssh_pubkey.asc cp files/ssh_pubkey.asc ${PREFIX}/ssh_pubkey.asc ${PREFIX}/ssh_pubkey_leah.asc: files/ssh_pubkey_leah.asc cp files/ssh_pubkey_leah.asc ${PREFIX}/ssh_pubkey_leah.asc ${PREFIX}/assets/%: assets/% ${PREFIX}/assets cp $< $@ ${PREFIX}/%: ${tmpdir}/% ${PREFIX} cp $< $@ clean: rm -r ${PREFIX} ${tmpdir} start: ${all} { php -S 127.0.0.1:8123 -t ${PREFIX} & \ echo $$! > ${tmpdir}/php.pid; } stop: kill `cat ${tmpdir}/php.pid`