diff options
author | Alan Pearce | 2023-07-08 20:17:24 +0200 |
---|---|---|
committer | Alan Pearce | 2023-07-08 20:17:24 +0200 |
commit | 5c20728ac9ca856218436c5cffb75727c8d9cb49 (patch) | |
tree | 6a4dbd9e770133d6df1df7391416989e183925ec /Makefile | |
parent | 099c92b74c4f24dfc85ff757b6e284e17eaf8d6d (diff) | |
download | website-5c20728ac9ca856218436c5cffb75727c8d9cb49.tar.lz website-5c20728ac9ca856218436c5cffb75727c8d9cb49.tar.zst website-5c20728ac9ca856218436c5cffb75727c8d9cb49.zip |
Make: avoid re-running format/compress targets
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/Makefile b/Makefile index e9c0c4a..2db4b6a 100644 --- a/Makefile +++ b/Makefile @@ -4,17 +4,20 @@ PREFIX ?= public -brotli := brotli --force +brotli := brotli --force --no-copy-stat gzip := gzip --best --keep --force -zstd := zstd --force --no-pass-through -19 --quiet +zstd := zstd --force --no-pass-through -19 --quiet --stdout build: $(PREFIX)/index.html $(PREFIX)/index.html: config.toml content/**.md static/** templates/** themes/**/* zola build --force --output-dir $(PREFIX) -format: $(PREFIX) +format: .formatstamp + +.formatstamp: $(PREFIX)/index.html prettier --write --parser html --print-width 200 "$(PREFIX)/**/*.html" + @touch .formatstamp clean: rm -rf ./$(PREFIX) @@ -49,18 +52,18 @@ ${PREFIX}/%.asc.gz: ${PREFIX}/%.asc $(gzip) $< ${PREFIX}/%.html.zst: ${PREFIX}/%.html - $(zstd) $< + $(zstd) $< > $@ ${PREFIX}/%.xml.zst: ${PREFIX}/%.xml - $(zstd) $< + $(zstd) $< > $@ ${PREFIX}/%.txt.zst: ${PREFIX}/%.txt - $(zstd) $< + $(zstd) $< > $@ ${PREFIX}/%.asc.zst: ${PREFIX}/%.asc - $(zstd) $< + $(zstd) $< > $@ -compress: $(brotli_files) $(gzip_files) $(zstd_files) +compress: .formatstamp $(brotli_files) $(gzip_files) $(zstd_files) install: compress @@ -68,6 +71,6 @@ deploy: .deploystamp .deploystamp: build format compress fly deploy - touch .deploystamp + @touch .deploystamp -.PHONY: all clean build format compress install deploy +.PHONY: all clean build install deploy |