pan-am/Makefile

30 lines
819 B
Makefile
Raw Permalink Normal View History

.PHONY: all clean check-size
2013-10-15 22:59:44 +00:00
SASSC=sass
SASSC_ARGS=--style compressed
2013-10-15 22:59:44 +00:00
PANDOC=pandoc
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)
TEST_HTML=$(patsubst test_md/%.md,test_html/%.html,$(TEST_MD))
2013-10-15 22:59:44 +00:00
all: styling.css $(TEST_HTML) check-size
2013-10-15 22:59:44 +00:00
styling.css: styling.sass
$(SASSC) $(SASSC_ARGS) styling.sass styling.css
2013-10-15 22:59:44 +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:
rm -rf styling.css test_html