-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (42 loc) · 1.59 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
RESOLVER = --resolver lts-13.7
RANDOM = --package random
LENS = --package lens
GENERIC_LENS = --package generic-lens
INTRODUCTION = LensesIntroduction.hs
OVERVIEW = LensLibraryOverview.hs
USING = UsingTheLensLibrary.hs
.PHONY: list
list: ## Show available targets.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##\s*\(.*\)/\n\t\1\n/'
.PHONY: repl-intro
repl-intro: ## Load LensesIntroduction.hs in ghci.
@which stack > /dev/null
@stack repl $(RESOLVER) $(RANDOM) $(INTRODUCTION)
.PHONY: watch-intro
watch-intro: ## Watch LensesIntroduction.hs in ghcid.
@which ghcid > /dev/null
@ghcid --command="stack repl $(RESOLVER) $(RANDOM)" $(INTRODUCTION)
.PHONY: repl-overview
repl-overview: ## Load LensLibraryOverview.hs in ghci.
@which stack > /dev/null
@stack repl $(RESOLVER) $(LENS) $(OVERVIEW)
.PHONY: watch-overview
watch-overview: ## Watch LensLibraryOverview.hs is ghcid.
@which ghcid > /dev/null
@ghcid --command="stack repl $(RESOLVER) $(LENS)" $(OVERVIEW)
.PHONY: repl-using
repl-using: ## Load UsingTheLensLibrary.hs in ghci.
@which stack > /dev/null
@stack repl $(RESOLVER) $(LENS) $(GENERIC_LENS) $(USING)
.PHONY: watch-using
watch-using: ## Watch UsingTheLensLibrary.hs in ghcid.
@which ghcid > /dev/null
@ghcid --command="stack repl $(RESOLVER) $(LENS) $(GENERIC_LENS)" $(USING)
.PHONY: test
test: ## Test-compile Haskell source files.
@which stack > /dev/null
@stack ghc $(RESOLVER) $(RANDOM) $(INTRODUCTION)
@stack ghc $(RESOLVER) $(LENS) $(OVERVIEW)
@stack ghc $(RESOLVER) $(LENS) $(GENERIC_LENS) $(USING)
@rm *.hi
@rm *.o