aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: f50501314c8c53a57aabc78b6750da113d24c066 (plain)
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
BUILDDIR = build

PS_TARGETS = $(patsubst designs/%.yaml,$(BUILDDIR)/%.ps,$(wildcard designs/*.yaml))
PDF_TARGETS = $(patsubst designs/%.yaml,$(BUILDDIR)/%.pdf,$(wildcard designs/*.yaml))
NUP4_TARGETS = $(patsubst designs/%.yaml,$(BUILDDIR)/%-nup4.pdf,$(wildcard designs/*-a6.yaml))
NUP2_TARGETS = $(patsubst designs/%.yaml,$(BUILDDIR)/%-nup2.pdf,$(wildcard designs/*-a5.yaml))
VERSO_TARGETS = $(patsubst designs/%.yaml,$(BUILDDIR)/%-v.pdf,$(wildcard designs/*.yaml))
VERSO_NUP4_TARGETS = $(patsubst designs/%.yaml,$(BUILDDIR)/%-nup4-v.pdf,$(wildcard designs/*-a6.yaml))
VERSO_NUP2_TARGETS = $(patsubst designs/%.yaml,$(BUILDDIR)/%-nup2-v.pdf,$(wildcard designs/*-a5.yaml))

.PHONY: all ps pdf clean
all: pdf nup verso
ps: $(PS_TARGETS)
pdf: $(PDF_TARGETS)
nup: $(NUP4_TARGETS) $(NUP2_TARGETS)
verso: $(VERSO_TARGETS) $(VERSO_NUP4_TARGETS) $(VERSO_NUP2_TARGETS)

$(BUILDDIR)/%.ps: designs/%.yaml
	mkdir -p ${BUILDDIR}
	./bin/render -o $@ $<

$(BUILDDIR)/%-a3.pdf: ${BUILDDIR}/%-a3.ps
	ps2pdf -sPAPERSIZE=a3 $< $@

$(BUILDDIR)/%-a4.pdf: ${BUILDDIR}/%-a4.ps
	ps2pdf -sPAPERSIZE=a4 $< $@

$(BUILDDIR)/%-a5.pdf: ${BUILDDIR}/%-a5.ps
	ps2pdf -sPAPERSIZE=a5 $< $@

$(BUILDDIR)/%-a6.pdf: ${BUILDDIR}/%-a6.ps
	ps2pdf -sPAPERSIZE=a6 $< $@

$(BUILDDIR)/%-a5-nup2.pdf: $(BUILDDIR)/%-a5.pdf
	pdfjam --nup 2x1 --landscape -o $@ $< '1,1'

$(BUILDDIR)/%-a6-nup4.pdf: $(BUILDDIR)/%-a6.pdf
	pdfjam --nup 2x2 --no-landscape -o $@ $< '1,1,1,1'

$(BUILDDIR)/%-v.pdf: $(BUILDDIR)/%.pdf
	pdfjam --reflect true -o $@ $<

clean:
	rm -f ${BUILDDIR}/*.ps ${BUILDDIR}/*.pdf