2017-03-18 00:38:03 +00:00
|
|
|
NAME=ctop
|
|
|
|
VERSION=$(shell cat VERSION)
|
|
|
|
BUILD=$(shell git rev-parse --short HEAD)
|
2020-10-25 14:22:47 +00:00
|
|
|
LD_FLAGS="-w -X main.version=$(VERSION) -X main.build=$(BUILD)"
|
2017-03-18 00:38:03 +00:00
|
|
|
|
|
|
|
clean:
|
2017-07-12 03:16:50 +00:00
|
|
|
rm -rf _build/ release/
|
2017-03-18 00:38:03 +00:00
|
|
|
|
|
|
|
build:
|
2018-12-01 17:50:47 +00:00
|
|
|
go mod download
|
2017-03-18 00:38:03 +00:00
|
|
|
CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o ctop
|
|
|
|
|
|
|
|
build-all:
|
2017-11-18 07:51:15 +00:00
|
|
|
mkdir -p _build
|
2021-06-13 13:12:27 +00:00
|
|
|
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o _build/ctop-$(VERSION)-darwin-amd64
|
|
|
|
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o _build/ctop-$(VERSION)-linux-amd64
|
|
|
|
GOOS=linux GOARCH=arm CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o _build/ctop-$(VERSION)-linux-arm
|
|
|
|
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o _build/ctop-$(VERSION)-linux-arm64
|
|
|
|
GOOS=linux GOARCH=ppc64le CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o _build/ctop-$(VERSION)-linux-ppc64le
|
|
|
|
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o _build/ctop-$(VERSION)-windows-amd64
|
2017-11-18 07:51:15 +00:00
|
|
|
cd _build; sha256sum * > sha256sums.txt
|
2017-03-18 00:38:03 +00:00
|
|
|
|
2019-07-02 20:13:46 +00:00
|
|
|
run-dev:
|
|
|
|
rm -f ctop.sock ctop
|
|
|
|
go build -ldflags $(LD_FLAGS) -o ctop
|
|
|
|
CTOP_DEBUG=1 ./ctop
|
|
|
|
|
2017-03-19 04:26:25 +00:00
|
|
|
image:
|
2017-03-19 06:14:56 +00:00
|
|
|
docker build -t ctop -f Dockerfile .
|
2017-03-19 04:26:25 +00:00
|
|
|
|
2017-03-18 00:38:03 +00:00
|
|
|
release:
|
2017-07-12 03:16:50 +00:00
|
|
|
mkdir release
|
|
|
|
cp _build/* release
|
2020-11-13 20:35:40 +00:00
|
|
|
cd release; sha256sum --quiet --check sha256sums.txt && \
|
|
|
|
gh release create $(VERSION) -d -t v$(VERSION) *
|
2017-03-18 00:38:03 +00:00
|
|
|
|
|
|
|
.PHONY: build
|