-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (55 loc) · 1.07 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
78
79
# -*- mode: makefile -*-
LIB_SRCS := \
Data/Tyme.hs \
Data/Tyme/Types.hs
APP_SRCS := Main.hs
tangle = notangle -R'$@' $1 $< >$@
.SUFFIXES: .nw .pdf .tex
.nw.tex:
noweave -filter btdefn -n -delay -index $< >$@
.tex.pdf:
latexmk -shell-escape -pdf $<
latexmk -c $<
all: \
Makefile \
.envrc \
.gitattributes \
.gitignore \
README.md \
ChangeLog.md \
LICENSE \
build \
tyme2invoice.pdf
build: \
$(addprefix src/,${LIB_SRCS}) \
$(addprefix app/,${APP_SRCS}) \
Setup.hs \
package.yaml \
shell.nix
nix-build $(lastword $^) -o $@
.PHONY: clean
clean:
find . \
-type f \
\! -path './.git*' \
\! -name '*.nw' \
\! -name invoice.cls \
\! -name Makefile \
-delete
Makefile: tyme2invoice.nw
$(call tangle,-t2)
.envrc \
.gitattributes \
.gitignore \
ChangeLog.md \
README.md \
LICENSE \
package.yaml: \
tyme2invoice.nw
$(call tangle,)
tyme2invoice.cabal: package.yaml
nix-shell -p haskellPackages.hpack --run hpack
shell.nix: tyme2invoice.cabal
nix-shell -p haskellPackages.cabal2nix --run 'cabal2nix --shell . >$@'
%.hs: tyme2invoice.nw
$(call tangle,-filter btdefn)