-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
64 lines (50 loc) · 1.54 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
SOURCEDIRS := library/ executable/ test/
TEST := stack build --test --haddock --no-haddock-deps --pedantic
test:
$(TEST) tasty-discover:test
.PHONY: test
sdist:
stack sdist
.PHONY: sdist
DIST_DIR:=$$(stack path --dist-dir)
SDIST_TAR:=$$(find $(DIST_DIR) -name "*.tar.gz" | tail -1)
untar_sdist: sdist
tar xzf $(SDIST_TAR)
.PHONY: untar_sdist
SDIST_FOLDER:=$$(basename $(SDIST_TAR) .tar.gz)
test_sdist: untar_sdist
cd $(SDIST_FOLDER) && $(TEST)
.PHONY: test_sdist
stylish_haskell_install:
stack install stylish-haskell
.PHONY: stylish_haskell_install
STYLISH=stylish-haskell -i {} \;
stylish_haskell: stylish_haskell_install
find $(SOURCEDIRS) -name "*.hs" -exec $(STYLISH) && git diff --exit-code
.PHONY: stylish_haskell
hlint_install:
stack install hlint
.PHONY: hlint_install
hlint_binary:
@curl -sL https://raw.github.com/ndmitchell/hlint/master/misc/travis.sh | sh -s -- --cpp-simple $(SOURCEDIRS)
.PHONY: hlint_binary
hlint: hlint_install
hlint --cpp-simple $(SOURCEDIRS)
.PHONY: hlint
hlint_apply_refact: hlint_install
stack install apply-refact
.PHONY: hlint_apply_refact
HLINT=hlint --cpp-simple --refactor --refactor-options -i {} \;
hlint_refactor: hlint_apply_refact
find $(SOURCEDIRS) -name "*.hs" -exec $(HLINT)
.PHONY: hlint_refactor
upload:
stack upload .
.PHONY: upload
test_readme_dependencies:
stack install markdown-unlit
stack build tasty-hunit tasty-hspec tasty-quickcheck tasty
.PHONY: test_readme_dependencies
test_readme: test_readme_dependencies
stack exec -- ghc -pgmL markdown-unlit README.lhs
.PHONY: test_readme