guildgate/Makefile

20 lines
546 B
Makefile
Raw Normal View History

2021-03-31 20:31:44 +00:00
GOFILES=$(wildcard *.go)
2021-03-31 20:29:28 +00:00
#set variables
2021-03-02 19:37:31 +00:00
GIT_COMMIT := $(shell git rev-list -1 HEAD)
2021-03-31 20:29:28 +00:00
ifeq ($(PREFIX),) # PREFIX is environment variable, but if it is not set, then set default value
PREFIX := /usr/local
endif
2021-03-02 19:37:31 +00:00
2021-03-31 20:31:44 +00:00
guildgate: $(GOFILES)
2021-03-02 19:37:31 +00:00
go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)"
2021-03-31 20:29:28 +00:00
clean:
rm -f guildgate
2021-03-31 20:32:33 +00:00
install: guildgate
2021-03-31 20:29:28 +00:00
install -d $(DESTDIR)$(PREFIX)/bin
install -m 755 guildgate $(DESTDIR)$(PREFIX)/bin
install -d $(DESTDIR)$(PREFIX)/share/guildgate/templates
install -D templates/* $(DESTDIR)$(PREFIX)/share/guildgate/templates