From 62e7d964da5db846c475721d0666e0a11fa28fc9 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 6 Jun 2022 16:54:53 +0300 Subject: [PATCH] Makefile: alias `build` target Follow the https://github.com/nspcc-dev/neo-go/pull/2537#issuecomment-1147468063. --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f24c2996a..568d135fa 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ BRANCH = "master" REPONAME = "neo-go" NETMODE ?= "privnet" -BINARY=./bin/neo-go$(shell go env GOEXE) +BINARY=neo-go +BINARY_PATH=./bin/$(BINARY)$(shell go env GOEXE) DESTDIR = "" SYSCONFIGDIR = "/etc" BINDIR = "/usr/bin" @@ -22,7 +23,7 @@ IMAGE_REPO=nspccdev/neo-go # All of the targets are phony here because we don't really use make dependency # tracking for files -.PHONY: build bin deps image image-latest image-push image-push-latest check-version clean-cluster push-tag \ +.PHONY: build $(BINARY) deps image image-latest image-push image-push-latest check-version clean-cluster push-tag \ test vet lint fmt cover build: deps @@ -30,9 +31,9 @@ build: deps @set -x \ && export GOGC=off \ && export CGO_ENABLED=0 \ - && go build -trimpath -v -ldflags $(BUILD_FLAGS) -o ${BINARY} ./cli/main.go + && go build -trimpath -v -ldflags $(BUILD_FLAGS) -o ${BINARY_PATH} ./cli/main.go -bin: build +$(BINARY): build neo-go.service: neo-go.service.template @sed -r -e 's_BINDIR_$(BINDIR)_' -e 's_UNITWORKDIR_$(UNITWORKDIR)_' -e 's_SYSCONFIGDIR_$(SYSCONFIGDIR)_' $< >$@ @@ -45,7 +46,7 @@ install: build neo-go.service && cp ./config/protocol.mainnet.yml $(DESTDIR)$(SYSCONFIGDIR)/neo-go \ && cp ./config/protocol.privnet.yml $(DESTDIR)$(SYSCONFIGDIR)/neo-go \ && cp ./config/protocol.testnet.yml $(DESTDIR)$(SYSCONFIGDIR)/neo-go \ - && install -m 0755 -t $(BINDIR) $(BINARY) \ + && install -m 0755 -t $(BINDIR) $(BINARY_PATH) \ postinst: install @echo "=> Preparing directories and configs"