diff --git a/Makefile b/Makefile index 9c7ae98..8ffd3ea 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ VERSION = $(shell git describe --tags --always) CROSS_COMPILE ?= CC = $(CROSS_COMPILE)gcc -CXX = $(CROSS_COMPILE)g++ +CXX = $(CROSS_COMPILE)g++ AR = $(CROSS_COMPILE)ar debug = 0 diff --git a/local/Makefile b/local/Makefile index e8efff1..877af72 100644 --- a/local/Makefile +++ b/local/Makefile @@ -2,10 +2,12 @@ ifneq ($(shell echo $(VERSION) | head -c 1), v) VERSION=v0.4 endif -ifeq (,$(findstring arm,$(CC))) - GO_BUILD_PREFIX_FLAGS := - CGO_FLAGS := -else +GO_BUILD_PREFIX_FLAGS := +CGO_FLAGS := +ifneq ($(shell $(CC) -E -dM -xc /dev/null | grep __aarch64__),) + GO_BUILD_PREFIX_FLAGS := GOOS=linux GOARCH=arm64 + CGO_FLAGS := CGO_ENABLED=1 CC=$(CC) CXX=$(CXX) AR=$(AR) +else ifneq ($(shell $(CC) -E -dM -xc /dev/null | grep __arm__),) GO_BUILD_PREFIX_FLAGS := GOOS=linux GOARCH=arm CGO_FLAGS := CGO_ENABLED=1 CC=$(CC) CXX=$(CXX) AR=$(AR) endif