From 8f7375124bf43475eb73a610d4eaf533bde1b991 Mon Sep 17 00:00:00 2001 From: Wataru Matsui Date: Tue, 11 Dec 2018 19:53:21 +0900 Subject: [PATCH] add cross platform test task --- Makefile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 94a8bd8..9ca48bf 100644 --- a/Makefile +++ b/Makefile @@ -33,14 +33,6 @@ check: ## Check syntax, but don't build object files build: lint ## Build all project $(CARGO_COMMAND) build $(CARGO_SUB_OPTIONS) -release-build: lint ## Build all project - $(MAKE) build CARGO_SUB_OPTIONS="--release" - -cross-build: ## Build all platform - $(MAKE) build CARGO_SUB_OPTIONS="--target x86_64-apple-darwin --release" - $(MAKE) build CARGO_SUB_OPTIONS="--target x86_64-pc-windows-gnu --release" - $(MAKE) build CARGO_SUB_OPTIONS="--target x86_64-unknown-linux-musl --release" CROSS_COMPILE="x86_64-linux-musl-" - update: ## Update modules $(CARGO_COMMAND) update @@ -61,6 +53,19 @@ clippy: ## Run clippy lint: fmt clippy ## Run fmt and clippy +release-build: lint ## Build all project + $(MAKE) build CARGO_SUB_OPTIONS="--release" + +cross-build: ## Build all platform + -$(MAKE) build CARGO_SUB_OPTIONS="--target x86_64-apple-darwin --release" + -$(MAKE) build CARGO_SUB_OPTIONS="--target x86_64-pc-windows-gnu --release" + -$(MAKE) build CARGO_SUB_OPTIONS="--target x86_64-unknown-linux-musl --release" CROSS_COMPILE="x86_64-linux-musl-" + +cross-test: ## Build all platform + -$(MAKE) test CARGO_SUB_OPTIONS="--target x86_64-apple-darwin --release" + -$(MAKE) test CARGO_SUB_OPTIONS="--target x86_64-pc-windows-gnu --release" + -$(MAKE) test CARGO_SUB_OPTIONS="--target x86_64-unknown-linux-musl --release" CROSS_COMPILE="x86_64-linux-musl-" + help: ## Print help echo -e "Usage: make [task]\n\nTasks:" perl -nle 'printf(" \033[33m%-20s\033[0m %s\n",$$1,$$2) if /^([a-zA-Z_-]*?):(?:.+?## )?(.*?)$$/' $(MAKEFILE_LIST)