From a4b050c8ef223992d6be6835dd7ffb4f3801e198 Mon Sep 17 00:00:00 2001 From: "Adam D. Horden" Date: Sun, 4 Sep 2016 11:00:00 +0100 Subject: 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. --- iceprog/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'iceprog') diff --git a/iceprog/Makefile b/iceprog/Makefile index 5b9f790..fdeadf5 100644 --- a/iceprog/Makefile +++ b/iceprog/Makefile @@ -1,6 +1,13 @@ include ../config.mk -LDLIBS = -L/usr/local/lib -lm -CFLAGS = -MD -O0 -ggdb -Wall -std=c99 -I/usr/local/include + +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/ +endif ifeq ($(STATIC),1) LDFLAGS += -static -- cgit v1.2.3 From 0d3ee2655f340d8db01c01ec2adb5cdac038f8ac Mon Sep 17 00:00:00 2001 From: "Adam D. Horden" Date: Sun, 4 Sep 2016 11:48:12 +0100 Subject: 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. --- iceprog/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'iceprog') 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) -- cgit v1.2.3 From 612ea8366290c11e5ec45b9830fe6f2e12df5ea9 Mon Sep 17 00:00:00 2001 From: "Adam D. Horden" Date: Sun, 4 Sep 2016 13:49:53 +0100 Subject: 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. --- iceprog/Makefile | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'iceprog') 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 -- cgit v1.2.3