-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
31 lines (21 loc) · 805 Bytes
/
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
HS_LIBDIR = $(shell cd src && stack ghc -- --print-libdir)
BIN_PATH = $(shell cd src && stack path --dist-dir --allow-different-user)
BIN := cheonjae
BUILD_CONTAINER := ${BIN}-builder
bin: FORCE
cd src && stack build --allow-different-user
make copy
watch: FORCE
cd src && stack build --allow-different-user --file-watch --exec "make -C ./.. copy"
copy: FORCE
cp src/${BIN_PATH}/build/${BIN}/${BIN} bin/;
docker-build-container:
sudo docker build -t ${BUILD_CONTAINER} -f docker/Dockerfile-build .
docker-build: docker-build-container
sudo docker run -it -v $$(pwd):/app ${BUILD_CONTAINER} bash -c 'cd /app/; make bin'
docker-build-watch: docker-build-container
sudo docker run -it -v $$(pwd):/app ${BUILD_CONTAINER} bash -c 'cd /app/; make watch'
clean:
rm bin/*
.PHONY: clean
FORCE: ;