aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2004-10-18 21:10:49 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2004-10-18 21:10:49 +0000
commita71ce6ca986dacad105df7823476e6f1a0756819 (patch)
tree08064faadc249a077bfa063d36a27c223e8d1529 /Makefile
parentf3747e4a3a388b98e1877e3984adcbf459f4a24c (diff)
[hid] now outputs downcased event names from input.h and Makefile should work on MacOSX and GNU/Linux
svn path=/trunk/externals/hcs/hid/; revision=2121
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 29 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index dc8be9d..a205252 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,30 @@
CC=gcc
-all: input_arrays pd_darwin
+OS_NAME = $(shell uname -s)
+
-pd_darwin: hid.pd_darwin macosxhid.pd_darwin
+# ----------------------- GNU/LINUX i386 -----------------------
+ifeq ($(OS_NAME),Linux)
+LDFLAGS = -export_dynamic -shared
+.SUFFIXES: .pd_linux
-clean: ; rm -f *.pd_darwin *.o *~ input_arrays.h
+all: input_arrays pd_linux
+pd_linux: hid.pd_linux
-# ----------------------- DARWIN i386 -----------------------
+endif
+# ----------------------- DARWIN -----------------------
+ifeq ($(OS_NAME),Darwin)
+LDFLAGS = -bundle -bundle_loader $(PDEXECUTABLE) -L/sw/lib
.SUFFIXES: .pd_darwin
+all: input_arrays pd_darwin
+pd_darwin: hid.pd_darwin
+
+endif
+
+# ----------------------- GENERAL -----------------------
+
PDEXECUTABLE = ../../../pd/bin/pd
CFLAGS = -DUNIX -DPD -O2 -funroll-loops -fomit-frame-pointer \
@@ -18,11 +33,19 @@ CFLAGS = -DUNIX -DPD -O2 -funroll-loops -fomit-frame-pointer \
INCLUDE = -I../ -I../../../pd/src -I/usr/local/include -I./HID\ Utilities\ Source
-LDFLAGS = -bundle -bundle_loader $(PDEXECUTABLE) -L/sw/lib
-
.c.pd_darwin:
$(CC) $(CFLAGS) $(INCLUDE) -o $*.o -c $*.c
$(CC) $(LDFLAGS) -o "$*.pd_darwin" "$*.o" -lc -lm
+.c.pd_linux:
+ $(CC) $(CFLAGS) $(INCLUDE) -o $*.o -c $*.c
+ ld $(LDFLAGS) -o $*.pd_linux $*.o -lc -lm
+ strip --strip-unneeded $*.pd_linux
+ rm $*.o
+
input_arrays:
./make-arrays-from-input.h.pl > input_arrays.h
+
+
+clean: ; rm -f *.pd_* *.o *~ input_arrays.h
+