comparison Makefile @ 74:d8727551f403 draft

The Empress (III) * Change the way how versions are handled in version.go (to ease `go install`) * Upgrade yaml.v2 to yaml.v3 Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
author yakumo.izuru
date Mon, 04 Dec 2023 00:54:29 +0000
parents 4edfa07d5fe0
children 7b122b71fcfa
comparison
equal deleted inserted replaced
73:8533d875a2bb 74:d8727551f403
1 CGO = 0
2 DESTDIR ?= 1 DESTDIR ?=
3 GOFLAGS ?= -v -ldflags "-w -X `go list`.Version=$(VERSION) -X `go list`.Commit=$(COMMIT)" -mod=vendor -buildmode=exe 2 GOFLAGS ?= -v -buildvcs=false -mod=vendor -buildmode=exe
4 PREFIX ?= /usr/local 3 PREFIX ?= /usr/local
5 VERSION ?= `git describe --abbrev=0 --tags || echo "$VERSION"` 4 VERSION ?= `git describe --tags`
6 COMMIT ?= `git rev-parse --short HEAD || echo "$COMMIT"`
7
8 5
9 build: 6 build:
10 env CGO_ENABLED=${CGO} go build ${GOFLAGS} ./cmd/aya 7 go build ${GOFLAGS} ./cmd/aya
11 clean: 8 clean:
12 rm -f aya 9 rm -f aya
10 dist:
11 git archive --format=tar.gz --output=aya-${VERSION}.tar.gz HEAD
13 install: 12 install:
14 install -Dm0755 aya ${DESTDIR}${PREFIX}/bin/aya 13 install -Dm0755 aya ${DESTDIR}${PREFIX}/bin/aya
15 install -Dm0644 aya.1 ${DESTDIR}${PREFIX}/share/man/man1/aya.1 14 install -Dm0644 aya.1 ${DESTDIR}${PREFIX}/share/man/man1/aya.1
16 uninstall: 15 uninstall:
17 rm -f ${PREFIX}/bin/aya 16 rm -f ${PREFIX}/bin/aya