diff --git a/Makefile b/Makefile index e4ad3f7..58a4739 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ BUILDOPTS = -a -tags netgo LDFLAGS = -ldflags '-s -w -extldflags "-static" -X main.version=$(VERSION)' LDFLAGS_NATIVE = -ldflags '-s -w -X main.version=$(VERSION)' +NDK_CC_ARM = $(abspath ../../ndk-toolchain-arm/bin/arm-linux-androideabi-gcc) +NDK_CC_ARM64 = $(abspath ../../ndk-toolchain-arm64/bin/aarch64-linux-android21-clang) + GO := go src = $(wildcard *.go) @@ -17,6 +20,9 @@ all: bin-linux-amd64 bin-linux-386 bin-linux-arm \ bin-darwin-amd64 bin-darwin-arm64 \ bin-windows-amd64 bin-windows-386 bin-windows-arm +allplus: all \ + bin-android-arm bin-android-arm64 + bin-native: $(OUTSUFFIX) bin-linux-amd64: $(OUTSUFFIX).linux-amd64 bin-linux-386: $(OUTSUFFIX).linux-386 @@ -33,6 +39,8 @@ bin-darwin-arm64: $(OUTSUFFIX).darwin-arm64 bin-windows-amd64: $(OUTSUFFIX).windows-amd64.exe bin-windows-386: $(OUTSUFFIX).windows-386.exe bin-windows-arm: $(OUTSUFFIX).windows-arm.exe +bin-android-arm: $(OUTSUFFIX).android-arm +bin-android-arm64: $(OUTSUFFIX).android-arm64 $(OUTSUFFIX): $(src) $(GO) build $(LDFLAGS_NATIVE) -o $@ @@ -82,6 +90,12 @@ $(OUTSUFFIX).windows-386.exe: $(src) $(OUTSUFFIX).windows-arm.exe: $(src) CGO_ENABLED=0 GOOS=windows GOARCH=arm GOARM=7 $(GO) build $(BUILDOPTS) $(LDFLAGS) -o $@ +$(OUTSUFFIX).android-arm: $(src) + CC=$(NDK_CC_ARM) CGO_ENABLED=1 GOOS=android GOARCH=arm GOARM=7 $(GO) build $(LDFLAGS_NATIVE) -o $@ + +$(OUTSUFFIX).android-arm64: $(src) + CC=$(NDK_CC_ARM64) CGO_ENABLED=1 GOOS=android GOARCH=arm64 $(GO) build $(LDFLAGS_NATIVE) -o $@ + clean: rm -f bin/* @@ -102,6 +116,13 @@ install: bin-freebsd-amd64 \ bin-freebsd-386 \ bin-freebsd-arm \ + bin-netbsd-amd64 \ + bin-netbsd-386 \ + bin-openbsd-amd64 \ + bin-openbsd-386 \ bin-darwin-amd64 \ bin-windows-amd64 \ - bin-windows-386 + bin-windows-386 \ + bin-windows-arm \ + bin-android-arm \ + bin-android-arm64