don't cross compile when on Power
authorDan Horák <dan@danny.cz>
Sat, 24 Aug 2019 12:02:35 +0000 (14:02 +0200)
committerDan Horák <dan@danny.cz>
Sat, 24 Aug 2019 12:02:35 +0000 (14:02 +0200)
hello_world/Makefile

index 882b63aa338fb1af752bd09f6f8d1fb8aa1d9d38..12daea2d79fbaf09a422861b5459b790392f997e 100644 (file)
@@ -1,4 +1,10 @@
-CROSS_COMPILE = powerpc64le-linux-
+ARCH = $(shell uname -m)
+ifneq ("$(ARCH)", "ppc64")
+ifneq ("$(ARCH)", "ppc64le")
+        CROSS_COMPILE = powerpc64le-linux-
+        endif
+        endif
+
 CC = $(CROSS_COMPILE)gcc
 LD = $(CROSS_COMPILE)ld
 OBJCOPY = $(CROSS_COMPILE)objcopy