-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
34 lines (29 loc) · 1.07 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Name of the filter file, *with* `.lua` file extension.
FILTER_FILE := $(wildcard *.lua)
# Name of the filter, *without* `.lua` file extension
FILTER_NAME = $(patsubst %.lua,%,$(FILTER_FILE))
# Allow to use a different pandoc binary, e.g. when testing.
PANDOC ?= pandoc
# Allow to adjust the diff command if necessary
DIFF = diff
# Test that running the filter on the sample input document yields
# the expected output.
#
# The automatic variable `$<` refers to the first dependency
# (i.e., the filter file).
test: $(FILTER_FILE) test/input.md test/test.yaml
$(PANDOC) --defaults test/test.yaml | \
$(DIFF) test/expected.md -
# Ensure that the `test` target is run each time it's called.
.PHONY: test
# Re-generate the expected output. This file **must not** be a
# dependency of the `test` target, as that would cause it to be
# regenerated on each run, making the test pointless.
test/expected.md: $(FILTER_FILE) test/input.md test/test.yaml
$(PANDOC) --defaults test/test.yaml --output=$@
#
# Clean
#
.PHONY: clean
clean:
rm -f _site/output.md _site/index.html _site/style.css