Implement compression
This commit is contained in:
parent
e5d3339e62
commit
1eec805218
9
Makefile
9
Makefile
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user