aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortwinaphex2021-01-28 20:54:15 +0100
committertwinaphex2021-01-28 20:54:15 +0100
commit18307e0c4ac28c81528705c4dd3011c2e03c9800 (patch)
tree7df00f819b10c1f59646a62c6403e7caf5859313
parent77783aaeca61ec59035e9a82f892be0093e0c4a2 (diff)
downloadsnes9x2005-18307e0c4ac28c81528705c4dd3011c2e03c9800.tar.gz
snes9x2005-18307e0c4ac28c81528705c4dd3011c2e03c9800.tar.bz2
snes9x2005-18307e0c4ac28c81528705c4dd3011c2e03c9800.zip
(macOS) Set up CROSS_COMPILING for ARM 64bit
-rw-r--r--Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 22e84ee..a9a7de1 100644
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,9 @@ ifeq ($(platform),)
else ifneq ($(findstring Darwin,$(shell uname -s)),)
platform = osx
arch = intel
+ ifeq ($(shell uname -p),arm64)
+ arch = arm
+ endif
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
@@ -112,11 +115,18 @@ ifeq ($(arch),ppc)
OLD_GCC = 1
endif
OSXVER = $(shell sw_vers -productVersion | cut -d. -f 2)
- OSX_GT_MOJAVE = $(shell (( $(OSXVER) >= 14)) && echo "YES")
-ifneq ($(OSX_GT_MOJAVE),YES)
+ OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
+ifeq ($(OSX_LT_MAVERICKS),YES)
#this breaks compiling on Mac OS Mojave
fpic += -mmacosx-version-min=10.1
endif
+ ifeq ($(CROSS_COMPILE),1)
+ TARGET_RULE = -target $(LIBRETRO_APPLE_PLATFORM) -isysroot $(LIBRETRO_APPLE_ISYSROOT)
+ CFLAGS += $(TARGET_RULE)
+ CPPFLAGS += $(TARGET_RULE)
+ CXXFLAGS += $(TARGET_RULE)
+ LDFLAGS += $(TARGET_RULE)
+ endif
ifndef ($(NOUNIVERSAL))
FLAGS += $(ARCHFLAGS)
LDFLAGS += $(ARCHFLAGS)