Update Makefile to build on Apple Silicon

This commit is contained in:
Henk 2024-06-14 17:10:51 +02:00
parent 41e9b46358
commit 473b2ca078
No known key found for this signature in database
GPG key ID: 0A060AD10B455639
2 changed files with 11 additions and 5 deletions

View file

@ -299,6 +299,8 @@ else ifeq ($(YQ2_OSTYPE),OpenBSD)
INCLUDE ?= -I/usr/local/include INCLUDE ?= -I/usr/local/include
else ifeq ($(YQ2_OSTYPE),Windows) else ifeq ($(YQ2_OSTYPE),Windows)
INCLUDE ?= -I/usr/include INCLUDE ?= -I/usr/include
else ifeq ($(YQ2_OSTYPE),Darwin)
INCLUDE ?= -I/usr/local/include -I/opt/homebrew/include
endif endif
# ---------- # ----------
@ -314,6 +316,8 @@ else ifeq ($(YQ2_OSTYPE),OpenBSD)
LDFLAGS ?= -L/usr/local/lib LDFLAGS ?= -L/usr/local/lib
else ifeq ($(YQ2_OSTYPE),Windows) else ifeq ($(YQ2_OSTYPE),Windows)
LDFLAGS ?= -L/usr/lib LDFLAGS ?= -L/usr/lib
else ifeq ($(YQ2_OSTYPE),Darwin)
LDFLAGS ?= -L/usr/local/lib -L/opt/homebrew/lib
endif endif
# Link address sanitizer if requested. # Link address sanitizer if requested.
@ -492,8 +496,9 @@ ifeq ($(WITH_OPENAL),yes)
ifeq ($(YQ2_OSTYPE), OpenBSD) ifeq ($(YQ2_OSTYPE), OpenBSD)
release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so"' release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so"'
else ifeq ($(YQ2_OSTYPE), Darwin) else ifeq ($(YQ2_OSTYPE), Darwin)
release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.dylib"' -I/usr/local/opt/openal-soft/include OPENAL_PATH ?= $(shell brew --prefix openal-soft)
release/quake2 : LDFLAGS += -L/usr/local/opt/openal-soft/lib -rpath /usr/local/opt/openal-soft/lib release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.dylib"' -I$(OPENAL_PATH)/include
release/quake2 : LDFLAGS += -L$(OPENAL_PATH)/lib -rpath $(OPENAL_PATH)/lib
else else
release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so.1"' release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so.1"'
endif endif

View file

@ -73,6 +73,7 @@ SET(SDL2_SEARCH_PATHS
/usr/local /usr/local
/usr /usr
/sw # Fink /sw # Fink
/opt/homebrew # Homebrew
/opt/local # DarwinPorts /opt/local # DarwinPorts
/opt/csw # Blastwave /opt/csw # Blastwave
/opt /opt