Add a Makefile

We can make things easier on contributors if we setup a build system.
We can also make CI easier if we use Make.
This commit is contained in:
joneshf 2018-07-24 23:07:03 -07:00
parent 9de1efa855
commit a53fe52f09
No known key found for this signature in database
GPG Key ID: C8FFFC4E889B880E
2 changed files with 37 additions and 0 deletions

2
.gitignore vendored
View File

@ -1,6 +1,8 @@
### Project specific ###
*.cabal
.make
bin
# Created by https://www.gitignore.io/api/vim,osx,linux,macos,emacs,windows,haskell,visualstudiocode

35
Makefile Normal file
View File

@ -0,0 +1,35 @@
BIN := bin
EMPTY := .make
GHCID := $(BIN)/ghcid
STACK := stack
STACK_WORK := .stack-work
.DEFAULT_GOAL := build
$(EMPTY):
mkdir $@
$(EMPTY)/stack-setup: | $(EMPTY)
$(STACK) setup
touch $@
$(GHCID): $(EMPTY)/stack-setup
$(STACK) install ghcid --local-bin-path $(BIN)
.PHONY: build
build: $(EMPTY)/stack-setup
$(STACK) build --no-run-tests --test
.PHONY: clean
clean:
rm -f $(BIN)/*
rm -f $(EMPTY)/*
rm -fr $(STACK_WORK)
.PHONY: test
test: build
$(STACK) test
.PHONY: watch
watch: $(GHCID)
$(GHCID)