summaryrefslogtreecommitdiff
path: root/Makefile
blob: e9d65cc6ec34d79676b40315a36cc159ddc495f3 (plain) (blame)
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
#
# willora-docs Makefile
# Charlotte Koch <charlotte@magentastripe.com>
#
# ==================================================
#
# Use this Makefile to generate the Willora Guide.
#

BUNDLE?=	bundle33
RUBY?=		ruby33

SECTIONS=	# defined
SECTIONS+=	guide/hello.adoc

########## ########## ##########

.PHONY: all
all: guide.pdf

CLEANFILES+=	guide.pdf
guide.pdf: Gemfile.lock total.adoc
	${BUNDLE} exec asciidoctor-pdf	\
		-b pdf			\
		-d book			\
		-o ${.TARGET}		\
		total.adoc

CLEANFILES+=	total.adoc
total.adoc: ${SECTIONS}
	echo > ${.TARGET}
.for section in ${SECTIONS}
	cat ${section} >> ${.TARGET}
	echo >> ${.TARGET}
	echo >> ${.TARGET}
.endfor

########## ########## ##########

Gemfile.lock: Gemfile
	${BUNDLE} config set --local path ./vendor
	${BUNDLE} install

########## ########## ##########

.PHONY: clean
clean:
	rm -rf ${CLEANFILES}