forked from potatosalad/erlang-keccakf1600
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
44 lines (35 loc) · 1.17 KB
/
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
37
38
39
40
41
42
43
44
PROJECT = keccakf1600
PROJECT_DESCRIPTION = Keccak-f[1600] NIF with timeslice reductions for Erlang and Elixir.
PROJECT_VERSION = 3.0.0
include erlang.mk
.PHONY: docker-build docker-load docker-setup docker-save docker-shell docker-test
DOCKER_OTP_VERSION ?= 22.0
docker-build::
$(gen_verbose) docker build \
-t docker-otp-${DOCKER_OTP_VERSION} \
-f test/Dockerfile \
--build-arg OTP_VERSION=${DOCKER_OTP_VERSION} \
test
docker-load::
$(gen_verbose) docker load \
-i "docker-otp-${DOCKER_OTP_VERSION}/image.tar"
docker-save::
$(verbose) mkdir -p "docker-otp-${DOCKER_OTP_VERSION}"
$(gen_verbose) docker save \
-o "docker-otp-${DOCKER_OTP_VERSION}/image.tar" \
docker-otp-${DOCKER_OTP_VERSION}
docker-setup::
$(verbose) if [ -f "docker-otp-${DOCKER_OTP_VERSION}/image.tar" ]; then \
$(MAKE) docker-load; \
else \
$(MAKE) docker-build; \
$(MAKE) docker-save; \
fi
docker-shell::
$(verbose) docker run \
-v "$(shell pwd)":"/build/keccakf1600" --rm -it "docker-otp-${DOCKER_OTP_VERSION}" \
/bin/bash -l
docker-test::
$(gen_verbose) docker run \
-v "$(shell pwd)":"/build/keccakf1600" "docker-otp-${DOCKER_OTP_VERSION}" \
sh -c 'cd keccakf1600 && make tests'