all: $H
-build/:
- mkdir -p $@
-
build/%.html: %.md build/ Makefile
{ cat $<; echo; echo "<small><i>Last updated $$(date -u -d @$$(stat -c %Y $<))</i></small>"; } | markdown >$@
cp -a $L build/
+build/:
+ mkdir -p $@
+
view:
xdg-open build/index.html
-publish: all
+publish: _not_dirty all _rsync
+
+clean:
+ rm -rfv build/
+
+_rsync: all
+ rsync -vha --delete build/ root@thefekete.net:/var/www/thefekete.net/
+
+_not_dirty:
@git diff-index --quiet HEAD -- && test -z "$(git ls-files --others)" || ( \
1>&2 echo "Index is dirty or there are uncommitted files!"; \
git status; \
exit 1; \
)
- rsync -vha --delete build/ root@thefekete.net:/var/www/thefekete.net/
-
-rsync: all
- rsync -vha --delete build/ root@thefekete.net:/var/www/thefekete.net/
-
-clean:
- rm -rfv build/
-.PHONY: all publish view clean
+.PHONY: all view publish clean _rsync _not_dirty