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 ASCIIDOCTOR ?= asciidoctor 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: build build: vendor ${GO} build ${GOFLAGS} ./cmd/suika ${GO} build ${GOFLAGS} ./cmd/suikadb ${GO} build ${GOFLAGS} ./cmd/suika-znc-import clean: ${RM} -f suika suikadb suika-znc-import install: ${MKDIR} -p ${DESTDIR}${PREFIX}/${BINDIR} ${MKDIR} -p ${DESTDIR}${PREFIX}/${MANDIR}/man1 ${MKDIR} -p ${DESTDIR}${PREFIX}/${MANDIR}/man5 ${MKDIR} -p ${DESTDIR}${PREFIX}/${MANDIR}/man7 ${MKDIR} -p ${DESTDIR}${SYSCONFDIR}/suika ${MKDIR} -p ${DESTDIR}/var/lib/suika ${CP} -f suika suikadb suika-znc-import ${DESTDIR}${PREFIX}/${BINDIR} ${CP} -f doc/suika.1 ${DESTDIR}${PREFIX}/${MANDIR}/man1 ${CP} -f doc/suikadb.1 ${DESTDIR}${PREFIX}/${MANDIR}/man1 ${CP} -f doc/suika-znc-import.1 ${DESTDIR}/${MANDIR}/man1 ${CP} -f doc/suika-config.5 ${DESTDIR}${PREFIX}/${MANDIR}/man5 [ -f ${DESTDIR}${SYSCONFDIR}/suika/config ] || ${CP} -f config.in ${DESTDIR}${SYSCONFDIR}/suika/config test: go test vendor: go mod vendor .PHONY: build clean install