|
|
@ -1,8 +1,10 @@ |
|
|
|
outdir ?= ./public |
|
|
|
tmpdir ?= ./tmp |
|
|
|
veraMonoSrc ?= ./VeraMono.ttf |
|
|
|
all = $(addprefix ${outdir}/, $(addsuffix .html, $(basename $(wildcard *.md)))) |
|
|
|
files = $(addprefix ${outdir}/, $(wildcard files/*)) |
|
|
|
|
|
|
|
all: ${all} ${files} |
|
|
|
all: ${all} ${files} ${outdir}/VeraMono.subset.woff2 |
|
|
|
|
|
|
|
show: |
|
|
|
@echo ${all} |
|
|
@ -11,6 +13,9 @@ show: |
|
|
|
${outdir}: |
|
|
|
mkdir -p ${outdir} |
|
|
|
|
|
|
|
${tmpdir}: |
|
|
|
mkdir -p ${tmpdir} |
|
|
|
|
|
|
|
${outdir}/files: |
|
|
|
mkdir -p ${outdir}/files |
|
|
|
|
|
|
@ -20,12 +25,24 @@ ${outdir}/%.html: %.md template.html ${outdir} |
|
|
|
${outdir}/files/%: files/% ${outdir}/files |
|
|
|
cp $< $@ |
|
|
|
|
|
|
|
${tmpdir}/VeraMono.ttf: ${veraMonoSrc} ${tmpdir} |
|
|
|
cp $< $@ |
|
|
|
|
|
|
|
${tmpdir}/%.subset.ttf: ${tmpdir}/%.ttf |
|
|
|
fontforge -script make-font.pe $< $@ |
|
|
|
|
|
|
|
${tmpdir}/%.woff2: ${tmpdir}/%.ttf |
|
|
|
woff2_compress $< |
|
|
|
|
|
|
|
${outdir}/%: ${tmpdir}/% ${outdir} |
|
|
|
cp $< $@ |
|
|
|
|
|
|
|
clean: |
|
|
|
rm -r ${outdir} |
|
|
|
rm -r ${outdir} ${tmpdir} |
|
|
|
|
|
|
|
start: ${all} |
|
|
|
{ php -S 127.0.0.1:8123 -t ${outdir} & \
|
|
|
|
echo $$! > php.pid; } |
|
|
|
echo $$! > ${tmpdir}/php.pid; } |
|
|
|
|
|
|
|
stop: |
|
|
|
kill `cat php.pid` |
|
|
|
kill `cat ${tmpdir}/php.pid` |