2022-08-07 16:49:55 +00:00
|
|
|
diff --git a/Quake/Makefile.darwin b/Quake/Makefile.darwin
|
|
|
|
index 6a08e6d..4e320cd 100644
|
|
|
|
--- a/Makefile.darwin
|
|
|
|
+++ b/Makefile.darwin
|
|
|
|
@@ -50,6 +50,7 @@ LINKER = $(CC)
|
2021-06-29 19:29:58 +00:00
|
|
|
LIPO ?= lipo
|
|
|
|
|
2022-08-07 16:49:55 +00:00
|
|
|
STRIP ?= strip -S
|
2021-06-29 19:29:58 +00:00
|
|
|
+PKG_CONFIG ?= pkg-config
|
|
|
|
|
|
|
|
CPUFLAGS=
|
|
|
|
LDFLAGS =
|
2022-08-07 16:49:55 +00:00
|
|
|
@@ -86,9 +87,6 @@ USE_RPATH=1
|
2021-06-29 19:29:58 +00:00
|
|
|
endif
|
2022-08-07 16:49:55 +00:00
|
|
|
CFLAGS += $(call check_gcc,-std=gnu11,)
|
2021-06-29 19:29:58 +00:00
|
|
|
CFLAGS += $(CPUFLAGS)
|
|
|
|
-ifeq ($(USE_RPATH),1)
|
|
|
|
-LDFLAGS+=-Wl,-rpath,@executable_path/../Frameworks
|
|
|
|
-endif
|
|
|
|
ifneq ($(DEBUG),0)
|
|
|
|
DFLAGS += -DDEBUG
|
2022-08-07 16:49:55 +00:00
|
|
|
CFLAGS += -g
|
|
|
|
@@ -117,19 +115,14 @@ CFLAGS += -DGL_SILENCE_DEPRECATION=1
|
2021-06-29 19:29:58 +00:00
|
|
|
# not relying on sdl-config command and assuming
|
|
|
|
# /Library/Frameworks/SDL.framework is available
|
|
|
|
SDL_CFLAGS =-D_GNU_SOURCE=1 -D_THREAD_SAFE
|
|
|
|
-SDL_CFLAGS+=-DSDL_FRAMEWORK -DNO_SDL_CONFIG
|
|
|
|
ifeq ($(USE_SDL2),1)
|
|
|
|
-SDL_FRAMEWORK_NAME = SDL2
|
|
|
|
+SDL_CONFIG ?= sdl2-config
|
|
|
|
else
|
|
|
|
-SDL_FRAMEWORK_NAME = SDL
|
|
|
|
-endif
|
|
|
|
-# default to our local SDL[2].framework for build
|
|
|
|
-SDL_FRAMEWORK_PATH ?=../MacOSX
|
|
|
|
-ifneq ($(SDL_FRAMEWORK_PATH),)
|
|
|
|
-SDL_LIBS +=-F$(SDL_FRAMEWORK_PATH)
|
|
|
|
-SDL_CFLAGS+=-F$(SDL_FRAMEWORK_PATH)
|
2022-08-07 16:49:55 +00:00
|
|
|
+SDL_CONFIG ?= sdl-config
|
2021-06-29 19:29:58 +00:00
|
|
|
endif
|
|
|
|
-SDL_LIBS +=-Wl,-framework,$(SDL_FRAMEWORK_NAME) -Wl,-framework,Cocoa
|
|
|
|
+SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
|
|
|
|
+SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
|
2022-08-07 16:49:55 +00:00
|
|
|
+SDL_LIBS += -Wl,-framework,Cocoa
|
2021-06-29 19:29:58 +00:00
|
|
|
|
|
|
|
NET_LIBS :=
|
|
|
|
|
2022-08-07 16:49:55 +00:00
|
|
|
@@ -165,45 +158,31 @@ ifeq ($(USE_CODEC_WAVE),1)
|
|
|
|
CFLAGS+= -DUSE_CODEC_WAVE
|
2021-06-29 19:29:58 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(USE_CODEC_FLAC),1)
|
2022-08-07 16:49:55 +00:00
|
|
|
-CFLAGS+= -DUSE_CODEC_FLAC
|
2021-06-29 19:29:58 +00:00
|
|
|
-CODEC_INC = -I../MacOSX/codecs/include
|
|
|
|
-CODEC_LINK= -L../MacOSX/codecs/lib
|
2022-08-07 16:49:55 +00:00
|
|
|
-CODECLIBS+= -lFLAC
|
|
|
|
+CFLAGS+= -DUSE_CODEC_FLAC $(shell $(PKG_CONFIG) --cflags flac)
|
|
|
|
+CODECLIBS+= $(shell $(PKG_CONFIG) --libs flac)
|
2021-06-29 19:29:58 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(USE_CODEC_OPUS),1)
|
|
|
|
-CFLAGS+= -DUSE_CODEC_OPUS
|
|
|
|
-CODEC_INC = -I../MacOSX/codecs/include
|
|
|
|
-CODEC_LINK= -L../MacOSX/codecs/lib
|
|
|
|
-CODECLIBS+= -lopusfile -lopus -logg
|
2022-08-07 16:49:55 +00:00
|
|
|
+CFLAGS+= -DUSE_CODEC_OPUS $(shell $(PKG_CONFIG) --cflags ogg opus opusfile)
|
|
|
|
+CODECLIBS+= $(shell $(PKG_CONFIG) --libs ogg opus opusfile)
|
2021-06-29 19:29:58 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(USE_CODEC_VORBIS),1)
|
2022-08-07 16:49:55 +00:00
|
|
|
-CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec)
|
2021-06-29 19:29:58 +00:00
|
|
|
-CODEC_INC = -I../MacOSX/codecs/include
|
|
|
|
-CODEC_LINK= -L../MacOSX/codecs/lib
|
2022-08-07 16:49:55 +00:00
|
|
|
-CODECLIBS+= $(lib_vorbisdec)
|
|
|
|
+CFLAGS+= -DUSE_CODEC_VORBIS $(shell $(PKG_CONFIG) --cflags ogg vorbis vorbisfile)
|
|
|
|
+CODECLIBS+= $(shell $(PKG_CONFIG) --libs ogg vorbis vorbisfile)
|
2021-06-29 19:29:58 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(USE_CODEC_MP3),1)
|
2022-08-07 16:49:55 +00:00
|
|
|
-CFLAGS+= -DUSE_CODEC_MP3
|
2021-06-29 19:29:58 +00:00
|
|
|
-CODEC_INC = -I../MacOSX/codecs/include
|
|
|
|
-CODEC_LINK= -L../MacOSX/codecs/lib
|
2022-08-07 16:49:55 +00:00
|
|
|
-CODECLIBS+= $(lib_mp3dec)
|
|
|
|
+CFLAGS+= -DUSE_CODEC_MP3 $(shell $(PKG_CONFIG) --cflags $(MP3LIB))
|
|
|
|
+CODECLIBS+= $(shell $(PKG_CONFIG) --libs $(MP3LIB))
|
2021-06-29 19:29:58 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(USE_CODEC_MIKMOD),1)
|
|
|
|
CFLAGS+= -DUSE_CODEC_MIKMOD
|
|
|
|
-CODEC_INC = -I../MacOSX/codecs/include
|
|
|
|
-CODEC_LINK= -L../MacOSX/codecs/lib
|
|
|
|
CODECLIBS+= -lmikmod
|
|
|
|
endif
|
|
|
|
ifeq ($(USE_CODEC_XMP),1)
|
2022-08-07 16:49:55 +00:00
|
|
|
-CFLAGS+= -DUSE_CODEC_XMP
|
|
|
|
-CODEC_INC = -I../MacOSX/codecs/include
|
|
|
|
-CODEC_LINK= -L../MacOSX/codecs/lib
|
|
|
|
-CODECLIBS+= -lxmp
|
|
|
|
+CFLAGS+= -DUSE_CODEC_XMP $(shell $(PKG_CONFIG) --cflags libxmp)
|
|
|
|
+CODECLIBS+= $(shell $(PKG_CONFIG) --libs libxmp)
|
|
|
|
endif
|
|
|
|
ifeq ($(USE_CODEC_MODPLUG),1)
|
|
|
|
CFLAGS+= -DUSE_CODEC_MODPLUG
|
2021-06-29 19:29:58 +00:00
|
|
|
-CODEC_INC = -I../MacOSX/codecs/include
|
|
|
|
-CODEC_LINK= -L../MacOSX/codecs/lib
|
2022-08-07 16:49:55 +00:00
|
|
|
CODECLIBS+= -lmodplug
|
2021-06-29 19:29:58 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(USE_CODEC_UMX),1)
|
2022-08-07 16:49:55 +00:00
|
|
|
@@ -333,4 +312,7 @@ debug:
|
2021-06-29 19:29:58 +00:00
|
|
|
clean:
|
2022-08-07 16:49:55 +00:00
|
|
|
$(RM) *.o *.d $(DEFAULT_TARGET)
|
2021-06-29 19:29:58 +00:00
|
|
|
|
2022-08-07 16:49:55 +00:00
|
|
|
+install: quakespasm
|
2021-06-29 19:29:58 +00:00
|
|
|
+ install -D -m 755 quakespasm /usr/local/games/quake
|
2022-08-07 16:49:55 +00:00
|
|
|
+
|
|
|
|
sinclude $(OBJS:.o=.d)
|