rust-static-binary-example/makefile

17 lines
468 B
Makefile
Raw Permalink Normal View History

2020-02-07 10:11:23 -06:00
TARGET := x86_64-unknown-linux-musl
BUILD_DIR := target/${TARGET}/release
BIN_NAME := hello_world
2020-02-07 10:15:08 -06:00
.PHONY: build docker-image docker-run
2020-02-07 10:11:23 -06:00
build: ${BUILD_DIR}/${BIN_NAME}
${BUILD_DIR}/${BIN_NAME}:
cargo build --target ${TARGET} --release; strip ${BUILD_DIR}/${BIN_NAME}; upx ${BUILD_DIR}/${BIN_NAME}
docker-image: ${BUILD_DIR}/${BIN_NAME}
docker build -t hello_world_rust_static_binary:1.0.0 .
docker-run:
docker run -it --rm hello_world_rust_static_binary:1.0.0