From c33a856773fcffb875ae2ef687398b6423d75c43 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Mon, 10 May 2021 19:25:21 +0200 Subject: Makefile: Added watch and dev (= watch + serve) targets, added .PHONY --- Makefile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 58afe3b..7f4ff95 100644 --- a/Makefile +++ b/Makefile @@ -100,9 +100,6 @@ out/%.css: assets/css/%.scss $(CSS_SRC) | out .cache/meta: .cache mkdir -p .cache/meta -.cache/pages: .cache - mkdir -p .cache/pages - .cache: mkdir -p .cache @@ -113,15 +110,25 @@ out: # UTILITIES # -compress: all - pigz -R -k -9 -- `find out -type f -iregex '.*\\.\\(css\\|js\\|json\\|html\\|xml\\|txt\\|svg\\|ico\\)'` - brotli -k -- `find out -type f -iregex '.*\\.\\(css\\|js\\|json\\|html\\|xml\\|txt\\|svg\\|ico\\|woff\\)'` +watch: all + while true; do \ + inotifywait -qr -e modify -e create -e delete -e move assets content filters metadata scripts templates; \ + $(MAKE); \ + done serve: all python -m http.server --directory out 8000 +dev: watch serve + +compress: all + pigz -R -k -9 -- `find out -type f -iregex '.*\\.\\(css\\|js\\|json\\|html\\|xml\\|txt\\|svg\\|ico\\)'` + brotli -k -- `find out -type f -iregex '.*\\.\\(css\\|js\\|json\\|html\\|xml\\|txt\\|svg\\|ico\\|woff\\)'` + deploy: compress rsync --progress --stats -rvz --delete out/ "$(DEPLOY_TARGET)" clean: rm -rf out + +.PHONY: all watch serve dev deploy clean -- cgit v1.2.3-70-g09d2