2024-10-26 17:04:22 +00:00
|
|
|
prefix = /usr/local
|
|
|
|
|
|
|
|
# Support upper case PREFIX
|
|
|
|
ifneq ($(PREFIX),)
|
|
|
|
prefix := $(PREFIX)
|
|
|
|
endif
|
|
|
|
|
|
|
|
bindir = $(prefix)/bin
|
|
|
|
builddir = ./build
|
|
|
|
|
2024-11-13 18:29:13 +00:00
|
|
|
VERSION = 0.0.6
|
2024-10-26 17:04:22 +00:00
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
build:
|
2024-10-26 17:10:06 +00:00
|
|
|
go build -o $(builddir)/
|
2024-10-26 17:04:22 +00:00
|
|
|
|
|
|
|
.PHONY: install
|
|
|
|
install: build
|
|
|
|
install -m 0755 $(builddir)/yr $(bindir)
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f $(builddir)/*
|
|
|
|
rm -rf yr-*
|
|
|
|
rm -f yr-*.tar.gz
|
|
|
|
|
|
|
|
.PHONY: build-release
|
|
|
|
build-release: build
|
|
|
|
mkdir -p yr-$(VERSION)
|
|
|
|
cp $(builddir)/yr* yr-$(VERSION)/
|
|
|
|
|
|
|
|
tar czf yr-$(VERSION)-$(GOOS)-$(ARCH).tar.gz yr-$(VERSION)
|
2024-10-26 17:15:57 +00:00
|
|
|
hut git artifact upload --rev $(TAG) yr-$(VERSION)-$(GOOS)-$(ARCH).tar.gz
|
2024-10-26 17:04:22 +00:00
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
test:
|
|
|
|
go test ./...
|
|
|
|
|
|
|
|
.PHONY: vet
|
|
|
|
vet:
|
|
|
|
go vet ./...
|