From 3d594931321f7b3b18f05144c51934195cb4c7ce Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sun, 1 Jun 2008 18:15:56 +0000 Subject: got rid of warnings and made build on Mac OS X svn path=/trunk/externals/jackx/; revision=9960 --- jackx.c | 7 +++++-- makefile | 35 ++++++++++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/jackx.c b/jackx.c index 9c04bd6..75042ce 100644 --- a/jackx.c +++ b/jackx.c @@ -33,6 +33,9 @@ #include "m_pd.h" #include +#include +#include +#include #include #include #include @@ -72,7 +75,7 @@ methods for jack-ports void jackports_input(t_jackports *x, t_symbol *s,int argc, t_atom *argv) { if (jc){ - char ** ports; + const char ** ports; int l = 0; int n = 0; @@ -287,7 +290,7 @@ void jackconnect_query(t_jackconnect *x) { if (jc) { - char **ports; + const char **ports; int n=0; jackconnect_getnames(x); diff --git a/makefile b/makefile index 787cb8c..8cf65aa 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,32 @@ -jackx: jackx.c - gcc $(CFLAGS) $(LINUXCFLAGS) $(LINUXINCLUDE) -o jackx.o -c jackx.c - ld -export_dynamic -shared -o jackx.pd_linux jackx.o -lc -lm - strip --strip-unneeded jackx.pd_linux - rm jackx.o +CFLAGS = -DPD $(OPT_CFLAGS) -I../../pd/src -Wall -W $(DEBUG_CFLAGS) +LDFLAGS = +LIBS = -lm +UNAME := $(shell uname -s) +ifeq ($(UNAME),Linux) + OS_NAME = linux + EXTENSION = pd_linux + CFLAGS += -DUNIX -Dunix -fPIC + LDFLAGS += -Wl,-export_dynamic -shared +endif +ifeq ($(UNAME),Darwin) + OS_NAME = darwin + EXTENSION = pd_darwin + CFLAGS += -DMACOSX -DUNIX -Dunix + LDFLAGS += -bundle -bundle_loader ../../pd/bin/pd -undefined dynamic_lookup +endif + +all: jackx.$(EXTENSION) + +%.o: %.c + $(CC) $(CFLAGS) -o "$*.o" -c "$*.c" + +%.$(EXTENSION): %.o + $(CC) $(LDFLAGS) -o "$*.$(EXTENSION)" "$*.o" $(LIBS) + chmod a-x "$*.$(EXTENSION)" + rm -f -- $*.o + +clean: + -rm -f -- jackx.$(EXTENSION) + -rm -f -- jackx.o -- cgit v1.2.1