keyproofs/Makefile

39 lines
826 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)
HASH:=$(shell git rev-pars HEAD 2> /dev/null)
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