-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
36 lines (28 loc) · 871 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
32
33
34
35
36
BUILD_DIR = bin
BUILD_DOCKER_IMAGE = boruta-build-img
BUILD_DOCKER_CONTAINER = boruta-build
BINARIES = boruta dryad_armv7 dryad_amd64
BINARIES := $(addprefix ${BUILD_DIR}/, ${BINARIES})
.PHONY: all
all: docker-build
.PHONY: clean
clean: clean-docker-build
.PHONY: docker-build
docker-build: ${BINARIES}
docker rm "${BUILD_DOCKER_CONTAINER}"
${BINARIES}: docker-container | ${BUILD_DIR}
docker cp "${BUILD_DOCKER_CONTAINER}:/$(@F)" $@
.PHONY: docker-container
docker-container: docker-build-img
docker create --name "${BUILD_DOCKER_CONTAINER}" "${BUILD_DOCKER_IMAGE}"
.PHONY: docker-build-img
docker-build-img:
docker build --tag "${BUILD_DOCKER_IMAGE}" .
${BUILD_DIR}:
mkdir -p "${BUILD_DIR}"
.PHONY: clean-docker-build
clean-docker-build:
-docker rm "${BUILD_DOCKER_CONTAINER}"
-docker rmi "${BUILD_DOCKER_IMAGE}"
-rm -f ${BINARIES}
-rmdir ${BUILD_DIR}