Makefile: alias build target

Follow the
https://github.com/nspcc-dev/neo-go/pull/2537#issuecomment-1147468063.
This commit is contained in:
Anna Shaleva 2022-06-06 16:54:53 +03:00
parent de6cdb6d5a
commit 62e7d964da

View file

@ -1,7 +1,8 @@
BRANCH = "master" BRANCH = "master"
REPONAME = "neo-go" REPONAME = "neo-go"
NETMODE ?= "privnet" NETMODE ?= "privnet"
BINARY=./bin/neo-go$(shell go env GOEXE) BINARY=neo-go
BINARY_PATH=./bin/$(BINARY)$(shell go env GOEXE)
DESTDIR = "" DESTDIR = ""
SYSCONFIGDIR = "/etc" SYSCONFIGDIR = "/etc"
BINDIR = "/usr/bin" 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 # All of the targets are phony here because we don't really use make dependency
# tracking for files # 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 test vet lint fmt cover
build: deps build: deps
@ -30,9 +31,9 @@ build: deps
@set -x \ @set -x \
&& export GOGC=off \ && export GOGC=off \
&& export CGO_ENABLED=0 \ && 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 neo-go.service: neo-go.service.template
@sed -r -e 's_BINDIR_$(BINDIR)_' -e 's_UNITWORKDIR_$(UNITWORKDIR)_' -e 's_SYSCONFIGDIR_$(SYSCONFIGDIR)_' $< >$@ @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.mainnet.yml $(DESTDIR)$(SYSCONFIGDIR)/neo-go \
&& cp ./config/protocol.privnet.yml $(DESTDIR)$(SYSCONFIGDIR)/neo-go \ && cp ./config/protocol.privnet.yml $(DESTDIR)$(SYSCONFIGDIR)/neo-go \
&& cp ./config/protocol.testnet.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 postinst: install
@echo "=> Preparing directories and configs" @echo "=> Preparing directories and configs"