From 6399d444c572093ab8bc356be0cb915b33265415 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sun, 7 Sep 2003 00:42:00 +0000 Subject: *** empty log message *** svn path=/trunk/externals/tb/; revision=934 --- tbext/config-pd-linux.txt | 36 ++++++++++++++ tbext/make-files.txt | 4 +- tbext/makefile | 114 --------------------------------------------- tbext/makefile.pd-linux | 92 ++++++++++++++++++++++++++++++++++++ tbext/source/main.cpp | 5 +- tbext/source/tbroute.cpp | 16 +++---- tbext/source/tbsroute~.cpp | 12 ++--- tbext/source/tbstrg.cpp | 2 +- 8 files changed, 150 insertions(+), 131 deletions(-) create mode 100755 tbext/config-pd-linux.txt delete mode 100644 tbext/makefile create mode 100644 tbext/makefile.pd-linux (limited to 'tbext') diff --git a/tbext/config-pd-linux.txt b/tbext/config-pd-linux.txt new file mode 100755 index 0000000..e1fa248 --- /dev/null +++ b/tbext/config-pd-linux.txt @@ -0,0 +1,36 @@ +# config file for tbext, adapted from Thomas Grill's xsample makefile + +# your c++ compiler (if not g++) + CXX=icc + + +# where does the PD installation reside? +PD=/usr/lib/pd + +# where are the PD header files? +# leave it blank if it is a system directory (like /usr/local/include), +# since gcc 3.2 complains about it +PDINC=/home/tim/pd/devel_0_36/pd/src + +# where do the flext libraries reside? +FLEXTPATH=/usr/lib/flext + +# where should xsample objects be built? +TARGDIR=./pd-linux + +# where should xsample be installed? +# (leave blank to omit installation) +INSTDIR=${PD}/externs + +# where should the xsample help be installed? +# (leave blank to omit installation) +HELPDIR=${PD}/doc/5.reference + +# additional compiler flags +# (check whether they fit to your system!) +UFLAGS=-xW -tpp7 -ip -ipo_obj -g # icc +# UFLAGS=-mcpu=pentium4 -mmmx -msse2 -msse -mfpmath=sse # gcc 3.2 + +# define to link against shared flext library (flext version >= 0.5.0) +FLEXT_SHARED=1 + diff --git a/tbext/make-files.txt b/tbext/make-files.txt index 609e57b..ba3fe55 100755 --- a/tbext/make-files.txt +++ b/tbext/make-files.txt @@ -1,6 +1,8 @@ # all the source files from the package +SRCDIR = source SRCS= \ - main.cpp tbroute.cpp tbstrg.cpp tbsig~.cpp tbsroute~.cpp tbpow~.cpp + main.cpp tbroute.cpp tbsig~.cpp tbsroute~.cpp tbpow~.cpp tbfft1.cpp # tbg7xx.cpp tbstrg.cpp + #HDRS= \ main.h diff --git a/tbext/makefile b/tbext/makefile deleted file mode 100644 index a9577e7..0000000 --- a/tbext/makefile +++ /dev/null @@ -1,114 +0,0 @@ -# Makefile for icc @ linux adapted from Thomas Grill's xsample makefile -# -# usage: -# to build run "make" -# to install (as root), do "make install" -# - - - - -# your c++ compiler (if not g++) - CXX=icc - -# where does the PD installation reside? -PD=/usr/lib/pdsrc/pd - -# where are the PD header files? -# leave it blank if it is a system directory (like /usr/local/include), -# since gcc 3.2 complains about it -PDINC= - -# where do the flext libraries reside? -FLEXTPATH=/usr/lib/flext - -# where should the objects be built? -TARGDIR=./ - -# where should tbext be installed? -# (leave blank to omit installation) -INSTDIR=${PD}/externs - -# where should the tbext help be installed? -# (leave blank to omit installation) -HELPDIR=${PD}/doc/5.reference - -# additional compiler flags -# (check whether they fit to your system!) -# UFLAGS=-mcpu=pentiumpro # gcc 2.95 -# UFLAGS=-mcpu=pentium4 -mmmx -msse2 -msse -mfpmath=sse # gcc 3.2 -UFLAGS= -O3 -xW -tpp7 -ip -ipo #icc - - -FLEXTLIB=$(FLEXTPATH)/flext.a - -# compiler stuff -INCLUDES=$(PDINC) -FLAGS=-DFLEXT_SYS=2 -D__GNUG__ -CFLAGS=${UFLAGS} -O6 -funroll-loops -fmove-all-movables -frerun-loop-opt -finline-functions -fno-rtti -fno-exceptions -LDFLAGS=$(CFLAGS) -LIBS=m - -# ---------------------------------------------- -# the rest can stay untouched -# ---------------------------------------------- - -NAME=tbext -SRCDIR=source - -include make-files.txt - -MAKEFILE=makefile -TARGET=$(TARGDIR)/$(NAME).pd_linux - -# default target -all: $(TARGDIR) $(TARGET) - -$(patsubst %,$(SRCDIR)/%,$(SRCS)): $(patsubst %,$(SRCDIR)/%,$(HDRS)) $(MAKEFILE) $(CONFIG) - touch $(patsubst %,$(SRCDIR)/%,$(SRCS)) - -$(TARGDIR): - -mkdir $(TARGDIR) - -$(TARGDIR)/%.o : $(SRCDIR)/%.cpp - $(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(FLEXTPATH)) $< -o $@ - -$(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS)) $(FLEXTLIB) - $(CXX) $(LDFLAGS) -shared $^ $(patsubst %,-l%,$(LIBS)) -o $@ - strip --strip-unneeded $@ - chmod 755 $@ - -$(INSTDIR): - -mkdir $(INSTDIR) - -install:: $(INSTDIR) - -install:: $(TARGET) - cp $^ $(INSTDIR) - chown root.root $(patsubst %,$(INSTDIR)/%,$(notdir $^)) - -$(HELPDIR): - -mkdir $(HELPDIR) - -install-help:: $(HELPDIR) - -install-help:: ./pd - chmod 644 $^/*.* - cp $^/*.* $(HELPDIR) - - -.PHONY: clean -clean: - rm -f $(TARGDIR)/*.o $(TARGDIR)/*.il $(TARGET) - - - - - - - - - - - - diff --git a/tbext/makefile.pd-linux b/tbext/makefile.pd-linux new file mode 100644 index 0000000..25b7f3b --- /dev/null +++ b/tbext/makefile.pd-linux @@ -0,0 +1,92 @@ +# xsample - extended sample objects for Max/MSP and pd (pure data) +# Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +# +# Makefile for gcc @ linux +# +# usage: +# to build run "make -f makefile.pd-linux" +# to install (as root), do "make -f makefile.pd-linux install" +# + +CONFIG=config-pd-linux.txt + +include ${CONFIG} + +FLEXTLIB=$(FLEXTPATH)/flext.a + +# compiler stuff +INCLUDES=$(PDINC) +FLAGS=-DFLEXT_SYS=2 +CFLAGS=${UFLAGS} -O3 -I/usr/lib/flext -funroll-loops -fmove-all-movables -frerun-loop-opt -finline-functions -fno-rtti -fno-exceptions +LIBS=m + +ifdef FLEXT_SHARED +CFLAGS+=-DFLEXT_SHARED -DFLEXT_THREADS +LDFLAGS+=-Bdynamic +LINKFLEXT=-lflext #-L/usr/lib/flext/libflext.so +else +LINKFLEXT=$(FLEXTLIB) +endif + +# ---------------------------------------------- +# the rest can stay untouched +# ---------------------------------------------- + +NAME=tbext + +include make-files.txt + +MAKEFILE=makefile.pd-linux +TARGET=$(TARGDIR)/$(NAME).pd_linux + +# default target +all: $(TARGDIR) $(TARGET) + +$(patsubst %,$(SRCDIR)/%,$(SRCS)): $(patsubst %,$(SRCDIR)/%,$(HDRS)) $(MAKEFILE) $(CONFIG) + touch $(patsubst %,$(SRCDIR)/%,$(SRCS)) + +$(TARGDIR): + -mkdir $(TARGDIR) + +$(TARGDIR)/%.o : $(SRCDIR)/%.cpp + $(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(FLEXTPATH)) $< -o $@ + +$(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS)) + $(CXX) $(LDFLAGS) -shared $^ $(patsubst %,-l%,$(LIBS)) -L$(FLEXTPATH) $(LINKFLEXT) -o $@ + strip --strip-unneeded $@ + chmod 755 $@ + +$(INSTDIR): + -mkdir $(INSTDIR) + +install:: $(INSTDIR) + +install:: $(TARGET) + cp $^ $(INSTDIR) + chown root.root $(patsubst %,$(INSTDIR)/%,$(notdir $^)) + +$(HELPDIR): + -mkdir $(HELPDIR) + +install-help:: $(HELPDIR) + +install-help:: ./pd + chmod 644 $^/*.* + cp $^/*.* $(HELPDIR) + + +.PHONY: clean +clean: + rm -f $(TARGDIR)/*.o $(TARGET) + + + + + + + + + + + + diff --git a/tbext/source/main.cpp b/tbext/source/main.cpp index c4317fd..9cfbd24 100644 --- a/tbext/source/main.cpp +++ b/tbext/source/main.cpp @@ -54,10 +54,13 @@ void ttbext_setup() post(""); FLEXT_SETUP(tbroute); - FLEXT_SETUP(tbstrg); + //FLEXT_SETUP(tbstrg); FLEXT_DSP_SETUP(tbsroute); FLEXT_DSP_SETUP(tbsig); FLEXT_DSP_SETUP(tbpow); + // FLEXT_DSP_SETUP(tbg7xx); + FLEXT_DSP_SETUP(tbfft1); + } diff --git a/tbext/source/tbroute.cpp b/tbext/source/tbroute.cpp index 83d85a0..3218886 100644 --- a/tbext/source/tbroute.cpp +++ b/tbext/source/tbroute.cpp @@ -40,7 +40,6 @@ /* */ /* */ - #include #if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 400) @@ -52,31 +51,32 @@ class tbroute: public flext_base FLEXT_HEADER(tbroute,flext_base); public: // constructor - tbroute(t_int chan); + tbroute(int chan); protected: void route(t_float f); void routebang(); - void set_route(t_int i); + void set_route(int i); private: FLEXT_CALLBACK_1(route,t_float); FLEXT_CALLBACK(routebang); - FLEXT_CALLBACK_1(set_route,t_int); - t_int dest; + FLEXT_CALLBACK_1(set_route,int); + + int dest; }; FLEXT_LIB_1("tbroute",tbroute,int); -tbroute::tbroute(t_int chan) +tbroute::tbroute(int chan) { AddInAnything(); AddInInt(); - for (t_int i=0; i!=chan;++i) + for (int i=0; i!=chan;++i) { AddOutAnything(); } @@ -98,7 +98,7 @@ void tbroute::routebang() ToOutBang(dest); } -void tbroute::set_route(t_int i) +void tbroute::set_route(int i) { --i; if ((i>-1) && (i-1) && (i