aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--iceprog/Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/iceprog/Makefile b/iceprog/Makefile
index 5b9f790..9cadccf 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
+
+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
ifeq ($(STATIC),1)
LDFLAGS += -static