Skip to content

Commit 4c8595d

Browse files
Makefile: Prioritize Homebrew over MacPorts
[Having both installed at the same time is a recipe for disaster if you don't know what you're doing, however Homebrew is arguably the simplest and the most used for our purposes see Render96/Render96ex#48]
1 parent 3758887 commit 4c8595d

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

Makefile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -214,23 +214,23 @@ endif
214214
# macOS overrides
215215
ifeq ($(HOST_OS),Darwin)
216216
OSX_BUILD := 1
217-
# Using MacPorts?
218-
ifeq ($(shell test -d /opt/local/lib && echo y),y)
219-
OSX_GCC_VER = $(shell find /opt/local/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1)
220-
CC := gcc-mp-$(OSX_GCC_VER)
221-
CXX := g++-mp-$(OSX_GCC_VER)
222-
CPP := cpp-mp-$(OSX_GCC_VER) -P
223-
PLATFORM_CFLAGS := -I /opt/local/include
224-
PLATFORM_LDFLAGS := -L /opt/local/lib
217+
# Using Homebrew?
218+
ifeq ($(shell which brew >/dev/null 2>&1 && echo y),y)
219+
OSX_GCC_VER = $(shell find `brew --prefix`/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1)
220+
CC := gcc-$(OSX_GCC_VER)
221+
CXX := g++-$(OSX_GCC_VER)
222+
CPP := cpp-$(OSX_GCC_VER) -P
223+
PLATFORM_CFLAGS := -I $(shell brew --prefix)/include
224+
PLATFORM_LDFLAGS := -L $(shell brew --prefix)/lib
225225
else
226-
# Using Homebrew?
227-
ifeq ($(shell which brew >/dev/null 2>&1 && echo y),y)
228-
OSX_GCC_VER = $(shell find `brew --prefix`/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1)
229-
CC := gcc-$(OSX_GCC_VER)
230-
CXX := g++-$(OSX_GCC_VER)
231-
CPP := cpp-$(OSX_GCC_VER) -P
232-
PLATFORM_CFLAGS := -I $(shell brew --prefix)/include
233-
PLATFORM_LDFLAGS := -L $(shell brew --prefix)/lib
226+
# Using MacPorts?
227+
ifeq ($(shell test -d /opt/local/lib && echo y),y)
228+
OSX_GCC_VER = $(shell find /opt/local/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1)
229+
CC := gcc-mp-$(OSX_GCC_VER)
230+
CXX := g++-mp-$(OSX_GCC_VER)
231+
CPP := cpp-mp-$(OSX_GCC_VER) -P
232+
PLATFORM_CFLAGS := -I /opt/local/include
233+
PLATFORM_LDFLAGS := -L /opt/local/lib
234234
else
235235
$(error No suitable macOS toolchain found, have you installed Homebrew?)
236236
endif

0 commit comments

Comments
 (0)