Improve Makefile #1
Owner
```Makefile
PRODUCT = "pulsar-sentinel"
#BUILD_TAG = `git describe --tag`
BUILD_TAG = 'v0.9.0'
TAG = $(shell echo $(BUILD_TAG) | sed s/^v//)
ARCH = $(shell go env GOARCH)
OS = $(shell go env GOOS)
build:
CGO_ENABLED=0 go build -ldflags '-extldflags "-static"' -ldflags "-X main.Version=$(BUILD_TAG)"
package: build
mkdir -p dist/$(PRODUCT)-$(TAG)-$(OS)-$(ARCH)
cp $(PRODUCT) dist/$(PRODUCT)-$(TAG)-$(OS)-$(ARCH)/
cp README.md dist/$(PRODUCT)-$(TAG)-$(OS)-$(ARCH)/
tar -czvf $(PRODUCT)-$(TAG)-$(OS)-$(ARCH).tar.gz -C dist $(PRODUCT)-$(TAG)-$(OS)-$(ARCH)
clean:
rm -rf dist $(PRODUCT) *.tar.gz
all: package
.DEFAULT_GOAL := all
.PHONY: all build package clean
```
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?