-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
127 lines (104 loc) · 4.89 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Makefile for leancheck-instances
#
# Copyright: (c) 2015-2022 Rudy Matela
# License: 3-Clause BSD (see the file LICENSE)
# Maintainer: Rudy Matela <[email protected]>
TESTS = test/main \
test/text
EGS = \
eg/test-text
BENCHS = \
bench/tiers
GHCIMPORTDIRS = src:test
# -dynamic is needed only for src/Test/LeanCheck/Derive.hs and test/derive.hs
GHCFLAGS = -v0 -O2 $(shell grep -q "Arch Linux" /etc/lsb-release && echo -dynamic)
HADDOCKFLAGS = \
$(shell grep -q "Arch Linux" /etc/lsb-release && echo --optghc=-dynamic)
BASE_DEPS = containers array time
INSTALL_DEPS = leancheck bytestring nats text \
$(shell cabal --version | grep -q "version [0-2]\." || echo $(BASE_DEPS))
all: mk/toplibs
all-all: mk/All.o
test: $(patsubst %,%.run,$(TESTS)) diff-test test-sdist
diff-test: diff-test-tiers $(patsubst %,%.diff-test,$(EGS))
update-diff-test: update-diff-test-tiers $(patsubst %,%.update-diff-test,$(EGS))
%.run: %
./$<
eg/%.diff-test: eg/%
./$< | diff -rud test/diff/$<.out -
eg/%.update-diff-test: eg/%
./$< > test/diff/$<.out
clean: clean-hi-o clean-haddock
rm -f $(TESTS) $(BENCHS) $(EGS) mk/toplibs
full-clean: clean
rm -rf .stack-work
rm -f tags TAGS
ghci: mk/All.ghci
install:
@echo "use \`cabal install' instead"
test-sdist:
./test/sdist
test-via-cabal:
cabal configure --enable-tests --enable-benchmarks --ghc-options="$(GHCFLAGS) -O0"
cabal build
cabal test main
test-via-stack:
stack test leancheck-instances:test:main --ghc-options="$(GHCFLAGS) -O0" --system-ghc --no-install-ghc --no-terminal
legacy-test: # needs ghc-8.2 .. ghc-7.8 installed as such
make clean && make test GHC=ghc-8.2 GHCFLAGS="-Werror -dynamic"
make clean && make test GHC=ghc-8.0 GHCFLAGS="-Werror -dynamic"
make clean && make test GHC=ghc-7.10 GHCFLAGS="-Werror -dynamic"
make clean && make test GHC=ghc-7.8 GHCFLAGS="-Werror -dynamic"
make clean && make test
legacy-test-via-cabal: # needs similarly named cabal wrappers
cabal clean && cabal-ghc-8.2 configure && cabal-ghc-8.2 test
cabal clean && cabal-ghc-8.0 configure && cabal-ghc-8.0 test
cabal clean && cabal-ghc-7.10 configure && cabal-ghc-7.10 test
cabal clean && cabal-ghc-7.8 configure && cabal-ghc-7.8 test
cabal clean && cabal test
hlint:
hlint \
--ignore "Use import/export shortcut" \
--ignore "Redundant bracket" \
.
markdown:
pandoc README.md -o README.html
# NOTE: (very hacky!) the following target allows parallel compilation (-jN) of
# eg and tests programs so long as they don't share dependencies _not_ stored
# in src/ and tests/. Runnable binaries should depend on mk/toplibs instead of
# actual Haskell source files
mk/toplibs: mk/Toplibs.o
touch mk/toplibs
include mk/haskell.mk
diff-test-tiers: bench/tiers
./bench/tiers "Natural" | diff -rud test/diff/tiers-Natural.out -
./bench/tiers "Text" | diff -rud test/diff/tiers-Text.out -
./bench/tiers "ByteString" 6 | diff -rud test/diff/tiers-ByteString.out -
./bench/tiers "Set Int" | diff -rud test/diff/tiers-SetInt.out -
./bench/tiers "Set Bool" | diff -rud test/diff/tiers-SetBool.out -
./bench/tiers "Map Int Int" | diff -rud test/diff/tiers-MapIntInt.out -
./bench/tiers "Map Bool Bool" | diff -rud test/diff/tiers-MapBoolBool.out -
./bench/tiers "Seq Int" | diff -rud test/diff/tiers-SeqInt.out -
./bench/tiers "Seq Bool" | diff -rud test/diff/tiers-SeqBool.out -
./bench/tiers "IntMap Int" | diff -rud test/diff/tiers-IntMapInt.out -
./bench/tiers "IntSet" | diff -rud test/diff/tiers-IntSet.out -
./bench/tiers "UTCTime" 6 | diff -rud test/diff/tiers-UTCTime.out -
./bench/tiers "Day" 9 | diff -rud test/diff/tiers-Day.out -
./bench/tiers "DiffTime" | diff -rud test/diff/tiers-DiffTime.out -
./bench/tiers "Array Int Int" | diff -rud test/diff/tiers-ArrayIntInt.out -
update-diff-test-tiers: bench/tiers
./bench/tiers "Natural" > test/diff/tiers-Natural.out
./bench/tiers "Text" > test/diff/tiers-Text.out
./bench/tiers "ByteString" 6 > test/diff/tiers-ByteString.out
./bench/tiers "Set Int" > test/diff/tiers-SetInt.out
./bench/tiers "Set Bool" > test/diff/tiers-SetBool.out
./bench/tiers "Map Int Int" > test/diff/tiers-MapIntInt.out
./bench/tiers "Map Bool Bool" > test/diff/tiers-MapBoolBool.out
./bench/tiers "Seq Int" > test/diff/tiers-SeqInt.out
./bench/tiers "Seq Bool" > test/diff/tiers-SeqBool.out
./bench/tiers "IntMap Int" > test/diff/tiers-IntMapInt.out
./bench/tiers "IntSet" > test/diff/tiers-IntSet.out
./bench/tiers "UTCTime" 6 > test/diff/tiers-UTCTime.out
./bench/tiers "Day" 9 > test/diff/tiers-Day.out
./bench/tiers "DiffTime" > test/diff/tiers-DiffTime.out
./bench/tiers "Array Int Int" > test/diff/tiers-ArrayIntInt.out