aboutsummaryrefslogtreecommitdiff
path: root/tracker/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tracker/makefile')
-rw-r--r--tracker/makefile36
1 files changed, 27 insertions, 9 deletions
diff --git a/tracker/makefile b/tracker/makefile
index 1014845..64512a8 100644
--- a/tracker/makefile
+++ b/tracker/makefile
@@ -1,19 +1,37 @@
-all: tracker.pd_linux
-tracker.pd_linux: tracker.c tracker.h tracker.tk2c
+all: pd_linux
+
+SUFFIX=pd_linux
+#SUFFIX=pd_darwin
+
+$(SUFFIX): tracker.$(SUFFIX)
+tracker.$(SUFFIX): tracker.c tracker.h tracker.tk2c
+
+pd_darwin: tracker.pd_darwin
+tracker.pd_: tracker.c tracker.h tracker.tk2c
STRIP = strip
-CFLAGS = -DPD -DUNIX -O2 -funroll-loops -fomit-frame-pointer \
+CFLAGS = -DPD -O2 \
-Wall -W -Wno-shadow -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch \
- -I/usr/include -I../pd/src
+ -Wno-unused -Wno-parentheses -Wno-switch
+INCLUDE = -I/usr/include -I../pd/src
+LDFLAGS =
+
+ifeq ($(SUFFIX),pd_linux)
+ CFLAGS += -DUNIX -funroll-loops -fomit-frame-pointer
+ LDFLAGS += -export_dynamic -shared -lc -lm
+endif
+ifeq ($(SUFFIX),pd_darwin)
+ LDFLAGS += -bundle -undefined suppress -flat_namespace
+ STRIP = false
+endif
-.SUFFIXES: .pd_linux .tk .tk2c
+.SUFFIXES: .$(SUFFIX) .tk .tk2c
.tk.tk2c:
./tk2c.bash < $*.tk > $*.tk2c
-.c.pd_linux:
- $(CC) $(CFLAGS) -o $*.o -c $*.c
- $(LD) -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm
+.c.$(SUFFIX):
+ $(CC) $(CFLAGS) $(INCLUDE) -o $*.o -c $*.c
+ $(LD) $(LDFLAGS) -o $*.pd_linux $*.o
$(STRIP) --strip-unneeded $*.pd_linux
clean:
$(RM) -f *.o *.pd_* so_locations *.tk2c