summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorcadmic <cadmic24@gmail.com>2024-03-29 08:03:28 -0700
committerGitHub <noreply@github.com>2024-03-29 11:03:28 -0400
commit93642f97bcf010311d110cc062c19264aa9c2cf4 (patch)
treefd5986be32bcab33c29bc1b03cfc833515041e2c /Makefile
parent7445169e42ba9a8024cf0f8f201c11fa8870838c (diff)
Use `gcc -E` instead of `cpp` to fix macOS build (#1935)
* Use `gcc -E` instead of `cpp` to fix macOS build * -xc++ -> -xc
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 4 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 10e0fd76c..16e2d0739 100644
--- a/Makefile
+++ b/Makefile
@@ -70,7 +70,7 @@ EXTRACTED_DIR := extracted/$(VERSION)
VENV := .venv
MAKE = make
-CPPFLAGS += -fno-dollars-in-identifiers -P
+CPPFLAGS += -P -xc -fno-dollars-in-identifiers
ifeq ($(DEBUG),1)
CFLAGS += -DOOT_DEBUG=1
@@ -92,7 +92,6 @@ else
ifeq ($(UNAME_S),Darwin)
DETECTED_OS=macos
MAKE=gmake
- CPPFLAGS += -xc++
endif
endif
@@ -136,7 +135,9 @@ INC := -Iinclude -Iinclude/libc -Isrc -I$(BUILD_DIR) -I. -I$(EXTRACTED_DIR)
# Check code syntax with host compiler
CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces
-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
MKLDSCRIPT := tools/mkldscript
MKDMADATA := tools/mkdmadata
ELF2ROM := tools/elf2rom