index : static-web-server.git

ascending towards madness

author Jose Quintana <joseluisquintana20@gmail.com> 2020-02-05 9:34:39.0 +00:00:00
committer Jose Quintana <joseluisquintana20@gmail.com> 2020-02-05 9:34:39.0 +00:00:00
commit
27dd9ff7b2fd8e25da09f909e0e03802515bc71d [patch]
tree
ffcdd9d7efc2ed189a08cd3f62551e1a8e5bafe4
parent
dabed7eb2edcb5b84f2f48d59b69b2d9b3642df2
download
27dd9ff7b2fd8e25da09f909e0e03802515bc71d.tar.gz

chore: makefile rust-linux-darwin-builder tasks



Diff

 Makefile | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index dc92186..914f168 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
PKG_TARGET=x86_64-unknown-linux-musl
PKG_TARGET_DARWIN=x86_64-apple-darwin
RUST_VERSION=$(shell rustc --version | cut -d ' ' -f2)

PKG_BIN_PATH=./bin
PKG_TMP_PATH=/tmp
@@ -40,8 +41,13 @@ linux:
		--user rust:rust \
		--volume ${PWD}:/home/rust/static-web-server \
		--workdir /home/rust/static-web-server \
		joseluisq/rust-linux-darwin-builder:latest \
		sh -c "sudo chown -R rust:rust ./target && cargo build --release --target $(PKG_TARGET)"
		joseluisq/rust-linux-darwin-builder:$(RUST_VERSION) \
		sh -c "rustc --version && \
			mkdir -p target bin && \
			cargo build --release --target $(PKG_TARGET) && \
			cp -rf ./target/$(PKG_TARGET)/release/$(PKG_NAME) $(PKG_BIN_PATH)/$(PKG_NAME)-linux && \
			strip $(PKG_BIN_PATH)/$(PKG_NAME)-linux && \
			du -sh $(PKG_BIN_PATH)/*"
.PHONY: linux

darwin:
@@ -49,8 +55,13 @@ darwin:
		--user rust:rust \
		--volume ${PWD}:/home/rust/static-web-server \
		--workdir /home/rust/static-web-server \
		joseluisq/rust-linux-darwin-builder:latest \
		sh -c "sudo chown -R rust:rust ./target && cargo build --release --target $(PKG_TARGET_DARWIN)"
		joseluisq/rust-linux-darwin-builder:$(RUST_VERSION) && \
		sh -c "rustc --version && \
			mkdir -p target bin && \
			cargo build --release --target $(PKG_TARGET_DARWIN) && \
			cp -rf ./target/$(PKG_TARGET_DARWIN)/release/$(PKG_NAME) $(PKG_BIN_PATH)/$(PKG_NAME)-darwin && \
			strip $(PKG_BIN_PATH)/$(PKG_NAME)-darwin && \
			du -sh $(PKG_BIN_PATH)/*"
.PHONY: darwin

#######################################