From 787e275dfb50e1661099c1ea7362feba29d73e56 Mon Sep 17 00:00:00 2001 From: Izuru Yakumo Date: Sat, 21 Sep 2024 09:19:05 -0300 Subject: [PATCH] Make use of cross-compilation Signed-off-by: Izuru Yakumo --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index aa7572c..95055bc 100644 --- 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 -- 2.43.0