GO ?= go RM ?= rm GOFLAGS ?= -v -ldflags "-w -X `go list`.Version=$(VERSION) -X `go list`.Commit=$(COMMIT) -X `go list`.Build=$(BUILD)" -mod=vendor PREFIX ?= /usr/local BINDIR ?= bin MANDIR ?= share/man MKDIR ?= mkdir CP ?= cp SYSCONFDIR ?= /etc VERSION = `git describe --abbrev=0 --tags 2>/dev/null || echo "$VERSION"` COMMIT = `git rev-parse --short HEAD || echo "$COMMIT"` BRANCH = `git rev-parse --abbrev-ref HEAD` BUILD = `git show -s --pretty=format:%cI` GOARCH ?= amd64 GOOS ?= linux all: tokiko tokiko: $(GO) build $(GOFLAGS) ./cmd/tokiko clean: $(RM) -f tokiko install: $(MKDIR) -p $(DESTDIR)$(PREFIX)/$(BINDIR) $(MKDIR) -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man1 $(MKDIR) -p $(DESTDIR)${SYSCONFDIR}/tokiko $(CP) -f tokiko $(DESTDIR)$(PREFIX)/$(BINDIR) $(CP) -f doc/tokiko.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1 [ -f $(DESTDIR)${SYSCONFDIR}/tokiko/config.ini ] || $(CP) -f config.ini $(DESTDIR)${SYSCONFDIR}/tokiko/config.ini test: go test vendor: go mod vendor .PHONY: tokiko clean install