From d5e4411f5105b715df446ef5e14aa747a56e7660 Mon Sep 17 00:00:00 2001 From: Unbewohnte Date: Wed, 20 Dec 2023 22:00:52 +0300 Subject: [PATCH] Makefile: cross compilation recipe --- Makefile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Makefile b/Makefile index fdcb2cb..9b095d5 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,39 @@ all: portable: clean all cd bin/ && cp ../COPYING . && cp ../README.md . && zip -r dela.zip * && mv dela.zip .. +cross: clean + mkdir -p bin + mkdir -p bin/dela_linux_x64 + mkdir -p bin/dela_linux_x32 + mkdir -p bin/dela_windows_x64 + mkdir -p bin/dela_windows_arm64 + mkdir -p bin/dela_darwin_x64 + mkdir -p bin/dela_darwin_arm64 + mkdir -p bin/dela_freebsd_x64 + mkdir -p bin/dela_freebsd_arm64 + + + + cd src && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build && mv dela ../bin/dela_linux_x64 + cd src && CGO_ENABLED=0 GOOS=linux GOARCH=386 go build && mv dela ../bin/dela_linux_x32 + cd src && CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build && mv dela.exe ../bin/dela_windows_x64 + cd src && CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build && mv dela.exe ../bin/dela_windows_arm64 + cd src && CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build && mv dela ../bin/dela_darwin_x64 + cd src && CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build && mv dela ../bin/dela_darwin_arm64 + cd src && CGO_ENABLED=0 GOOS=openbsd GOARCH=amd64 go build && mv dela ../bin/dela_freebsd_x64 + cd src && CGO_ENABLED=0 GOOS=openbsd GOARCH=arm64 go build && mv dela ../bin/dela_freebsd_arm64 + + + mkdir -p bin/includes + + cp -r pages bin/includes + cp -r scripts bin/includes + cp -r static bin/includes + cp COPYING bin/includes + cp LICENSE* bin/includes + cp README.md bin/includes + + clean: rm -rf bin \ No newline at end of file