From 4bf0a6fa42a9adc82e639aa0c9b278b00e528910 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 8 Mar 2025 15:46:21 -0300 Subject: Generate gzipped variation of final output --- Makefile | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0188a50..c1db639 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,7 @@ LDLIBS = .SUFFIXES: .SUFFIXES: .adoc .conf .snippets .indexentry .feedentry .sortdata .xml .xmldeps .SUFFIXES: .htmlbody .htmlheader .htmlfooter .htmllisting .html +.SUFFIXES: .gz .adoc.conf: mkwb conf src/global.conf $< > $@ @@ -82,7 +83,7 @@ sources = \ $(images.svg) \ src/content/style.css \ -contents = \ +dynamic-contents = \ $(sources.html) \ $(feeds.xml) \ @@ -91,9 +92,28 @@ static-contents = \ $(images.svg) \ src/content/style.css \ +dynamic-contents.gz = $(dynamic-contents:=.gz) -derived-assets = \ +static-contents.gz = \ + $(images.svg:=.gz) \ + src/content/style.css.gz \ + +contents.gz = \ + $(dynamic-contents.gz) \ + $(static-contents.gz) \ + +contents = \ + $(dynamic-contents) \ + $(static-contents) \ + +all-contents = \ $(contents) \ + $(contents.gz) \ + + +derived-assets = \ + $(dynamic-contents) \ + $(contents.gz) \ $(sources.htmlbody) \ $(sources.snippets) \ $(sources.conf) \ @@ -133,6 +153,9 @@ $(listings.html): $(feeds.xml): mkwb feed src/global.conf $*.xmldeps > $@ +$(contents.gz): + gzip -9fk $* + check-unit: @@ -166,7 +189,7 @@ install: all mkdir -p \ '$(DESTDIR)$(SRCDIR)' \ - for f in $(contents) $(static-contents) `cat $(sources.snippets)`; do \ + for f in $(all-contents) `cat $(sources.snippets)`; do \ dir='$(DESTDIR)$(HTMLDIR)'/"`dirname "$${f#src/content/}"`"; \ mkdir -p "$$dir"; \ cp -P "$$f" "$$dir"; \ -- cgit v1.2.3