summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Upton <oliver.upton@linux.dev>2024-02-26 20:37:15 +0000
committerOliver Upton <oliver.upton@linux.dev>2024-02-26 20:37:15 +0000
commit41d4ca89b6383c0ff52e0d4b061ba68d473c56a6 (patch)
treeb426f0f63b9b6901dc801f8d0371e1398d7db06e
parentda2d6d551a4b185c76b97c85320940a932c57e51 (diff)
downloadaarch64-memcpy-main.tar.gz
support native compilationmain
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
-rw-r--r--Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 9f3902f..bbdadee 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,9 @@
-CC := aarch64-linux-gnu-gcc
+HOSTARCH := $(shell uname -m)
+ifneq ($(HOSTARCH),aarch64)
+ CROSS_COMPILE ?= aarch64-linux-gnu-
+endif
+
+CC := $(CROSS_COMPILE)gcc
CFLAGS += -O3 -Wall -Werror -static
OBJS = main.o