guildgate/Makefile

20 lines
546 B
Makefile
Raw Normal View History

2021-03-31 16:31:44 -04:00
GOFILES=$(wildcard *.go)
2021-03-31 16:29:28 -04:00
#set variables
2021-03-02 14:37:31 -05:00
GIT_COMMIT := $(shell git rev-list -1 HEAD)
2021-03-31 16:29:28 -04:00
ifeq ($(PREFIX),) # PREFIX is environment variable, but if it is not set, then set default value
PREFIX := /usr/local
endif
2021-03-02 14:37:31 -05:00
2021-03-31 16:31:44 -04:00
guildgate: $(GOFILES)
2021-03-02 14:37:31 -05:00
go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)"
2021-03-31 16:29:28 -04:00
clean:
rm -f guildgate
2021-03-31 16:32:33 -04:00
install: guildgate
2021-03-31 16:29:28 -04: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