ctop/Makefile

38 lines
1.4 KiB
Makefile
Raw Permalink Normal View History

2017-03-18 01:38:03 +01:00
NAME=ctop
VERSION=$(shell cat VERSION)
BUILD=$(shell git rev-parse --short HEAD)
LD_FLAGS="-w -X main.version=$(VERSION) -X main.build=$(BUILD)"
2017-03-18 01:38:03 +01:00
clean:
2017-07-12 05:16:50 +02:00
rm -rf _build/ release/
2017-03-18 01:38:03 +01:00
build:
2018-12-01 18:50:47 +01:00
go mod download
2017-03-18 01:38:03 +01:00
CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o ctop
build-all:
2017-11-18 08:51:15 +01:00
mkdir -p _build
2021-06-13 15:12:27 +02: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 08:51:15 +01:00
cd _build; sha256sum * > sha256sums.txt
2017-03-18 01:38:03 +01:00
2019-07-02 22:13:46 +02:00
run-dev:
rm -f ctop.sock ctop
go build -ldflags $(LD_FLAGS) -o ctop
CTOP_DEBUG=1 ./ctop
image:
docker build -t ctop -f Dockerfile .
2017-03-18 01:38:03 +01:00
release:
2017-07-12 05:16:50 +02:00
mkdir release
cp _build/* release
2020-11-13 21:35:40 +01:00
cd release; sha256sum --quiet --check sha256sums.txt && \
2021-07-01 21:32:32 +02:00
gh release create v$(VERSION) -d -t v$(VERSION) *
2017-03-18 01:38:03 +01:00
.PHONY: build