From 397ef49a967738fc0046ea9308f8fd7f1c447613 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 18 May 2023 20:52:18 +0200 Subject: Make buildable with nix (requires submodule workaround) --- Makefile | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index bfd849e..8a23811 100644 --- a/Makefile +++ b/Makefile @@ -2,57 +2,61 @@ .ONESHELL: .DELETE_ON_ERROR: +PREFIX ?= public + brotli := brotli --force gzip := gzip --best --keep --force zstd := zstd --force --no-pass-through -19 --quiet build: - zola build + zola build --output-dir $(PREFIX) -to_compress := $(shell fd . public --type=file -e html -e xml -e txt -e asc) +to_compress := $(shell fd . $(PREFIX) --type=file -e html -e xml -e txt -e asc) brotli_files := $(patsubst %, %.br, $(to_compress)) gzip_files := $(patsubst %, %.gz, $(to_compress)) zstd_files := $(patsubst %, %.zst, $(to_compress)) -public/%.html.br: public/%.html +${PREFIX}/%.html.br: ${PREFIX}/%.html $(brotli) $< -public/%.xml.br: public/%.xml +${PREFIX}/%.xml.br: ${PREFIX}/%.xml $(brotli) $< -public/%.txt.br: public/%.txt +${PREFIX}/%.txt.br: ${PREFIX}/%.txt $(brotli) $< -public/%.asc.br: public/%.asc +${PREFIX}/%.asc.br: ${PREFIX}/%.asc $(brotli) $< -public/%.html.gz: public/%.html +${PREFIX}/%.html.gz: ${PREFIX}/%.html $(gzip) $< -public/%.xml.gz: public/%.xml +${PREFIX}/%.xml.gz: ${PREFIX}/%.xml $(gzip) $< -public/%.txt.gz: public/%.txt +${PREFIX}/%.txt.gz: ${PREFIX}/%.txt $(gzip) $< -public/%.asc.gz: public/%.asc +${PREFIX}/%.asc.gz: ${PREFIX}/%.asc $(gzip) $< -public/%.html.zst: public/%.html +${PREFIX}/%.html.zst: ${PREFIX}/%.html $(zstd) $< -public/%.xml.zst: public/%.xml +${PREFIX}/%.xml.zst: ${PREFIX}/%.xml $(zstd) $< -public/%.txt.zst: public/%.txt +${PREFIX}/%.txt.zst: ${PREFIX}/%.txt $(zstd) $< -public/%.asc.zst: public/%.asc +${PREFIX}/%.asc.zst: ${PREFIX}/%.asc $(zstd) $< compress: $(brotli_files) $(gzip_files) $(zstd_files) +install: compress + deploy: build compress rsync --archive --delete public/ pappel.alanpearce.eu:/srv/http/alanpearce.eu -.PHONY: all build compress deploy +.PHONY: all build compress install deploy -- cgit 1.4.1