makefile: add support on MacOS for alternate location of HomeBrew components

As discussed in #1048
This commit is contained in:
Mark Pizzolato 2021-06-07 12:27:49 -07:00
parent 1548bd1cf6
commit 1a0024aabe

View file

@ -350,9 +350,14 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin)
LIBPATH += /opt/local/lib
OS_LDFLAGS += -L/opt/local/lib
endif
ifeq (HomeBrew,$(shell if ${TEST} -d /usr/local/Cellar; then echo HomeBrew; fi))
INCPATH += $(foreach dir,$(wildcard /usr/local/Cellar/*/*),$(dir)/include)
LIBPATH += $(foreach dir,$(wildcard /usr/local/Cellar/*/*),$(dir)/lib)
ifeq (HomeBrew,$(or $(shell if ${TEST} -d /usr/local/Cellar; then echo HomeBrew; fi),$(shell if ${TEST} -d /opt/homebrew/Cellar; then echo HomeBrew; fi)))
ifeq (local,$(shell if $(TEST) -d /usr/local/Cellar; then echo local; fi))
HBPATH = /usr/local
else
HBPATH = /opt/homebrew
endif
INCPATH += $(foreach dir,$(wildcard $(HBPATH)/Cellar/*/*),$(dir)/include)
LIBPATH += $(foreach dir,$(wildcard $(HBPATH)/Cellar/*/*),$(dir)/lib)
endif
else
ifeq (Linux,$(OSTYPE))