summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2024-05-26 20:01:31 -0700
committerGitHub <noreply@github.com>2024-05-26 20:01:31 -0700
commit659e2b5088eb960594844d2dd3625779c11476ca (patch)
tree73edcd131f66978d250e6b634857f3266751ac20 /Makefile
parentb7e5468ca16315a7e322055eff3d97fe980bbc25 (diff)
Use `gcc -E` for `cpp` (#1639)
* Fix cpp for macs? * Add comment * Move cppflags with cpp
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 5 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 30a272dca..5285f4051 100644
--- a/Makefile
+++ b/Makefile
@@ -87,12 +87,6 @@ BASEROM_DIR := baseroms/$(VERSION)
BUILD_DIR := build/$(VERSION)
EXTRACTED_DIR := extracted/$(VERSION)
-CPPFLAGS += -P
-
-ifeq ($(DETECTED_OS), macos)
- CPPFLAGS += -xc++
-endif
-
#### Tools ####
ifneq ($(shell type $(MIPS_BINUTILS_PREFIX)ld >/dev/null 2>/dev/null; echo $$?), 0)
@@ -143,7 +137,11 @@ ifeq ($(RUN_CC_CHECK),0)
CC_CHECK_COMP := @:
endif
-CPP := cpp
+# The `cpp` command behaves differently on macOS (it behaves as if
+# `-traditional-cpp` was passed) so we use `gcc -E` instead.
+CPP := gcc -E
+CPPFLAGS += -P -xc -fno-dollars-in-identifiers
+
MKLDSCRIPT := tools/buildtools/mkldscript
MKDMADATA := tools/buildtools/mkdmadata
ZAPD := tools/ZAPD/ZAPD.out