diff --git a/Makefile b/Makefile index d60e01db6..f1f3b9717 100644 --- a/Makefile +++ b/Makefile @@ -120,6 +120,18 @@ COMPILE = build/bootstrap/compile.com -V9 -P4096 $(QUOTA) IGNORE := $(shell $(MKDIR) $(TMPDIR)) +# the default build modes is empty string +# on x86_64 hosts, MODE= is the same as MODE=x86_64 +# on aarch64 hosts, MODE= is changed to MODE=aarch64 +ifeq ($(MODE),) +ifeq ($(UNAME_M),arm64) +MODE := aarch64 +endif +ifeq ($(UNAME_M),aarch64) +MODE := aarch64 +endif +endif + ifneq ($(findstring aarch64,$(MODE)),) ARCH = aarch64 HOSTS ?= pi studio freebsdarm @@ -158,18 +170,6 @@ else ADDR2LINE = $(TOOLCHAIN)addr2line endif -# the default build modes is empty string -# on x86_64 hosts, MODE= is the same as MODE=x86_64 -# on aarch64 hosts, MODE= is changed to MODE=aarch64 -ifeq ($(MODE),) -ifeq ($(UNAME_M),arm64) -MODE := aarch64 -endif -ifeq ($(UNAME_M),aarch64) -MODE := aarch64 -endif -endif - # primary build rules all: o o: o/$(MODE)