-
Notifications
You must be signed in to change notification settings - Fork 49
/
Makefile
49 lines (37 loc) · 989 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
40
41
42
43
44
45
46
47
48
49
PERL = perl
ifeq "$(PAPER)" ""
PAPER = $(shell paperconf)
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/classes-and-objects.pod \
src/multi-dispatch.pod \
src/roles.pod \
src/subtypes.pod \
src/regexes.pod \
src/grammars.pod \
src/builtins.pod
endif
default: prepare pdf clean
prepare: clean
mkdir build
html: prepare $(CHAPTERS) bin/book-to-html
$(PERL) bin/book-to-html $(CHAPTERS) > $(BOOK).html
pdf: tex lib/Makefile
cd build && make -I ../lib -f ../lib/Makefile
tex: prepare $(CHAPTERS) lib/Perl6BookLatex.pm lib/book.sty bin/book-to-latex
$(PERL) -Ilib bin/book-to-latex --paper $(PAPER) $(CHAPTERS) > $(BOOK).tex
release: pdf
cp $(BOOK).pdf build/book-$$(date +"%Y-%m").$(PAPER).pdf
clean:
rm -rf build/
.PHONY: clean
# vim: set noexpandtab