-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
58 lines (40 loc) · 2.14 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
# We use make for small scripts
.PHONY : all build test haddock validate doctest diagrams
all : build
build :
cabal new-build all
test : build
cabal new-run optics-tests
haddock :
cabal new-haddock all
# Build with all supported GHCs, run tests.
validate : build doctest
cabal new-build all --builddir=dist-validate-8.0.2 -w ghc-8.0.2 --write-ghc-environment-files=never
cabal new-build all --builddir=dist-validate-8.2.2 -w ghc-8.2.2 --write-ghc-environment-files=never
cabal new-build all --builddir=dist-validate-8.4.4 -w ghc-8.4.4 --write-ghc-environment-files=never
cabal new-build all --builddir=dist-validate-8.6.3 -w ghc-8.6.3 --write-ghc-environment-files=never
cabal new-run optics-tests --builddir=dist-validate-8.0.2 -w ghc-8.0.2 --write-ghc-environment-files=never
cabal new-run optics-tests --builddir=dist-validate-8.2.2 -w ghc-8.2.2 --write-ghc-environment-files=never
cabal new-run optics-tests --builddir=dist-validate-8.4.4 -w ghc-8.4.4 --write-ghc-environment-files=never
cabal new-run optics-tests --builddir=dist-validate-8.6.3 -w ghc-8.6.3 --write-ghc-environment-files=never
ghcid-optics-core :
ghcid -c 'cabal new-repl optics-core'
codegen-subtypes :
cabal new-run --builddir=dist-codegen --project-file=cabal.codegen.project optics-codegen-subtypes -- subtypes
codegen-join :
cabal new-run --builddir=dist-codegen --project-file=cabal.codegen.project optics-codegen-subtypes -- join
DIAGRAMS=optics reoptics indexedoptics
diagrams : $(DIAGRAMS:%=optics/diagrams/%.png) optics-core/diagrams/reoptics.png
OPTIC_KINDS=AffineFold AffineTraversal Fold Getter Iso Lens Prism ReversedLens ReversedPrism Review Setter Traversal
per-kind-diagrams : $(OPTIC_KINDS:%=optics-core/diagrams/%.png)
metametapost/%.mp : metametapost/src/MetaMetaPost.hs metametapost/src/Cli.hs
cabal new-build metametapost-optics
$$(cabal new-exec which metametapost-optics) $* > $@
metametapost/%.png : metametapost/%.mp
make -C metametapost $*.png
# This rule was:
# cp $< $@
optics/diagrams/%.png : metametapost/%.png
optipng -o7 -zm1-9 $< -dir optics/diagrams/
optics-core/diagrams/%.png : metametapost/%.png
optipng -o7 -zm1-9 $< -dir optics-core/diagrams/