aboutsummaryrefslogtreecommitdiffstats
path: root/iceprog
diff options
context:
space:
mode:
authorAdam D. Horden <adam.horden+github@horden.me>2016-09-04 13:49:53 +0100
committerAdam D. Horden <adam.horden+github@horden.me>2016-09-04 13:49:53 +0100
commit612ea8366290c11e5ec45b9830fe6f2e12df5ea9 (patch)
tree859acd6fae30248e462c76c2073216a7397b21d3 /iceprog
parent0d3ee2655f340d8db01c01ec2adb5cdac038f8ac (diff)
downloadicestorm-612ea8366290c11e5ec45b9830fe6f2e12df5ea9.tar.gz
icestorm-612ea8366290c11e5ec45b9830fe6f2e12df5ea9.tar.bz2
icestorm-612ea8366290c11e5ec45b9830fe6f2e12df5ea9.zip
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. Cleaned up Makefile and removed verbose checking of FTDI version. Cleaned up Makefile and removed verbose checking of uname.
Diffstat (limited to 'iceprog')
-rw-r--r--iceprog/Makefile11
1 files changed, 2 insertions, 9 deletions
diff --git a/iceprog/Makefile b/iceprog/Makefile
index ee080e1..9cadccf 100644
--- a/iceprog/Makefile
+++ b/iceprog/Makefile
@@ -1,17 +1,10 @@
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)
+ifneq ($(shell uname -s),Darwin)
LDLIBS = -L/usr/local/lib -lm
CFLAGS = -MD -O0 -ggdb -Wall -std=c99 -I/usr/local/include
else
+ LIBFTDI_NAME = $(shell $(PKG_CONFIG) --exists libftdi1 && echo ftdi1 || echo ftdi)
LDLIBS = -L/usr/local/lib -l${LIBFTDI_NAME} -lm
CFLAGS = -MD -O0 -ggdb -Wall -std=c99 -I/usr/local/include
endif