Implement compression

This commit is contained in:
Valentin Brandl 2018-10-13 16:19:34 +02:00
parent e5d3339e62
commit 1eec805218
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D

View File

@ -10,8 +10,14 @@ DOT_TARGETS=$(DOT_SOURCES:%.dot=build/%.png)
TEX_SOURCES=$(shell find . -not -path "./templates/*" -name '*.tex') TEX_SOURCES=$(shell find . -not -path "./templates/*" -name '*.tex')
TEX_TARGETS=$(TEX_SOURCES:%.tex=build/%.pdf) 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) default: $(DOT_TARGETS) $(HTML_TARGETS) $(PDF_TARGETS) $(TEX_TARGETS)
compress: default $(COMPRESS_TARGETS)
build/%.html: %.md build/%.html: %.md
@mkdir -p $$(dirname $@) @mkdir -p $$(dirname $@)
pandoc -s --mathjax --template ./templates/mindoc.html --toc --toc-depth=2 -o $@ $< pandoc -s --mathjax --template ./templates/mindoc.html --toc --toc-depth=2 -o $@ $<
@ -28,5 +34,8 @@ build/%.pdf: %.tex
@mkdir -p $$(dirname $@) @mkdir -p $$(dirname $@)
latexmk -pdf -outdir=$$(dirname $@) $< latexmk -pdf -outdir=$$(dirname $@) $<
%.gz: %
gzip -k -f -9 $<
clean: clean:
rm -r build rm -r build