PREFIX ?= /usr/local GOFLAGS ?= -v -ldflags "-w -X `go list`.Version=${VERSION} -X `go list`.Commit=${COMMIT}" VERSION = `git describe --abbrev=0 --tags 2>/dev/null || echo "VERSION"` COMMIT = `git rev-parse --short HEAD || echo "COMMIT"` build: go build ${GOFLAGS} ./cmd/mai clean: rm -f mai install: install -Dm0755 mai ${DESTDIR}${PREFIX}/bin/mai mkdir -p ${DESTDIR}${PREFIX}/share/mai cp -R static views ${DESTDIR}${PREFIX}/share/mai mkdir -p ${DESTDIR}${PREFIX}/share/man/man1 ${DESTDIR}${PREFIX}/share/man/man5 install -Dm0644 mai.1 ${DESTDIR}${PREFIX}/share/man/man1/mai.1 install -Dm0644 mai.ini.5 ${DESTDIR}${PREFIX}/share/man/man5/mai.ini.5 uninstall: rm -f ${DESTDIR}${PREFIX}/bin/mai rm -rf ${DESTDIR}${PREFIX}/share/mai rm -f ${DESTDIR}${PREFIX}/share/man/man1/mai.1 ${DESTDIR}${PREFIX}/share/man/man5/mai.ini.5