From 1eec8052181831bf0f489901e40ae53ae697808b Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Sat, 13 Oct 2018 16:19:34 +0200 Subject: [PATCH] Implement compression --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index d15744a..da85835 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,14 @@ DOT_TARGETS=$(DOT_SOURCES:%.dot=build/%.png) TEX_SOURCES=$(shell find . -not -path "./templates/*" -name '*.tex') TEX_TARGETS=$(TEX_SOURCES:%.tex=build/%.pdf) +COMPRESS_TARGETS=$(HTML_TARGETS:%=%.gz) +COMPRESS_TARGETS+=$(PDF_TARGETS:%=%.gz) +COMPRESS_TARGETS+=$(TEX_TARGETS:%=%.gz) + default: $(DOT_TARGETS) $(HTML_TARGETS) $(PDF_TARGETS) $(TEX_TARGETS) +compress: default $(COMPRESS_TARGETS) + build/%.html: %.md @mkdir -p $$(dirname $@) pandoc -s --mathjax --template ./templates/mindoc.html --toc --toc-depth=2 -o $@ $< @@ -28,5 +34,8 @@ build/%.pdf: %.tex @mkdir -p $$(dirname $@) latexmk -pdf -outdir=$$(dirname $@) $< +%.gz: % + gzip -k -f -9 $< + clean: rm -r build