]> Nishi Git Mirror - aya.git/commitdiff
Make use of cross-compilation
authorIzuru Yakumo <yakumo.izuru@chaotic.ninja>
Sat, 21 Sep 2024 12:19:05 +0000 (09:19 -0300)
committerIzuru Yakumo <yakumo.izuru@chaotic.ninja>
Sat, 21 Sep 2024 12:19:05 +0000 (09:19 -0300)
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
Makefile

index aa7572cd158bab26422d9f373d42b009555f503c..95055bc99f6e967ab7a0afd948b560562160689c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,16 +3,17 @@ GOFLAGS ?= -v -buildvcs=false -mod=vendor -buildmode=exe -ldflags "-w -X `go lis
 PREFIX ?= /usr/local
 DATE ?= `date -u +%F`
 GOOS ?= `go env GOOS`
+GOARCH ?= `go env GOARCH`
 VERSION ?= `git describe --tags`
 build:
-       go build ${GOFLAGS} ./cmd/aya
+       env GOOS=${GOOS} GOARCH=${GOARCH} go build ${GOFLAGS} -o aya-${GOOS}-${GOARCH} ./cmd/aya
 clean:
-       rm -f aya
+       rm -f aya-${GOOS}-${GOARCH}
 dist:
        git archive --format=tar.gz --output=aya-${VERSION}.tar.gz HEAD
 install:
-       install -Dm0755 aya ${DESTDIR}${PREFIX}/bin/aya
+       install -Dm0755 aya-${GOOS}-${GOARCH} ${DESTDIR}${PREFIX}/bin/aya
        install -Dm0644 aya.1 ${DESTDIR}${PREFIX}/share/man/man1/aya.1
 uninstall:
-       rm -f ${PREFIX}/bin/aya
+       rm -f ${PREFIX}/bin/aya-${GOOS}-${GOARCH}
        rm -f ${PREFIX}/share/man/man1/aya.1