From 1b2723dae03d25159fc13e08b8fe502cb60fff6f Mon Sep 17 00:00:00 2001 From: zhourong Date: Tue, 8 Dec 2020 16:32:06 +0800 Subject: [PATCH] fix(makefile): support TAGS in building order plugin --- Makefile | 4 ++-- internal/plugins/Makefile | 8 ++++++++ scripts/cluster.sh | 4 ++-- scripts/solo.sh | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 9fbcbe5..d7964fc 100644 --- a/Makefile +++ b/Makefile @@ -88,10 +88,10 @@ linter: ## make cluster: Run cluster including 4 nodes cluster:install${TAGS} - @cd scripts && bash cluster.sh + @cd scripts && bash cluster.sh TAGS=${TAGS} ## make solo: Run one node in solo mode solo:install${TAGS} - @cd scripts && bash solo.sh + @cd scripts && bash solo.sh TAGS=${TAGS} .PHONY: tester build diff --git a/internal/plugins/Makefile b/internal/plugins/Makefile index f62c799..1ba5a93 100644 --- a/internal/plugins/Makefile +++ b/internal/plugins/Makefile @@ -9,10 +9,18 @@ raft: @mkdir -p build $(GO) build --buildmode=plugin -o build/raft.so order/etcdraft/*.go +raftent: + @mkdir -p build + $(GO) build --buildmode=plugin -modfile ../../goent.mod -o build/raft.so order/etcdraft/*.go + ## make solo: build plugin (make plugin type= ) solo: @mkdir -p build $(GO) build --buildmode=plugin -o build/solo.so order/solo/*.go +soloent: + @mkdir -p build + $(GO) build --buildmode=plugin -modfile ../../goent.mod -o build/solo.so order/solo/*.go + ## make plugins: build plugins (make plugin type= and ) plugins: raft solo diff --git a/scripts/cluster.sh b/scripts/cluster.sh index 40f224e..650894d 100755 --- a/scripts/cluster.sh +++ b/scripts/cluster.sh @@ -55,7 +55,7 @@ function prepare() { print_blue "===> Building plugin" cd "${PROJECT_PATH}"/internal/plugins - make raft + make raft${TAGS} for ((i = 1; i < N + 1; i = i + 1)); do cp -rf "${PROJECT_PATH}"/internal/plugins/build "${BUILD_PATH}"/node${i}/plugins @@ -65,7 +65,7 @@ function prepare() { function compile() { print_blue "===> Compiling bitxhub" cd "${PROJECT_PATH}" - make install + make install${TAGS} } function splitWindow() { diff --git a/scripts/solo.sh b/scripts/solo.sh index 7c65f72..6d7baa8 100755 --- a/scripts/solo.sh +++ b/scripts/solo.sh @@ -21,11 +21,11 @@ function config() { function compile() { print_blue "===> Compileing bitxhub" cd "${PROJECT_PATH}" - make install + make install${TAGS} ## build plugin cd "${PROJECT_PATH}"/internal/plugins - make solo + make solo${TAGS} } function start() {