This repository has been archived by the owner on Feb 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
77 lines (56 loc) · 1.43 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
74
75
76
77
# Makefile to create the bar- and mixing cards. \
\
Usage is described in BRUGSANVISNING.txt (in Danish)
# Use Python 3 it it exists, else use Python 2.
ifeq ($(shell which python3),)
PYTHON = python
else
PYTHON = python3
endif
#####################
# Generating output #
#####################
# Defaults
fest ?= drinks
sort ?= sorted
alt ?= nej
columns ?= new
ifeq ($(alt),nej)
alt_arg :=
else
alt_arg := -a
endif
ifeq ($(sort),sorted)
sort_arg := -s
else
sort_arg :=
endif
# Run it all!
default: clean-deep all
all: bar_$(fest).pdf mixing_$(fest).pdf
# Create the barcards
bar_$(fest).pdf: barcard.tex barcardmain.tex
xetex -jobname=bar_$(fest) -output-driver="xdvipdfmx -q -E -p a4 -l" barcardmain.tex
# Create the mixing card
mixing_$(fest).pdf: mixing.tex mixingcardmain.tex
pdflatex -jobname=mixing_$(fest) mixingcardmain.tex
# Generate the tables using python magic!
barcard.tex: drinks.py $(fest).txt
$(PYTHON) $< $(sort_arg) $(alt_arg) -c $(columns) $(fest).txt
###########
# Testing #
###########
# See if there is any errors in the provided input file...
test: drinks.py $(fest).txt
$(PYTHON) $< -v $(fest).txt
################
# Housekeeping #
################
clean: clean-junk clean-tex
clean-deep: clean clean-out
clean-junk:
$(RM) *.log *.aux
clean-tex:
$(RM) mixing.tex barcard.tex
clean-out:
$(RM) *.pdf