simpbot/Makefile
2021-05-21 16:02:18 -04:00

19 lines
426 B
Makefile

GOFILES=$(wildcard *.go)
PROG=simpbot
#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
$(PROG): $(GOFILES)
go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)"
clean:
rm -f simpbot
install: $(SIMPBOT)
install -d $(DESTDIR)$(PREFIX)/bin
install -m 755 $(PROG) $(DESTDIR)$(PREFIX)/bin