summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-01-08 16:06:03 +0100
committerClifford Wolf <clifford@clifford.at>2015-01-08 16:06:03 +0100
commitbd3dd8052665f4f8a27a90dc745c1fca1b6da98f (patch)
treec568f20de24629d332ff2ea5d935ae4a1573e43f /Makefile
parent1d96277f5d4c615ca4018d9a6e867c980db3b73a (diff)
parent0a231f96d79d3eae927bf33571846c98f78eedfd (diff)
Merge pull request #46 from utzig/master
Fixes building on a Mac using Homebrew as package manager
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 8d2e7679..a3aa2a39 100644
--- a/Makefile
+++ b/Makefile
@@ -35,11 +35,17 @@ CXXFLAGS = -Wall -Wextra -ggdb -I"$(shell pwd)" -MD -DYOSYS_SRC='"$(shell pwd)"'
LDFLAGS = -L${DESTDIR}/lib
LDLIBS = -lstdc++ -lm
SED = sed
+BISON = bison
ifeq (Darwin,$(findstring Darwin,$(shell uname)))
- # add macports include and library path to search directories, don't use '-rdynamic' and '-lrt':
- CXXFLAGS += -I/opt/local/include
- LDFLAGS += -L/opt/local/lib
+ # add macports/homebrew include and library path to search directories, don't use '-rdynamic' and '-lrt':
+ CXXFLAGS += -I/opt/local/include -I/usr/local/opt/readline/include
+ LDFLAGS += -L/opt/local/lib -L/usr/local/opt/readline/lib
+ # add homebrew's libffi include and library path
+ CXXFLAGS += $(shell PKG_CONFIG_PATH=$$(brew list libffi | grep pkgconfig | xargs dirname) pkg-config --silence-errors --cflags libffi)
+ LDFLAGS += $(shell PKG_CONFIG_PATH=$$(brew list libffi | grep pkgconfig | xargs dirname) pkg-config --silence-errors --libs libffi)
+ # use bison installed by homebrew if available
+ BISON = $(shell (brew list bison | grep -m1 "bin/bison") || echo bison)
SED = gsed
else
LDFLAGS += -rdynamic