better makefile
This commit is contained in:
parent
79f8b40a3d
commit
0ec1696c34
19
Makefile
19
Makefile
@ -1,4 +1,19 @@
|
||||
GIT_COMMIT := $(shell git rev-list -1 HEAD)
|
||||
|
||||
all:
|
||||
#set variables
|
||||
GIT_COMMIT := $(shell git rev-list -1 HEAD)
|
||||
ifeq ($(PREFIX),) # PREFIX is environment variable, but if it is not set, then set default value
|
||||
PREFIX := /usr/local
|
||||
endif
|
||||
|
||||
guildgate:
|
||||
go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)"
|
||||
|
||||
clean:
|
||||
rm -f guildgate
|
||||
|
||||
install:
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user