Skip to content

Commit 212568e

Browse files
authored
Update Makefile (#145)
Quality-of-life improvements.
1 parent 006b27d commit 212568e

1 file changed

Lines changed: 24 additions & 5 deletions

File tree

tests/data/simple/Makefile

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
1-
CABAL = cabal \
2-
--offline \
3-
$(if $(GHC), --with-compiler=$(GHC))
1+
CABAL_OPTS ?=
2+
CABAL ?= cabal \
3+
--offline \
4+
$(if $(GHC), --with-compiler=$(GHC)) \
5+
$(CABAL_OPTS)
6+
7+
CABAL_REPL ?= $(CABAL) \
8+
--repl-option -fdiagnostics-color=always \
9+
-flocal-dev v2-repl lib:test-dev
10+
11+
GHCIWATCH_OPTS ?=
12+
GHCIWATCH ?= ../../../target/release/ghciwatch \
13+
--command "$(CABAL_REPL)" \
14+
--before-startup-shell "make my-simple-package.cabal" \
15+
--watch src \
16+
--watch test \
17+
--watch test-main \
18+
$(GHCIWATCH_OPTS)
419

520
my-simple-package.cabal: package.yaml
621
hpack .
@@ -11,8 +26,12 @@ test: my-simple-package.cabal
1126
$(CABAL) test
1227
$(CABAL) -flocal-dev build
1328
$(CABAL) -flocal-dev test
14-
echo ":quit" | $(CABAL) -flocal-dev repl lib:test-dev
29+
echo ":quit" | $(CABAL_REPL)
1530

1631
.PHONY: ghci
1732
ghci: my-simple-package.cabal
18-
$(CABAL) -flocal-dev repl lib:test-dev
33+
$(CABAL_REPL)
34+
35+
.PHONY: ghciwatch
36+
ghciwatch:
37+
$(GHCIWATCH)

0 commit comments

Comments
 (0)