Skip to content

Commit

Permalink
add cross platform test task
Browse files Browse the repository at this point in the history
  • Loading branch information
watawuwu committed Dec 11, 2018
1 parent c355429 commit 8f73751
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down

0 comments on commit 8f73751

Please sign in to comment.