-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
54 lines (41 loc) · 1.39 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
SOURCE = $(shell find src -name '*.lhs' -o -name '*.hs')
.PHONY: clean install-hasktags TAGS bash-completion
# From https://stackoverflow.com/questions/18649427/using-a-makefile-with-cabal
# If 'cabal install' fails in building or installing, the
# timestamp on the build dir 'dist' may still be updated. So,
# we set the timestamp on the build dir to a long time in the past
# with 'touch --date "@0"' in case cabal fails.
CABAL_INSTALL = \
cabal install --overwrite-policy=always \
|| { touch --date "@0" dist ; \
exit 42 ; }
install: $(SOURCE)
$(CABAL_INSTALL)
ln -sf `which mary` .
ifeq ("$(wildcard ./config.php)","")
@echo "No config.php found, creating one from config.php.sample"
cp ./config.php.sample ./config.php
endif
clean:
rm -rf dist dist-newstyle TAGS
install-hasktags:
cabal update
cabal install hasktags
.PHONY: test-all test test-mary test-mary-all test-js test-shonkier
test-all:
cabal new-run mary-tests -- -i
test:
cabal new-run mary-tests -- -i --regex-exclude "dot|store"
test-mary:
cabal new-run mary-tests -- -i -p Mary --regex-exclude "dot|store"
test-mary-all:
cabal new-run mary-tests -- -i -p Mary
test-shonkier:
cabal new-run mary-tests -- -i -p '$$2 == "Shonkier"'
test-js:
cabal new-run mary-tests -- -i -p ShonkierJS
TAGS:
hasktags --etags .
bash-completion:
# Use as follows: source <(make bash-completion)
mary --bash-completion-script `which mary`