forked from bl4ck5un/mbedtls-SGX
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
19 lines (18 loc) · 784 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
MBEDTLS_VERSION=2.24.0
DOCKER_IMAGE_NAME=mbedtls-compat-sgx-$(MBEDTLS_VERSION)
LIB_BIN_DIR=mbedtls_SGX-$(MBEDTLS_VERSION)
LIB_INSTALL_PATH=/usr/src/app/build/$(LIB_BIN_DIR)
LOCAL_INSTALL_PATH=./build
image:
@echo "Building container $(DOCKER_IMAGE_NAME)..."
@docker build -t $(DOCKER_IMAGE_NAME) .
@echo "Done!"
lib: image
@$(eval CONTAINER_ID=$(shell docker run -d $(DOCKER_IMAGE_NAME)))
@echo "Saving library on path: $(LOCAL_INSTALL_PATH)/$(LIB_BIN_DIR)"
@mkdir -p $(LOCAL_INSTALL_PATH) && rm -rf $(LOCAL_INSTALL_PATH)/$(LIB_BIN_DIR) && docker cp $(CONTAINER_ID):$(LIB_INSTALL_PATH) $(LOCAL_INSTALL_PATH)
@docker stop $(CONTAINER_ID) > /dev/null
@docker rm $(CONTAINER_ID) > /dev/null
clean:
@docker rmi $(DOCKER_IMAGE_NAME)
@rm -rf $(LOCAL_INSTALL_PATH)/$(LIB_BIN_DIR)