1 |
DESTDIR ?= |
2 |
GOFLAGS ?= -v -buildvcs=false -mod=vendor -buildmode=exe -ldflags "-w -X `go list`.Date=${DATE} -X `go list`.Vendor=${GOOS} -X `go list`.Version=${VERSION}" |
3 |
PREFIX ?= /usr/local |
4 |
DATE ?= `date -u +%F` |
5 |
GOOS ?= `go env GOOS` |
6 |
GOARCH ?= `go env GOARCH` |
7 |
VERSION ?= `git describe --tags` |
8 |
build: |
9 |
env GOOS=${GOOS} GOARCH=${GOARCH} go build ${GOFLAGS} -o aya-${GOOS}-${GOARCH} ./cmd/aya |
10 |
clean: |
11 |
rm -f aya-${GOOS}-${GOARCH} |
12 |
dist: |
13 |
git archive --format=tar.gz --output=aya-${VERSION}.tar.gz HEAD |
14 |
install: |
15 |
install -Dm0755 aya-${GOOS}-${GOARCH} ${DESTDIR}${PREFIX}/bin/aya |
16 |
install -Dm0644 aya.1 ${DESTDIR}${PREFIX}/share/man/man1/aya.1 |
17 |
uninstall: |
18 |
rm -f ${PREFIX}/bin/aya-${GOOS}-${GOARCH} |
19 |
rm -f ${PREFIX}/share/man/man1/aya.1 |