-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
44 lines (35 loc) · 1.25 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 = libdecaf
PROJECT_DESCRIPTION = libdecaf NIF for ECDH (X25519, X448), EdDSA (Ed25519, Ed25519ctx, Ed25519ph, Ed448, Ed448ph), curve25519, curve448, spongerng
PROJECT_VERSION = 2.1.1
include erlang.mk
.PHONY: docker-build docker-load docker-setup docker-save docker-shell docker-test
DOCKER_OTP_VERSION ?= 25.0.4-alpine-3.16.1
docker-build::
$(gen_verbose) docker build \
--tag ${PROJECT}-${DOCKER_OTP_VERSION} \
--file test/Dockerfile \
--build-arg OTP_VERSION=${DOCKER_OTP_VERSION} \
test
docker-load::
$(gen_verbose) docker load \
-i "${PROJECT}-${DOCKER_OTP_VERSION}/image.tar"
docker-save::
$(verbose) mkdir -p "${PROJECT}-${DOCKER_OTP_VERSION}"
$(gen_verbose) docker save \
-o "${PROJECT}-${DOCKER_OTP_VERSION}/image.tar" \
${PROJECT}-${DOCKER_OTP_VERSION}
docker-setup::
$(verbose) if [ -f "${PROJECT}-${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/${PROJECT}" --rm -it "${PROJECT}-${DOCKER_OTP_VERSION}" \
/bin/bash -l
docker-test::
$(gen_verbose) docker run \
-v "$(shell pwd)":"/build/${PROJECT}" "${PROJECT}-${DOCKER_OTP_VERSION}" \
/bin/bash -c 'cd ${PROJECT} && make ct'