/
Makefile
55 lines (41 loc) · 1.22 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
ifeq "$(PAPER)" ""
PAPER = a4
endif
ifneq "$(TEST)" ""
BOOK = build/test.$(PAPER)
CHAPTERS = $(wildcard test/*.pod)
else
BOOK = build/UsingPerl6.$(PAPER)
CHAPTERS = \
src/preface.pod \
src/basics.pod \
src/operators.pod \
src/subs-n-sigs.pod \
src/multi-dispatch.pod \
src/classes-and-objects.pod \
src/regexes.pod \
src/grammars.pod \
endif
# If you're on a Mac, and installed Inkscape via MacPorts, you
# might want to manually uncomment the next line, and remove
# the one after it.
#INKSCAPE = /Applications/Inkscape.app/Contents/Resources/bin/inkscape
INKSCAPE = inkscape
default: print
html: $(CHAPTERS) bin/book-to-html
perl bin/book-to-html $(CHAPTERS) > $(BOOK).html
print: $(BOOK).pdf
release: print
cp $(BOOK).pdf build/book-$$(date +"%Y-%m").$(PAPER).pdf
build/Makefile: lib/Makefile
cp $< $@
$(BOOK).pdf: $(BOOK).tex build/Makefile build/mmd-table.pdf
cd build && make $*
$(BOOK).tex: $(CHAPTERS) lib/Perl6BookLatex.pm lib/book.sty bin/book-to-latex
perl -Ilib bin/book-to-latex --paper $(PAPER) $(CHAPTERS) > $(BOOK).tex
build/mmd-table.pdf: src/mmd-table.svg
$(INKSCAPE) --export-pdf=build/mmd-table.pdf -D src/mmd-table.svg
clean:
rm -rf build/*
.PHONY: clean
# vim: set noexpandtab