35 lines
578 B
Makefile
35 lines
578 B
Makefile
SRCS := $(sort $(wildcard *.md))
|
|
DEST := $(notdir $(PWD))
|
|
|
|
.PHONY: static
|
|
static: output/index.html
|
|
|
|
%.html: %.md
|
|
sed 's/#!//e;' perfs.md | mdtoreveal /dev/stdin --output $@
|
|
|
|
output/index.md: $(SRCS)
|
|
mkdir -p output
|
|
cat $(SRCS) > output/index.md
|
|
|
|
.PHONY: rsync
|
|
rsync: static
|
|
rsync -vah --delete output/ mdk_fr@mdk.fr:/var/www/mdk.fr/$DEST/
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -fr output
|
|
|
|
.PHONY: entr
|
|
entr:
|
|
ls -1 *.md | entr $(MAKE) static
|
|
|
|
.PHONY: serve
|
|
serve: static
|
|
python3 -m http.server -d output/
|
|
|
|
.PHONY: test
|
|
test:
|
|
if [ -f test.py ]; then \
|
|
python test.py *.md; \
|
|
fi
|