simpbot/Makefile
Steve 2eff2a3559
All checks were successful
continuous-integration/drone/push Build is passing
use tag info in version
2021-10-27 12:06:54 -04:00

20 lines
506 B
Makefile

GOFILES=$(wildcard *.go)
PROG=simpbot
#set variables
GIT_COMMIT := $(shell git rev-list -1 HEAD)
GIT_TAG := $(shell git describe --tags | cut -d- -f1)
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) -X main.GitTag=$(GIT_TAG)"
clean:
rm -f simpbot
install: $(SIMPBOT)
install -d $(DESTDIR)$(PREFIX)/bin
install -m 755 $(PROG) $(DESTDIR)$(PREFIX)/bin