-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
executable file
·57 lines (43 loc) · 1.28 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
# this file assumes you're already in a nix-shell
#
# this file build using setup commands (not nix-build)
CONFIG_FILE = dist/setup-config
CABAL_FILE = cbcast-lh.cabal
SETUP_CMD = runhaskell -hide-package=base Setup.hs
HS_FILES_CMD = find . -name '*hs'
# command to detect LH escapehatches
ESCAPES_CMD = grep --color=always '==!\|Admit\|undefined\|--check-var\|--skip-module' $$($(HS_FILES_CMD))
# command to detect programmer tasks
MESSES_CMD = grep --color=always 'TODO\|FIXME\|XXX\|QQQ\|NOTE\|MIGRATION' $$($(HS_FILES_CMD))
.PHONY: test build clean repl
test: build
time $(SETUP_CMD) test
# TODO use dist/build/%/% ? scan cabalfile for executable names?
build: $(CONFIG_FILE)
time $(SETUP_CMD) build
$(CONFIG_FILE): $(CABAL_FILE)
$(SETUP_CMD) configure --enable-tests
check: clean
if $(ESCAPES_CMD); then \
echo Found banned identifiers; false; \
fi
make build
clean: $(CABAL_FILE)
$(SETUP_CMD) clean
rm -v $(CABAL_FILE)
-find . -name '.liquid' -exec rm -rfv '{}' \;
%.cabal: package.yaml
hpack
## tools
repl: $(CONFIG_FILE)
$(SETUP_CMD) repl $(basename $(CABAL_FILE))
ghcid:
nix-shell -p ghcid --run 'ghcid -c make repl'
entr-build:
git ls-files | entr -c bash -c 'make build'
entr-test:
git ls-files | entr -c bash -c 'make test'
escapes:
$(ESCAPES_CMD)
messes:
$(MESSES_CMD)