keyproofs/Makefile

39 lines
827 B
Makefile
Raw Normal View History

2020-11-23 14:55:04 -07:00
NAME=sour.is-keyproofs
2020-11-23 13:58:19 -07:00
BUMP?=current
DATE:=$(shell date -u +%FT%TZ)
2020-11-28 15:17:44 -07:00
HASH:=$(shell git rev-parse HEAD 2> /dev/null)
2020-11-23 13:58:19 -07:00
VERSION:=$(shell BUMP=$(BUMP) ./version.sh)
2020-11-23 14:55:04 -07:00
build: $(NAME)
clean:
rm -f $(NAME)
2020-11-23 13:58:19 -07:00
version:
@echo $(VERSION)
tag:
git tag -a v$(VERSION) -m "Version: $(VERSION)"
2020-11-28 15:14:02 -07:00
git push --tag
2020-11-23 13:58:19 -07:00
release:
@make tag BUMP=patch
run:
go run -v \
-ldflags "\
-X main.AppVersion=$(VERSION) \
-X main.BuildHash=$(HASH) \
2020-11-23 14:55:04 -07:00
-X main.BuildDate=$(DATE)" .
2020-11-23 13:58:19 -07:00
2020-11-23 14:55:04 -07:00
$(NAME):
2020-11-23 14:21:58 -07:00
go build -v \
2020-11-23 14:55:04 -07:00
-o $(NAME) \
2020-11-23 13:58:19 -07:00
-ldflags "\
-X main.AppVersion=$(VERSION) \
-X main.BuildHash=$(HASH) \
2020-11-23 14:55:04 -07:00
-X main.BuildDate=$(DATE)" .
2020-11-23 14:21:58 -07:00
2020-11-23 14:55:04 -07:00
install: $(NAME)
install ./$(NAME) /usr/local/bin
install ./$(NAME).service /lib/systemd/system
systemctl daemon-reload