-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
71 lines (41 loc) · 1.29 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
##
## Makefile for haskell_pres
## Made by nicuveo <[email protected]>
##
## GENERAL INFOS
IMG_DIR = ./img/
BUILD_DIR = ./build/
PDF = gol.pdf
PDF_DEPS = Main.lhs Matrix.lhs Game.lhs Parser.lhs theme.tex $(wildcard img/*)
PDF_CMD = pdflatex
PDF_FLAGS = -interaction nonstopmode -output-directory $(BUILD_DIR)
EXE = gol
EXE_DEPS = Main.lhs Matrix.lhs Game.lhs Parser.lhs
EXE_CMD = ghc
EXE_FLAGS = --make -odir $(BUILD_DIR) -hidir $(BUILD_DIR) -tmpdir $(BUILD_DIR)
TARBALL = gol
CLEAN = '*~' '\#*' '.\#*' '.DS_Store' '*.log' '*.aux' '*.toc' '*.nav' '*.out' '*.snm' '*.vrb' '*.o' '*.hi'
## OUTPUT
all: $(PDF) $(EXE);
$(PDF): $(PDF_DEPS) Main.pdf
mv $(BUILD_DIR)/Main.pdf $@
$(EXE): $(EXE_DEPS)
$(EXE_CMD) $(EXE_FLAGS) $< -o $@
# CLEANING
clean:
for f in $(CLEAN) ; do find . -name "$$f" | xargs rm -f ; done
distclean: clean
rm -f $(TARBALL) $(PDF) $(EXE)
dist tar tarball: distclean
tar --transform 's,^,$(TARBALL)/,' -cvjf $(TARBALL).tar.bz2 --exclude=".svn" *
## SPECIFIC
%.pdf: %.tex
$(PDF_CMD) $(PDF_FLAGS) $*.tex && $(PDF_CMD) $(PDF_FLAGS) $*.tex
%.pdf: %.lhs
$(PDF_CMD) $(PDF_FLAGS) $*.lhs && $(PDF_CMD) $(PDF_FLAGS) $*.lhs
%.pdf:
@echo "Unable to find $*.tex or $*.lhs, aborting."
@exit 2
## SPECIALS
.PRECIOUS: %.pdf ;
.INTERMEDIATE: Main.pdf ;