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)
|
2023-01-06 13:30:33 -07:00
|
|
|
-include local.mk
|
|
|
|
DISABLE_VCARD=true
|
2020-11-23 13:58:19 -07:00
|
|
|
|
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)
|
2023-01-06 13:30:33 -07:00
|
|
|
|
2020-11-23 13:58:19 -07:00
|
|
|
tag:
|
|
|
|
git tag -a v$(VERSION) -m "Version: $(VERSION)"
|
2020-12-02 09:24:07 -07:00
|
|
|
git push --follow-tags
|
2023-01-06 13:30:33 -07:00
|
|
|
|
2020-11-23 13:58:19 -07:00
|
|
|
release:
|
|
|
|
@make tag BUMP=patch
|
2023-01-06 13:30:33 -07:00
|
|
|
|
2020-11-23 13:58:19 -07:00
|
|
|
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
|
2021-12-12 06:34:58 -07:00
|
|
|
systemctl restart $(NAME)
|