2021-10-04 12:04:55 -04:00
|
|
|
#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
|
|
|
|
|
|
|
|
all: tome_ws
|
|
|
|
|
|
|
|
tome_ws: $(wildcard *.go)
|
|
|
|
go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)"
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f tome_ws
|
|
|
|
|
2021-10-06 16:37:08 -04:00
|
|
|
install: tome_ws
|
|
|
|
install -d $(DESTDIR)$(PREFIX)/bin
|
|
|
|
install -m 755 tome_ws $(DESTDIR)$(PREFIX)/bin
|
|
|
|
install -d /usr/lib/systemd/system/
|
|
|
|
install -m 744 init/tome_ws.service
|