1 diff --git a/Quake/Makefile.darwin b/Quake/Makefile.darwin
2 index 6a08e6d..4e320cd 100644
5 @@ -50,6 +50,7 @@ LINKER = $(CC)
9 +PKG_CONFIG ?= pkg-config
13 @@ -86,9 +87,6 @@ USE_RPATH=1
15 CFLAGS += $(call check_gcc,-std=gnu11,)
17 -ifeq ($(USE_RPATH),1)
18 -LDFLAGS+=-Wl,-rpath,@executable_path/../Frameworks
23 @@ -117,19 +115,14 @@ CFLAGS += -DGL_SILENCE_DEPRECATION=1
24 # not relying on sdl-config command and assuming
25 # /Library/Frameworks/SDL.framework is available
26 SDL_CFLAGS =-D_GNU_SOURCE=1 -D_THREAD_SAFE
27 -SDL_CFLAGS+=-DSDL_FRAMEWORK -DNO_SDL_CONFIG
29 -SDL_FRAMEWORK_NAME = SDL2
30 +SDL_CONFIG ?= sdl2-config
32 -SDL_FRAMEWORK_NAME = SDL
34 -# default to our local SDL[2].framework for build
35 -SDL_FRAMEWORK_PATH ?=../MacOSX
36 -ifneq ($(SDL_FRAMEWORK_PATH),)
37 -SDL_LIBS +=-F$(SDL_FRAMEWORK_PATH)
38 -SDL_CFLAGS+=-F$(SDL_FRAMEWORK_PATH)
39 +SDL_CONFIG ?= sdl-config
41 -SDL_LIBS +=-Wl,-framework,$(SDL_FRAMEWORK_NAME) -Wl,-framework,Cocoa
42 +SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
43 +SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
44 +SDL_LIBS += -Wl,-framework,Cocoa
48 @@ -165,45 +158,31 @@ ifeq ($(USE_CODEC_WAVE),1)
49 CFLAGS+= -DUSE_CODEC_WAVE
51 ifeq ($(USE_CODEC_FLAC),1)
52 -CFLAGS+= -DUSE_CODEC_FLAC
53 -CODEC_INC = -I../MacOSX/codecs/include
54 -CODEC_LINK= -L../MacOSX/codecs/lib
56 +CFLAGS+= -DUSE_CODEC_FLAC $(shell $(PKG_CONFIG) --cflags flac)
57 +CODECLIBS+= $(shell $(PKG_CONFIG) --libs flac)
59 ifeq ($(USE_CODEC_OPUS),1)
60 -CFLAGS+= -DUSE_CODEC_OPUS
61 -CODEC_INC = -I../MacOSX/codecs/include
62 -CODEC_LINK= -L../MacOSX/codecs/lib
63 -CODECLIBS+= -lopusfile -lopus -logg
64 +CFLAGS+= -DUSE_CODEC_OPUS $(shell $(PKG_CONFIG) --cflags ogg opus opusfile)
65 +CODECLIBS+= $(shell $(PKG_CONFIG) --libs ogg opus opusfile)
67 ifeq ($(USE_CODEC_VORBIS),1)
68 -CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec)
69 -CODEC_INC = -I../MacOSX/codecs/include
70 -CODEC_LINK= -L../MacOSX/codecs/lib
71 -CODECLIBS+= $(lib_vorbisdec)
72 +CFLAGS+= -DUSE_CODEC_VORBIS $(shell $(PKG_CONFIG) --cflags ogg vorbis vorbisfile)
73 +CODECLIBS+= $(shell $(PKG_CONFIG) --libs ogg vorbis vorbisfile)
75 ifeq ($(USE_CODEC_MP3),1)
76 -CFLAGS+= -DUSE_CODEC_MP3
77 -CODEC_INC = -I../MacOSX/codecs/include
78 -CODEC_LINK= -L../MacOSX/codecs/lib
79 -CODECLIBS+= $(lib_mp3dec)
80 +CFLAGS+= -DUSE_CODEC_MP3 $(shell $(PKG_CONFIG) --cflags $(MP3LIB))
81 +CODECLIBS+= $(shell $(PKG_CONFIG) --libs $(MP3LIB))
83 ifeq ($(USE_CODEC_MIKMOD),1)
84 CFLAGS+= -DUSE_CODEC_MIKMOD
85 -CODEC_INC = -I../MacOSX/codecs/include
86 -CODEC_LINK= -L../MacOSX/codecs/lib
89 ifeq ($(USE_CODEC_XMP),1)
90 -CFLAGS+= -DUSE_CODEC_XMP
91 -CODEC_INC = -I../MacOSX/codecs/include
92 -CODEC_LINK= -L../MacOSX/codecs/lib
94 +CFLAGS+= -DUSE_CODEC_XMP $(shell $(PKG_CONFIG) --cflags libxmp)
95 +CODECLIBS+= $(shell $(PKG_CONFIG) --libs libxmp)
97 ifeq ($(USE_CODEC_MODPLUG),1)
98 CFLAGS+= -DUSE_CODEC_MODPLUG
99 -CODEC_INC = -I../MacOSX/codecs/include
100 -CODEC_LINK= -L../MacOSX/codecs/lib
101 CODECLIBS+= -lmodplug
103 ifeq ($(USE_CODEC_UMX),1)
104 @@ -333,4 +312,7 @@ debug:
106 $(RM) *.o *.d $(DEFAULT_TARGET)
109 + install -D -m 755 quakespasm /usr/local/games/quake
111 sinclude $(OBJS:.o=.d)