-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.docker
43 lines (35 loc) · 1 KB
/
Makefile.docker
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
# The name for the docker builder image
BUILDER_CONTAINER_NAME="milagro-crypto/amcl-builder"
# Coverage info
COVERAGE_INFO=target/LINUX_64BIT_COVERAGE/coverage/amcl.info
define make
rm -rf target
docker create \
--env WINEPREFIX=/tmp/.wine \
--name builder \
--workdir /src \
$(BUILDER_CONTAINER_NAME) sh -c "mkdir -p /tmp/.wine && make $1"
docker cp . builder:/src
-docker start -ai builder; \
echo $$? > buildall.exit
docker cp builder:/src/target .
docker stop builder
docker rm builder
@# Workaround: Correct path for coverage src files
ls ${COVERAGE_INFO} && sed -i -e "s#^SF:/src\(.*\)#SF:${PWD}\1#g" ${COVERAGE_INFO} || echo "Skipping coverage info"
@mv buildall.exit target
@exit `cat target/buildall.exit`
endef
all: builder
builder:
docker build -t $(BUILDER_CONTAINER_NAME) .
# --- MAKE TARGETS DOCKER WRAPPERS ---
default:
$(call make,default)
qa:
$(call make,qa)
build:
$(call make,build TYPE=$(TYPE))
buildall:
$(call make,buildall)
.PHONY: all builder default qa build buildall