-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
147 lines (117 loc) · 3.31 KB
/
Makefile
File metadata and controls
147 lines (117 loc) · 3.31 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Makefile for express
#
# Copyright: (c) 2015-2024 Rudy Matela
# License: 3-Clause BSD (see the file LICENSE)
# Maintainer: Rudy Matela <rudy@matela.com.br>
TESTS = \
test/main \
test/core \
test/basic \
test/map \
test/instances \
test/fixtures \
test/express \
test/express-derive \
test/name \
test/name-derive \
test/utils \
test/canon \
test/match \
test/hole \
test/fold \
test/show \
test/ord \
test/triexpr \
test/listable
EGS =
BENCHS = \
eg/u-extrapolate \
eg/u-speculate \
eg/u-conjure \
bench/compare \
bench/match-list \
bench/match-noop \
bench/match-triexpr \
bench/pairs \
bench/sort \
bench/tiers \
bench/tiers-complete \
$(EGS)
GHCIMPORTDIRS = src:test
GHCFLAGS = -O2 -v0 $(shell grep -q "Arch Linux" /etc/lsb-release && echo -dynamic)
HUGSIMPORTDIRS = .:./src:./test:./etc/hugs-backports:/usr/lib/hugs/packages/*:../leancheck/src
HUGSFLAGS = -98 -h32M
RUNPARAMETERS =
LIB_DEPS = base template-haskell
INSTALL_DEPS = leancheck template-haskell
# to run a specific test suite under a specific GHC, do:
# $ make clean
# $ make GHC=ghc-9.6 GHCIMPORTDIRS=src:test:../leancheck/src test/utils.run
# this is useful for troubleshooting CI failures
all: mk/toplibs
all-all: mk/All.o
test: $(patsubst %,%.run,$(TESTS)) test-sdist diff-test
slow-test: RUNPARAMETERS=50400
slow-test: test
%.run: %
./$< $(RUNPARAMETERS)
.PHONY: bench
bench: $(patsubst %,%.bench,$(BENCHS))
@mkdir -p bench/runtime/$$HOSTNAME
./bench/versions | tee bench/runtime/$$HOSTNAME/versions
.PHONY: %.bench
%.bench: %
@mkdir -p bench/runtime/$$HOSTNAME/$<
@rmdir bench/runtime/$$HOSTNAME/$<
@printf "%-20s " $<
@/usr/bin/time -f%e ./$< 2>&1 >/dev/null | tee bench/runtime/$$HOSTNAME/$<.runtime
clean: clean-hi-o clean-haddock
rm -f $(TESTS) $(BENCHS) $(EGS) mk/toplibs
ghci: mk/All.ghci
hugs: src/Data/Express/Core.hugs
hugs-test: \
test/typecheck.runhugs
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 express:test:main --ghc-options="$(GHCFLAGS) -O0" --system-ghc --no-install-ghc --no-terminal
diff-test: $(patsubst %,%.diff,$(BENCHS))
txt: $(patsubst %,%.txt,$(BENCHS))
%.diff: %
./$< | diff -rud $<.txt -
%.txt: %
./$< >$<.txt
test-via-everything: test test-via-cabal test-via-stack
test-on-ghc-9.10:
make test GHC=ghc-9.10 GHCIMPORTDIRS=src:test:../leancheck/src
prepare:
cabal update
cabal install $(ALL_DEPS) --lib
hlint: ..hlint
test.hlint: HLINT_EXTRA = --ignore "Redundant ==" \
--ignore "Use null" \
--ignore "Redundant $$" \
--ignore "Use isNothing"
%.hlint:
hlint $(HLINT_EXTRA) \
--ignore "Use import/export shortcut" \
--ignore "Redundant bracket" \
--ignore "Use lambda-case" \
--ignore "Use typeRep" \
$*
markdown: README.html
%.html: %.md
pandoc $< -o $@
# NOTE: (very hacky!) the following target allows parallel compilation (-jN) of
# eg and test programs so long as they don't share dependencies _not_ stored
# in src/ and test/. 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