summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2021-01-04 11:35:59 -0500
committerluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2021-01-04 11:35:59 -0500
commit98f8c96c9e21791651d2274f07046496ab826ff2 (patch)
tree9a845fa2d4248d9865d4b751c58468d5568d71dc /Makefile
parente744d86bf15db8e8ca172b849ac3473ae34194c3 (diff)
Fix $(AR) define, remove \u warns on macOS.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 16 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 306b8fb6e..3bb5161e3 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ COMPARE ?= 0
# with when we want to use $(CC) to preprocess files
# thus, manually create the variables for the bin
# files, or use arm-none-eabi binaries on the system
-# if dkP is not installed on tihs system
+# if dkP is not installed on this system
ifneq (,$(TOOLCHAIN))
ifneq ($(wildcard $(TOOLCHAIN)/bin),)
@@ -36,10 +36,21 @@ MAKER_CODE := 01
REVISION := 0
MODERN ?= 0
+# use arm-none-eabi-cpp for macOS
+# as macOS's default compiler is clang
+# and clang's preprocessor will warn on \u
+# when preprocessing asm files, expecting a unicode literal
+# we can't unconditionally use arm-none-eabi-cpp
+# as installations which install binutils-arm-none-eabi
+# don't come with it
ifneq ($(MODERN),1)
-CPP := $(CC) -E
+ ifeq ($(shell uname -s),Darwin)
+ CPP := $(PREFIX)cpp
+ else
+ CPP := $(CC) -E
+ endif
else
-CPP := $(PREFIX)cpp
+ CPP := $(PREFIX)cpp
endif
ROM_NAME := pokeemerald.gba
@@ -362,7 +373,7 @@ modern: ; @$(MAKE) MODERN=1
berry_fix/berry_fix.gba: berry_fix
berry_fix:
- @$(MAKE) -C berry_fix COMPARE=$(COMPARE) TOOLCHAIN=$(TOOLCHAIN)
+ @$(MAKE) -C berry_fix COMPARE=$(COMPARE) TOOLCHAIN=$(TOOLCHAIN) MODERN=$(MODERN)
libagbsyscall:
- @$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN)
+ @$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) MODERN=$(MODERN)