-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (31 loc) · 825 Bytes
/
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
35
36
37
38
39
.PHONY: test site serve all
all: site
test/%.out.py: content/%.md
mkdir -p $(shell dirname $@)
./render.py test $< > $@
chmod +x $@
test/%: content/%
mkdir -p $(shell dirname $@)
cp $< $@
test: $(patsubst content/%.md, test/%.out.py, $(shell find content -name "*.md")) \
$(patsubst content/%, test/%, $(shell find content -type f ! -name "*.md" ! -name "*jinja")) \
render_test.py
@errors=0; \
count=0; \
pwd=$$(pwd); \
for test in $^ ; do \
if [ -x $$test ] ; then \
echo running $$test; \
(cd $$(dirname $$test) && exec $$pwd/$$test) || errors=`expr $$errors + 1`; \
count=`expr $$count + 1`; \
fi; \
done; \
echo `expr $$count - $$errors` of $$count tests pass; \
exit $$errors
site:
mkdir -p site
./render.py build
serve:
./render.py serve --dev; \
clean:
rm -rf test site/* *.pyc