aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2010-02-09 21:05:37 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2010-02-09 21:05:37 +0000
commitf9e3fe480e7e3c448a626d508f1976f4fec2f759 (patch)
tree4c82fc18ec367525537358a0be41d9be8ab55bad
parent10c09b5f8fafb9bf02fd8ad21e7093fb55e14b45 (diff)
convert file layout to libdir style and setup everything with the new template Makefile+debian stuff
svn path=/trunk/externals/sigpack/; revision=13153
-rw-r--r--Makefile238
-rw-r--r--chop~-help.pd (renamed from help/chop~-help.pd)0
-rw-r--r--chop~.c (renamed from source/chop~.c)0
-rw-r--r--decimate~-help.pd (renamed from help/decimate~-help.pd)0
-rw-r--r--decimate~.c (renamed from source/decimate~.c)0
-rw-r--r--diode~-help.pd (renamed from help/diode~-help.pd)0
-rw-r--r--diode~.c (renamed from source/diode~.c)0
-rw-r--r--foldback~-help.pd (renamed from help/foldback~-help.pd)0
-rw-r--r--foldback~.c (renamed from source/foldback~.c)0
-rw-r--r--foldover~-help.pd (renamed from help/foldover~-help.pd)0
-rw-r--r--foldover~.c (renamed from source/foldover~.c)0
-rw-r--r--freqdiv~-help.pd (renamed from help/freqdiv~-help.pd)0
-rw-r--r--freqdiv~.c (renamed from source/freqdiv~.c)0
-rw-r--r--freqshift~-help.pd (renamed from help/freqshift~-help.pd)0
-rw-r--r--freqshift~.c (renamed from source/freqshift~.c)0
-rw-r--r--harmgen~-help.pd (renamed from help/harmgen~-help.pd)0
-rw-r--r--harmgen~.c (renamed from source/harmgen~.c)0
-rw-r--r--rectify~-help.pd (renamed from help/rectify~-help.pd)0
-rw-r--r--rectify~.c (renamed from source/rectify~.c)0
-rw-r--r--round~-help.pd (renamed from help/round~-help.pd)0
-rw-r--r--round~.c (renamed from source/round~.c)0
-rw-r--r--sIgpAck.c (renamed from source/sIgpAck.c)0
-rw-r--r--saturate~-help.pd (renamed from help/saturate~-help.pd)0
-rw-r--r--saturate~.c (renamed from source/saturate~.c)0
-rw-r--r--sieve~-help.pd (renamed from help/sieve~-help.pd)0
-rw-r--r--sieve~.c (renamed from source/sieve~.c)0
-rw-r--r--sigpack-meta.pd8
-rw-r--r--split~-help.pd (renamed from help/split~-help.pd)0
-rw-r--r--split~.c (renamed from source/split~.c)0
-rw-r--r--ustep~-help.pd (renamed from help/ustep~-help.pd)0
-rw-r--r--ustep~.c (renamed from source/ustep~.c)0
-rw-r--r--vowel~-help.pd (renamed from help/vowel~-help.pd)0
-rw-r--r--vowel~.c (renamed from source/vowel~.c)0
33 files changed, 236 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 576ff87..b6be885 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,235 @@
-TARGET := $(shell pwd | sed 's|.*/\(.*\)$$|\1|')
-EXTERNALS_ROOT := $(shell pwd | sed 's|^\(/.*externals\).*|\1|')
+# To use this Makefile for your project, first put the name of your library in
+# LIBRARY_NAME variable. The folder for your project should have the same name
+# as your library.
+LIBRARY_NAME = sigpack
+LIBRARY_VERSION = 0.0.3.1
-default:
- make -C $(EXTERNALS_ROOT) $(TARGET)
+# Next, add your .c source files to the SOURCES variable. The help files will
+# be included automatically
+SOURCES = chop~.c decimate~.c diode~.c foldback~.c foldover~.c freqdiv~.c freqshift~.c harmgen~.c rectify~.c round~.c saturate~.c sieve~.c split~.c ustep~.c vowel~.c
+
+
+# For objects that only build on certain platforms, add those to the SOURCES
+# line for the right platforms.
+SOURCES_android =
+SOURCES_cygwin =
+SOURCES_macosx =
+SOURCES_iphoneos =
+SOURCES_linux =
+SOURCES_windows =
+
+# list all pd objects (i.e. myobject.pd) files here, and their helpfiles will
+# be included automatically
+PDOBJECTS =
+
+# if you want to include any other files in the source and binary tarballs,
+# list them here. This can be anything from header files, READMEs, example
+# patches, documentation, etc.
+EXTRA_DIST = readme.txt sIgpAck.c LICENSE
+
+
+#------------------------------------------------------------------------------#
+#
+# you shouldn't need to edit anything below here, if we did it right :)
+#
+#------------------------------------------------------------------------------#
+
+# where Pd lives
+PD_PATH = ../../pd
+# where to install the library
+prefix = /usr/local
+libdir = $(prefix)/lib
+pkglibdir = $(libdir)/pd-externals
+objectsdir = $(pkglibdir)
+
+
+INSTALL = install
+INSTALL_FILE = $(INSTALL) -p -m 644
+INSTALL_DIR = $(INSTALL) -p -m 755 -d
+
+CFLAGS = -DPD -I$(PD_PATH)/src -Wall -W -g
+LDFLAGS =
+LIBS =
+ALLSOURCES := $(SOURCES) $(SOURCES_android) $(SOURCES_cygwin) $(SOURCES_macosx) \
+ $(SOURCES_iphoneos) $(SOURCES_linux) $(SOURCES_windows)
+
+UNAME := $(shell uname -s)
+ifeq ($(UNAME),Darwin)
+ CPU := $(shell uname -p)
+ ifeq ($(CPU),arm) # iPhone/iPod Touch
+ SOURCES += $(SOURCES_macosx)
+ EXTENSION = pd_darwin
+ OS = iphoneos
+ IPHONE_BASE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
+ CC=$(IPHONE_BASE)/gcc
+ CPP=$(IPHONE_BASE)/cpp
+ CXX=$(IPHONE_BASE)/g++
+ ISYSROOT = -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk
+ IPHONE_CFLAGS = -miphoneos-version-min=3.0 $(ISYSROOT) -arch armv6
+ OPT_CFLAGS = -fast -funroll-loops -fomit-frame-pointer
+ CFLAGS := $(IPHONE_CFLAGS) $(OPT_CFLAGS) $(CFLAGS)
+ LDFLAGS += -arch armv6 -bundle -undefined dynamic_lookup $(ISYSROOT)
+ LIBS += -lc
+ STRIP = strip -x
+ DISTDIR=$(LIBRARY_NAME)-$(LIBRARY_VERSION)
+ DISTBINDIR=$(DISTDIR)-$(OS)
+ else # Mac OS X
+ SOURCES += $(SOURCES_macosx)
+ EXTENSION = pd_darwin
+ OS = macosx
+ OPT_CFLAGS = -ftree-vectorize -ftree-vectorizer-verbose=2 -fast
+ FAT_FLAGS = -arch i386 -arch ppc -mmacosx-version-min=10.4
+ CFLAGS += $(FAT_FLAGS) -fPIC -I/sw/include
+ LDFLAGS += $(FAT_FLAGS) -bundle -undefined dynamic_lookup -L/sw/lib
+ # if the 'pd' binary exists, check the linking against it to aid with stripping
+ LDFLAGS += $(shell test -e $(PD_PATH)/bin/pd && echo -bundle_loader $(PD_PATH)/bin/pd)
+ LIBS += -lc
+ STRIP = strip -x
+ DISTDIR=$(LIBRARY_NAME)-$(LIBRARY_VERSION)
+ DISTBINDIR=$(DISTDIR)-$(OS)
+ endif
+endif
+ifeq ($(UNAME),Linux)
+ SOURCES += $(SOURCES_linux)
+ EXTENSION = pd_linux
+ OS = linux
+ OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
+ CFLAGS += -fPIC
+ LDFLAGS += -Wl,--export-dynamic -shared -fPIC
+ LIBS += -lc
+ STRIP = strip --strip-unneeded -R .note -R .comment
+ DISTDIR=$(LIBRARY_NAME)-$(LIBRARY_VERSION)
+ DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
+endif
+ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
+ SOURCES += $(SOURCES_cygwin)
+ EXTENSION = dll
+ OS = cygwin
+ OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
+ CFLAGS +=
+ LDFLAGS += -Wl,--export-dynamic -shared -L$(PD_PATH)/src
+ LIBS += -lc -lpd
+ STRIP = strip --strip-unneeded -R .note -R .comment
+ DISTDIR=$(LIBRARY_NAME)-$(LIBRARY_VERSION)
+ DISTBINDIR=$(DISTDIR)-$(OS)
+endif
+ifeq (MINGW,$(findstring MINGW,$(UNAME)))
+ SOURCES += $(SOURCES_windows)
+ EXTENSION = dll
+ OS = windows
+ OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer -march=i686 -mtune=pentium4
+ WINDOWS_HACKS = -D'O_NONBLOCK=1'
+ CFLAGS += -mms-bitfields $(WINDOWS_HACKS)
+ LDFLAGS += -s -shared -Wl,--enable-auto-import
+ LIBS += -L$(PD_PATH)/src -L$(PD_PATH)/bin -L$(PD_PATH)/obj -lpd -lwsock32 -lkernel32 -luser32 -lgdi32
+ STRIP = strip --strip-unneeded -R .note -R .comment
+ DISTDIR=$(LIBRARY_NAME)-$(LIBRARY_VERSION)
+ DISTBINDIR=$(DISTDIR)-$(OS)
+endif
+
+CFLAGS += $(OPT_CFLAGS)
+
+
+.PHONY = install libdir_install single_install install-doc install-exec clean dist etags
+
+all: $(SOURCES:.c=.$(EXTENSION))
+
+%.o: %.c
+ $(CC) $(CFLAGS) -o "$*.o" -c "$*.c"
+
+%.$(EXTENSION): %.o
+ $(CC) $(LDFLAGS) -o "$*.$(EXTENSION)" "$*.o" $(LIBS)
+ chmod a-x "$*.$(EXTENSION)"
+
+# this links everything into a single binary file
+$(LIBRARY_NAME): $(SOURCES:.c=.o) $(LIBRARY_NAME).o
+ $(CC) $(LDFLAGS) -o $(LIBRARY_NAME).$(EXTENSION) $(SOURCES:.c=.o) $(LIBRARY_NAME).o $(LIBS)
+ chmod a-x $(LIBRARY_NAME).$(EXTENSION)
+
+
+install: libdir_install
+
+# The meta and help files are explicitly installed to make sure they are
+# actually there. Those files are not optional, then need to be there.
+libdir_install: $(SOURCES:.c=.$(EXTENSION)) install-doc
+ $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ $(INSTALL_FILE) $(LIBRARY_NAME)-meta.pd \
+ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ test -z "$(SOURCES)" || (\
+ $(INSTALL_FILE) $(SOURCES:.c=.$(EXTENSION)) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) && \
+ $(STRIP) $(addprefix $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/,$(SOURCES:.c=.$(EXTENSION))))
+ test -z "$(PDOBJECTS)" || \
+ $(INSTALL_FILE) $(OBJECTS) \
+ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+
+# install library linked as single binary
+single_install: $(LIBRARY_NAME) install-doc install-exec
+ $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ $(INSTALL_FILE) $(LIBRARY_NAME).$(EXTENSION) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ $(STRIP) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/$(LIBRARY_NAME).$(EXTENSION)
+
+install-doc:
+ $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ test -z "$(SOURCES)" || \
+ $(INSTALL_FILE) $(SOURCES:.c=-help.pd) \
+ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ test -z "$(PDOBJECTS)" || \
+ $(INSTALL_FILE) $(PDOBJECTS:.pd=-help.pd) \
+ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ $(INSTALL_FILE) readme.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/readme.txt
-install:
- make -C $(EXTERNALS_ROOT) $(TARGET)_install
clean:
- make -C $(EXTERNALS_ROOT) $(TARGET)_clean
+ -rm -f -- $(SOURCES:.c=.o)
+ -rm -f -- $(SOURCES:.c=.$(EXTENSION))
+ -rm -f -- $(LIBRARY_NAME).$(EXTENSION)
+
+distclean: clean
+ -rm -f -- $(DISTBINDIR).tar.gz
+ -rm -rf -- $(DISTBINDIR)
+ -rm -f -- $(DISTDIR).tar.gz
+ -rm -rf -- $(DISTDIR)
+
+
+$(DISTBINDIR):
+ $(INSTALL_DIR) $(DISTBINDIR)
+
+libdir: all $(DISTBINDIR)
+ $(INSTALL_FILE) $(LIBRARY_NAME)-meta.pd $(DISTBINDIR)
+ $(INSTALL_FILE) $(SOURCES) $(DISTBINDIR)
+ $(INSTALL_FILE) $(SOURCES:.c=-help.pd) $(DISTBINDIR)
+ test -z "$(EXTRA_DIST)" || \
+ $(INSTALL_FILE) $(EXTRA_DIST) $(DISTBINDIR)
+# tar --exclude-vcs -czpf $(DISTBINDIR).tar.gz $(DISTBINDIR)
+
+$(DISTDIR):
+ $(INSTALL_DIR) $(DISTDIR)
+
+dist: $(DISTDIR)
+ $(INSTALL_FILE) Makefile $(DISTDIR)
+ $(INSTALL_FILE) $(LIBRARY_NAME)-meta.pd $(DISTDIR)
+ test -z "$(ALLSOURCES)" || \
+ $(INSTALL_FILE) $(ALLSOURCES) $(DISTDIR)
+ test -z "$(ALLSOURCES)" || \
+ $(INSTALL_FILE) $(ALLSOURCES:.c=-help.pd) $(DISTDIR)
+ test -z "$(PDOBJECTS)" || \
+ $(INSTALL_FILE) $(PDOBJECTS) $(DISTDIR)
+ test -z "$(PDOBJECTS)" || \
+ $(INSTALL_FILE) $(PDOBJECTS:.pd=-help.pd) $(DISTDIR)
+ test -z "$(EXTRA_DIST)" || \
+ $(INSTALL_FILE) $(EXTRA_DIST) $(DISTDIR)
+ tar --exclude-vcs -czpf $(DISTDIR).tar.gz $(DISTDIR)
-test_locations:
- make -C $(EXTERNALS_ROOT) test_locations
etags:
- etags *.[ch] ~/cvs/pure-data/pd/src/*.[ch] /usr/include/*.h /usr/include/sys/*.h
+ etags *.h $(SOURCES) ../../pd/src/*.[ch] /usr/include/*.h /usr/include/*/*.h
+
+showpaths:
+ @echo "PD_PATH: $(PD_PATH)"
+ @echo "objectsdir: $(objectsdir)"
+ @echo "LIBRARY_NAME: $(LIBRARY_NAME)"
+ @echo "SOURCES: $(SOURCES)"
+ @echo "ALLSOURCES: $(ALLSOURCES)"
+ @echo "UNAME: $(UNAME)"
+ @echo "CPU: $(CPU)"
+
diff --git a/help/chop~-help.pd b/chop~-help.pd
index e0ccf9e..e0ccf9e 100644
--- a/help/chop~-help.pd
+++ b/chop~-help.pd
diff --git a/source/chop~.c b/chop~.c
index 1d8c35a..1d8c35a 100644
--- a/source/chop~.c
+++ b/chop~.c
diff --git a/help/decimate~-help.pd b/decimate~-help.pd
index 8ea60ee..8ea60ee 100644
--- a/help/decimate~-help.pd
+++ b/decimate~-help.pd
diff --git a/source/decimate~.c b/decimate~.c
index 6468d20..6468d20 100644
--- a/source/decimate~.c
+++ b/decimate~.c
diff --git a/help/diode~-help.pd b/diode~-help.pd
index 3d0334e..3d0334e 100644
--- a/help/diode~-help.pd
+++ b/diode~-help.pd
diff --git a/source/diode~.c b/diode~.c
index 546ba27..546ba27 100644
--- a/source/diode~.c
+++ b/diode~.c
diff --git a/help/foldback~-help.pd b/foldback~-help.pd
index 4a7e944..4a7e944 100644
--- a/help/foldback~-help.pd
+++ b/foldback~-help.pd
diff --git a/source/foldback~.c b/foldback~.c
index a40f408..a40f408 100644
--- a/source/foldback~.c
+++ b/foldback~.c
diff --git a/help/foldover~-help.pd b/foldover~-help.pd
index d52a192..d52a192 100644
--- a/help/foldover~-help.pd
+++ b/foldover~-help.pd
diff --git a/source/foldover~.c b/foldover~.c
index 9b1c699..9b1c699 100644
--- a/source/foldover~.c
+++ b/foldover~.c
diff --git a/help/freqdiv~-help.pd b/freqdiv~-help.pd
index 6e5c5f5..6e5c5f5 100644
--- a/help/freqdiv~-help.pd
+++ b/freqdiv~-help.pd
diff --git a/source/freqdiv~.c b/freqdiv~.c
index 0155172..0155172 100644
--- a/source/freqdiv~.c
+++ b/freqdiv~.c
diff --git a/help/freqshift~-help.pd b/freqshift~-help.pd
index c0b5b09..c0b5b09 100644
--- a/help/freqshift~-help.pd
+++ b/freqshift~-help.pd
diff --git a/source/freqshift~.c b/freqshift~.c
index 026e4cb..026e4cb 100644
--- a/source/freqshift~.c
+++ b/freqshift~.c
diff --git a/help/harmgen~-help.pd b/harmgen~-help.pd
index 8c4e90a..8c4e90a 100644
--- a/help/harmgen~-help.pd
+++ b/harmgen~-help.pd
diff --git a/source/harmgen~.c b/harmgen~.c
index aea31e1..aea31e1 100644
--- a/source/harmgen~.c
+++ b/harmgen~.c
diff --git a/help/rectify~-help.pd b/rectify~-help.pd
index 4ebb2c8..4ebb2c8 100644
--- a/help/rectify~-help.pd
+++ b/rectify~-help.pd
diff --git a/source/rectify~.c b/rectify~.c
index 4e5c3eb..4e5c3eb 100644
--- a/source/rectify~.c
+++ b/rectify~.c
diff --git a/help/round~-help.pd b/round~-help.pd
index 00e11dc..00e11dc 100644
--- a/help/round~-help.pd
+++ b/round~-help.pd
diff --git a/source/round~.c b/round~.c
index 2edd047..2edd047 100644
--- a/source/round~.c
+++ b/round~.c
diff --git a/source/sIgpAck.c b/sIgpAck.c
index e666e75..e666e75 100644
--- a/source/sIgpAck.c
+++ b/sIgpAck.c
diff --git a/help/saturate~-help.pd b/saturate~-help.pd
index a576666..a576666 100644
--- a/help/saturate~-help.pd
+++ b/saturate~-help.pd
diff --git a/source/saturate~.c b/saturate~.c
index 9438e8e..9438e8e 100644
--- a/source/saturate~.c
+++ b/saturate~.c
diff --git a/help/sieve~-help.pd b/sieve~-help.pd
index f121e6d..f121e6d 100644
--- a/help/sieve~-help.pd
+++ b/sieve~-help.pd
diff --git a/source/sieve~.c b/sieve~.c
index 293d4e2..293d4e2 100644
--- a/source/sieve~.c
+++ b/sieve~.c
diff --git a/sigpack-meta.pd b/sigpack-meta.pd
new file mode 100644
index 0000000..f4d23dd
--- /dev/null
+++ b/sigpack-meta.pd
@@ -0,0 +1,8 @@
+#N canvas 10 10 200 200 10;
+#N canvas 20 20 420 300 META 0;
+#X text 10 10 META this is a prototype of a libdir meta file;
+#X text 10 30 NAME sigpack;
+#X text 10 50 AUTHOR weiss@weiss-archiv.de;
+#X text 10 70 LICENSE GNU GPL 2;
+#X text 10 90 VERSION 0.0.3.1;
+#X restore 10 10 pd META;
diff --git a/help/split~-help.pd b/split~-help.pd
index 9f4f8b5..9f4f8b5 100644
--- a/help/split~-help.pd
+++ b/split~-help.pd
diff --git a/source/split~.c b/split~.c
index 49b8d82..49b8d82 100644
--- a/source/split~.c
+++ b/split~.c
diff --git a/help/ustep~-help.pd b/ustep~-help.pd
index 81cf303..81cf303 100644
--- a/help/ustep~-help.pd
+++ b/ustep~-help.pd
diff --git a/source/ustep~.c b/ustep~.c
index b7ea923..b7ea923 100644
--- a/source/ustep~.c
+++ b/ustep~.c
diff --git a/help/vowel~-help.pd b/vowel~-help.pd
index 442032f..442032f 100644
--- a/help/vowel~-help.pd
+++ b/vowel~-help.pd
diff --git a/source/vowel~.c b/vowel~.c
index 87b8e39..87b8e39 100644
--- a/source/vowel~.c
+++ b/vowel~.c