2016-01-25 14:54:02 +01:00
|
|
|
SOURCES = $(wildcard *.md)
|
|
|
|
OUT = $(SOURCES:.md=.pdf)
|
|
|
|
|
2016-04-05 22:31:38 +02:00
|
|
|
HS_FILTERS_NAMES =
|
2016-03-23 18:56:19 +01:00
|
|
|
PY_FILTERS_NAMES = pandoc-svg.py
|
2016-04-05 22:31:38 +02:00
|
|
|
EXT_FILTERS = asciimath/pandoc-asciimath
|
2016-03-23 18:56:19 +01:00
|
|
|
|
|
|
|
HS_FILTERS = $(addprefix filters/, $(HS_FILTERS_NAMES))
|
|
|
|
PY_FILTERS = $(addprefix filters/, $(PY_FILTERS_NAMES))
|
|
|
|
FILTERS = $(PY_FILTERS) $(HS_FILTERS) $(EXT_FILTERS)
|
|
|
|
|
2016-04-05 22:31:38 +02:00
|
|
|
all: $(HS_FILTERS) asciimath/pandoc-asciimath $(OUT)
|
2016-01-25 14:54:02 +01:00
|
|
|
|
2016-04-11 14:22:52 +02:00
|
|
|
.SUFFIXES: .md .pdf
|
|
|
|
|
|
|
|
%.pdf: %.md
|
|
|
|
pandoc -S --toc -t latex $< $(addprefix --filter=, $(FILTERS)) -o $@
|
2016-03-23 18:56:19 +01:00
|
|
|
|
2016-03-24 09:27:55 +01:00
|
|
|
$(HS_FILTERS):
|
|
|
|
ghc --make $@.hs -o $@
|
2016-01-25 14:54:02 +01:00
|
|
|
|
2016-04-05 22:31:38 +02:00
|
|
|
asciimath/pandoc-asciimath:
|
2016-04-11 14:22:52 +02:00
|
|
|
(cd asciimath; make)
|
2016-04-05 22:31:38 +02:00
|
|
|
|
2016-01-25 14:54:02 +01:00
|
|
|
clean:
|
|
|
|
rm -f $(OUT)
|
2016-03-23 18:56:19 +01:00
|
|
|
rm -f $(addprefix filters/, $(HS_FILTERS))
|
2016-01-25 14:54:02 +01:00
|
|
|
find . -name "*.pandoc.pdf" -delete
|
2016-03-23 18:56:19 +01:00
|
|
|
|
|
|
|
deepclean: clean
|
2016-04-05 22:31:38 +02:00
|
|
|
(cd asciimath; make clean)
|
2016-03-23 18:56:19 +01:00
|
|
|
rm -f $(HS_FILTERS)
|
|
|
|
rm -f filters/*.hi filters/*.o
|