aboutsummaryrefslogtreecommitdiffstats
path: root/iceprog
diff options
context:
space:
mode:
authorAdam D. Horden <adam.horden+github@horden.me>2016-09-04 11:48:12 +0100
committerAdam D. Horden <adam.horden+github@horden.me>2016-09-04 11:48:12 +0100
commit0d3ee2655f340d8db01c01ec2adb5cdac038f8ac (patch)
tree350719f1d42c5ebe0c1c0f6cb4ae12c2475dac1b /iceprog
parenta4b050c8ef223992d6be6835dd7ffb4f3801e198 (diff)
downloadicestorm-0d3ee2655f340d8db01c01ec2adb5cdac038f8ac.tar.gz
icestorm-0d3ee2655f340d8db01c01ec2adb5cdac038f8ac.tar.bz2
icestorm-0d3ee2655f340d8db01c01ec2adb5cdac038f8ac.zip
Fix to enable a clean build on Mac OS X.
The fix will check to see if you are compiling on Mac OS X and set the correct LDLIBS and CFLAGS for Mac OS X. This attempts to detect the correct version of the FTDI headers and sets the correct CFLAGS for the version of the FTDI headers installed.
Diffstat (limited to 'iceprog')
-rw-r--r--iceprog/Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/iceprog/Makefile b/iceprog/Makefile
index fdeadf5..ee080e1 100644
--- a/iceprog/Makefile
+++ b/iceprog/Makefile
@@ -1,12 +1,19 @@
include ../config.mk
+LIBFTDI_VERSION = $(shell $(PKG_CONFIG) --modversion libftdi1 2>/dev/null)
+ifneq ($(LIBFTDI_VERSION),)
+ LIBFTDI_NAME = ftdi1
+else
+ LIBFTDI_NAME = ftdi
+endif
+
UNAME := $(shell uname -s)
ifneq ($(UNAME),Darwin)
LDLIBS = -L/usr/local/lib -lm
CFLAGS = -MD -O0 -ggdb -Wall -std=c99 -I/usr/local/include
else
- LDLIBS = -L/usr/local/lib -L/opt/local/lib -lftdi -lm
- CFLAGS = -MD -O0 -ggdb -Wall -std=c99 -I/usr/local/include -I/opt/local/include/
+ LDLIBS = -L/usr/local/lib -l${LIBFTDI_NAME} -lm
+ CFLAGS = -MD -O0 -ggdb -Wall -std=c99 -I/usr/local/include
endif
ifeq ($(STATIC),1)