-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
77 lines (48 loc) · 1.75 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
.SUFFIXES:
TESTS:="tests-c tests-php tests-xml tests-python tests-java tests-go"
.PHONY: clean all tests wc pdf html plain pmd $(TESTS) tests-all
# Clean up old server instances
${shell ps -u $(USER) | awk '/python.+server\.py/ {print "kill " $$2|"/bin/sh"}'}
PROJECT:=BlogPost
PANDOC_FLAGS:=--number-sections -s -f markdown+startnum+smart
THISMAKEFILE:=$(lastword $(MAKEFILE_LIST))
DOCUMENTCLASS:=article
IMAGES:=diagram.png
pdf: $(PROJECT).pdf # Default target
all: pdf html
html: $(PROJECT).html
pmd: $(PROJECT).pmd
plain: $(PROJECT).txt
word: $(PROJECT).docx
clean:
@-rm -vf $(PROJECT).{pdf,html,pmd,docx} diagram.png
%.pmd: %.m4 server/server.py ${glob xml/*.xml} python3/simpleExample1.py $(THISMAKEFILE)
server/server.py & \
m4 -P $< > $@ ; \
kill %1
%.png: %.plantuml
plantuml -tpng $<
wc: $(PROJECT).pmd
@echo Word count: $$(pandoc $(PANDOC_FLAGS) -t plain $< | wc -w)
%.docx: %.pmd $(IMAGES) $(THISMAKEFILE)
pandoc $(PANDOC_FLAGS) $< -o $@
%.txt: %.pmd $(THISMAKEFILE)
pandoc $(PANDOC_FLAGS) -t plain $< -o $@
%.pdf: %.pmd $(IMAGES) $(THISMAKEFILE)
pandoc $(PANDOC_FLAGS) -V documentclass=$(DOCUMENTCLASS) --toc $< -o $@
%.html: %.pmd $(IMAGES) $(THISMAKEFILE)
pandoc $(PANDOC_FLAGS) $< -o $@
tests-all: $(TESTS)
tests-xml:
server/server.py & find xml -name \*.xml -ls -exec curl -v http://localhost:8080/users --data @{} \; ; kill %1
tests-python:
server/server.py & find python3 -name \*.py -ls -exec {} \; ; kill %1
tests-java:
server/server.py & cd java && for i in *.build.gradle ; do ./gradlew -b $$i run;done; kill %1
tests-go:
go get github.com/divan/gorilla-xmlrpc/xml
server/server.py & find go -name \*.go -ls -exec go run {} \; ;kill %1
tests-php:
server/server.py & php/simpleExample1.php ;kill %1
tests-c:
cd C; $(MAKE)