2013-11-04 19:00:15 +00:00
|
|
|
.PHONY: all clean check-size
|
2013-10-15 22:59:44 +00:00
|
|
|
SASSC=sass
|
2013-11-04 19:00:15 +00:00
|
|
|
SASSC_ARGS=--style compressed
|
2013-10-15 22:59:44 +00:00
|
|
|
PANDOC=pandoc
|
2013-11-04 19:00:15 +00:00
|
|
|
PANDOC_ARGS=--css=../styling.css -V lang=en -V highlighting-css= --mathjax \
|
|
|
|
--smart --to=html5
|
2013-10-15 22:59:44 +00:00
|
|
|
TEST_MD=$(wildcard test_md/*.md)
|
2013-11-04 19:00:15 +00:00
|
|
|
TEST_HTML=$(patsubst test_md/%.md,test_html/%.html,$(TEST_MD))
|
2013-10-15 22:59:44 +00:00
|
|
|
|
2013-11-04 19:00:15 +00:00
|
|
|
all: styling.css $(TEST_HTML) check-size
|
2013-10-15 22:59:44 +00:00
|
|
|
|
2013-11-04 19:00:15 +00:00
|
|
|
styling.css: styling.sass
|
|
|
|
$(SASSC) $(SASSC_ARGS) styling.sass styling.css
|
2013-10-15 22:59:44 +00:00
|
|
|
|
2013-11-04 19:00:15 +00:00
|
|
|
check-size: styling.css
|
|
|
|
@echo "raw size: $(shell stat -c%s styling.css) bytes"
|
|
|
|
@echo "gziped size:" \
|
|
|
|
"$(shell gzip -c styling.css | wc -c | awk '{print $1;}') bytes"
|
|
|
|
|
|
|
|
define TEST_TARGET
|
|
|
|
$(patsubst test_md/%.md,test_html/%.html,$(1)): $(1)
|
|
|
|
@mkdir -p test_html
|
|
|
|
$(PANDOC) $(PANDOC_ARGS) $$< -o $$@
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach i,$(TEST_MD),$(eval $(call TEST_TARGET,$(i))))
|
2013-10-15 22:59:44 +00:00
|
|
|
|
|
|
|
clean:
|
2013-11-04 19:00:15 +00:00
|
|
|
rm -rf styling.css test_html
|