Commit 4aca21da authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

improvements for building fluid~ and disis_munger~

parent a1b3ebd0
......@@ -128,10 +128,12 @@ CXXFLAGS = $(CFLAGS)
#
# WARNING! this MUST be all on one line because the automatic package
# building scripts rely on it being that way.
LIB_TARGETS = adaptive arraysize bassemu boids bsaylor comport creb cxc cyclone earplug ekext ext13 freeverb ggee hcs iem_ambi iem_bin_ambi iemlib iemgui iemguts iem_adaptfilt iemmatrix iemxmlrpc iem_delay iem_roomsim iem_spec2 iem_tab jasch_lib loaders-hexloader loaders-libdir mapping markex maxlib mjlib moocow moonlib motex mrpeach oscx pan pdcontainer pddp pdogg plugin pmpd sigpack smlib tof unauthorized vanilla vbap windowing zexy
LIB_TARGETS = adaptive arraysize bassemu boids bsaylor comport creb cxc cyclone earplug ekext ext13 freeverb ggee hcs iem_ambi iem_bin_ambi iemlib iemgui iemguts iem_adaptfilt iemmatrix iemxmlrpc iem_delay iem_roomsim iem_spec2 iem_tab jasch_lib loaders-hexloader loaders-libdir mapping markex maxlib mjlib moocow moonlib motex mrpeach oscx pan pdcontainer pddp pdogg plugin pmpd sigpack smlib tof unauthorized vanilla vbap windowing zexy flext
# DISABLED: flatgui
# NEW (IN-PROGRESS): flext
# this is for libraries that don't compile (yet) on all platforms
ifeq ($(OS_NAME),windows)
LIB_TARGETS +=
......@@ -464,6 +466,53 @@ flatgui_install:
flatgui_clean:
make -C $(externals_src)/flatgui clean
#------------------------------------------------------------------------------#
# FLEXT and FLEXT externals
flext:
cd $(externals_src)/grill/trunk/flext && \
./bootstrap.sh && \
./build.sh pd gcc build && \
cp -f ../../../../l2ork_addons/flext/config-lnx-pd-gcc.txt buildsys/ && \
./build.sh pd gcc build && \
./build.sh pd gcc build && \
./build.sh pd gcc install
#fluid~
cd footils/fluid && \
../../grill/trunk/flext/build.sh pd gcc build && \
../../grill/trunk/flext/build.sh pd gcc build
#disis_munger~
cd ../l2ork_addons/disis_munger && \
../../externals/grill/trunk/flext/build.sh pd gcc build && \
../../externals/grill/trunk/flext/build.sh pd gcc build
flext_install:
# we don't install flext but rather link it statically,
# so we only install statically linked externals
#fluid~
cd footils/fluid && \
install -D pd-linux/release-multi/fluid~.pd_linux $(DESTDIR)$(objectsdir)/flext/fluid~.pd_linux && \
install -D pd/* $(DESTDIR)$(objectsdir)/flext/
#disis_munger~
cd ../l2ork_addons/disis_munger && \
install -D pd-linux/release-multi/disis_munger~.pd_linux $(DESTDIR)$(objectsdir)/flext/disis_munger~.pd_linux && \
install -D *help.pd $(DESTDIR)$(objectsdir)/flext/
flext_clean:
#flext
cd grill/trunk/flext/ && \
./build.sh pd gcc clean
#fluid~
cd footils/fluid && \
../../grill/trunk/flext/build.sh pd gcc clean
#fluid~
cd ../l2ork_addons/disis_munger && \
../../externals/grill/trunk/flext/build.sh pd gcc clean
#------------------------------------------------------------------------------#
# FLIB
......@@ -482,15 +531,8 @@ flib_install: flib
install -p $(FLIB_OBJECTS:.c=.$(EXTENSION)) $(DESTDIR)$(objectsdir)/$(FLIB_NAME)
install -p $(externals_src)/postlude/flib/doc/*.pd \
$(DESTDIR)$(objectsdir)/$(FLIB_NAME)
# install -d $(DESTDIR)$(manualsdir)/$(FLIB_NAME)
# install -p $(externals_src)/postlude/flib/manual.txt \
# $(DESTDIR)$(manualsdir)/$(FLIB_NAME)
install -d $(DESTDIR)$(readmesdir)
install -p $(externals_src)/postlude/flib/README \
$(DESTDIR)$(readmesdir)/$(FLIB_NAME).txt
# install -d $(DESTDIR)$(examplesdir)/$(FLIB_NAME)
# install -p $(externals_src)/postlude/flib/examples/*.pd \
# $(DESTDIR)$(examplesdir)/$(FLIB_NAME)
$(DESTDIR)$(objectsdir)/$(FLIB_NAME)/README.txt
flib_clean:
-rm -f -- $(FLIB_OBJECTS:.c=.$(EXTENSION))
......@@ -1435,17 +1477,10 @@ postlude_install: postlude
install -p $(POSTLUDE_OBJECTS:.c=.$(EXTENSION)) $(DESTDIR)$(objectsdir)/$(POSTLUDE_NAME)
install -p $(externals_src)/postlude/dssi/doc/output~.pd \
$(DESTDIR)$(objectsdir)/$(POSTLUDE_NAME)
# install -d $(DESTDIR)$(manualsdir)/$(POSTLUDE_NAME)
# install -p $(externals_src)/postlude/manual.txt \
# $(DESTDIR)$(manualsdir)/$(POSTLUDE_NAME)
install -d $(DESTDIR)$(readmesdir)
install -p $(externals_src)/postlude/dssi/README \
$(DESTDIR)$(readmesdir)/$(POSTLUDE_NAME)-dssi.txt
$(DESTDIR)$(objectsdir)/$(POSTLUDE_NAME)/README-dssi.txt
install -p $(externals_src)/postlude/psql/README \
$(DESTDIR)$(readmesdir)/$(POSTLUDE_NAME)-psql.txt
install -d $(DESTDIR)$(examplesdir)/$(POSTLUDE_NAME)
# install -p $(externals_src)/postlude/examples/*.pd \
# $(DESTDIR)$(examplesdir)/$(POSTLUDE_NAME)
$(DESTDIR)$(objectsdir)/$(POSTLUDE_NAME)README-psql.txt
postlude_clean:
-rm -f -- $(POSTLUDE_OBJECTS:.c=.$(EXTENSION))
......
......@@ -4,7 +4,7 @@
#
# where are the PD header files?
PDPATH=/usr/include
PDPATH=../../../pd/src
# where do the flext libraries reside?
FLEXTPATH=/usr/lib/pd/flext
......
......@@ -8,7 +8,7 @@
include config-pd-linux.txt
FLEXTLIB=$(FLEXTPATH)/flext.a # take threaded library for all
#FLEXTLIB= -lflext-pd # take threaded library for all
#FLUIDLIB=/usr/local/lib/libfluidsynth.a
FLUIDLIB=-L/usr/local/lib -lfluidsynth -lreadline
......@@ -16,10 +16,10 @@ PDEXTRA=$(DESTDIR)/usr/lib/pd/extra
# compiler+linker stuff ### EDIT! ###
#CXX=g++ #-3.2
INCLUDES=$(PDPATH)/src $(FLEXTINC)
INCLUDES=../../../pd/src ../../grill/trunk/flext/source/
LIBPATH=
FLAGS=-DPD
CFLAGS=-O6 -mcpu=pentiumpro
CFLAGS=-O6 -fPIC
LIBS=m
STRIP = strip --strip-unneeded -R .note -R .comment
......@@ -51,7 +51,7 @@ $(OUTPATH)/%.o : %/main.cpp
$(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(FLEXTPATH)) $< -o $@
$(OUTPATH)/%.pd_linux : $(OUTPATH)/%.o
$(CXX) $(LDFLAGS) -shared $(patsubst %,-L%,$(LIBPATH)) $^ $(patsubst %,-l%,$(LIBS)) $(FLUIDLIB) $(FLEXTLIB) -o $@
$(CXX) $(LDFLAGS) -shared $(patsubst %,-L%,$(LIBPATH)) $^ $(patsubst %,-l%,$(LIBS)) $(FLUIDLIB) -o $@
$(STRIP) $@
chmod 755 $@
......
NAME=fluid~
BUILDDIR=build
SRCDIR=fluid
SRCS=main.cpp
PDPATH=../../../pd
INCPATH+=-I../../grill/trunk/flext/source
LIBPATH+=-L../../grill/trunk/flext/libbuild/lib
BUILDTYPE=multi
BUILDDIR=build
......@@ -99,7 +99,7 @@ to adapt to new samplerates.;
#X text 345 700 a little helper;
#N canvas 402 274 605 444 dust 0;
#X obj 119 135 del 10;
#X obj 119 41 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
#X obj 119 41 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X floatatom 386 66 5 0 0 1 dustiness - -;
#X floatatom 386 164 5 0 0 1 note_range - -;
......@@ -149,6 +149,7 @@ to adapt to new samplerates.;
#X connect 20 0 0 1;
#X restore 709 715 pd dust;
#X text 601 716 A composition:;
#X msg 705 87 load /home/ico/Downloads/Soundfonts/jRhodes3.sf2;
#X connect 9 0 13 0;
#X connect 10 0 13 0;
#X connect 11 0 10 0;
......@@ -196,3 +197,4 @@ to adapt to new samplerates.;
#X connect 68 0 64 0;
#X connect 71 0 19 0;
#X connect 73 0 72 0;
#X connect 77 0 13 0;
......@@ -76,7 +76,7 @@ static void knob_draw_update(t_knob *x, t_glist *glist)
int x2 = text_xpix(&x->x_gui.x_obj, glist) + radius + radius * sin( -angle);
int y2 = text_ypix(&x->x_gui.x_obj, glist) + radius + radius * cos( angle);
sys_vgui(".x%x.c coords %xKNOB %d %d %d %d\n",
sys_vgui(".x%lx.c coords %xKNOB %d %d %d %d\n",
glist_getcanvas(glist), x,
x1, /* x1 */
y1, /* y1 */
......@@ -86,7 +86,7 @@ static void knob_draw_update(t_knob *x, t_glist *glist)
/* post("knob: (%d, %d) (%d, %d)", x1,y1,x2,y2); */
sys_vgui(".x%x.c itemconfigure %xBASE -start %d -extent %d \n", glist_getcanvas(glist), x,
sys_vgui(".x%lx.c itemconfigure %xBASE -start %d -extent %d \n", glist_getcanvas(glist), x,
start, extent);
}
}
......@@ -110,20 +110,20 @@ static void knob_draw_new(t_knob *x, t_glist *glist)
/* BASE2 */
sys_vgui(".x%x.c create arc %d %d %d %d -outline #%6.6x -style arc -width 3 -start -80 -extent 340 -tags %xBASE2\n",
sys_vgui(".x%lx.c create arc %d %d %d %d -outline #%6.6x -style arc -width 3 -start -80 -extent 340 -tags %xBASE2\n",
canvas,
xpos, ypos, /* upper left */
xpos + x->x_gui.x_h, ypos + x->x_gui.x_h, /* lower right */
x->x_gui.x_fcol, x);
/* BASE */
sys_vgui(".x%x.c create arc %d %d %d %d -fill #%6.6x -style arc -width 3 -start -80 -extent 340 -tags %xBASE\n",
sys_vgui(".x%lx.c create arc %d %d %d %d -fill #%6.6x -style arc -width 3 -start -80 -extent 340 -tags %xBASE\n",
canvas,
xpos, ypos, /* upper left */
xpos + x->x_gui.x_h, ypos + x->x_gui.x_h, /* lower right */
x->x_gui.x_bcol, x);
/* LINE */
sys_vgui(".x%x.c create line %d %d %d %d -width 3 -fill #%6.6x -capstyle round -tags %xKNOB\n",
sys_vgui(".x%lx.c create line %d %d %d %d -width 3 -fill #%6.6x -capstyle round -tags %xKNOB\n",
canvas,
x1, /* x1 */
y1, /* y1 */
......@@ -132,19 +132,19 @@ static void knob_draw_new(t_knob *x, t_glist *glist)
x->x_gui.x_fcol, /* color */
x);
sys_vgui(".x%x.c create text %d %d -text {%s} -anchor w \
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %xLABEL\n",
canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xOUT%d\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %xOUT%d\n",
canvas,
xpos, ypos + x->x_gui.x_h+2,
xpos+7, ypos + x->x_gui.x_h+3,
x, 0);
if(!x->x_gui.x_fsf.x_rcv_able)
sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xIN%d\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %xIN%d\n",
canvas,
xpos, ypos-2,
xpos+7, ypos-1,
......@@ -169,7 +169,7 @@ static void knob_draw_move(t_knob *x, t_glist *glist)
sys_vgui(".x%x.c coords %xKNOB %d %d %d %d\n",
sys_vgui(".x%lx.c coords %xKNOB %d %d %d %d\n",
canvas, x,
x1, /* x1 */
y1, /* y1 */
......@@ -178,25 +178,25 @@ static void knob_draw_move(t_knob *x, t_glist *glist)
);
/* post("knob: (%d, %d) (%d, %d)", x1,y1,x2,y2); */
sys_vgui(".x%x.c coords %xBASE %d %d %d %d\n",
sys_vgui(".x%lx.c coords %xBASE %d %d %d %d\n",
canvas, x,
xpos, ypos,
xpos + x->x_gui.x_h, ypos + x->x_gui.x_h);
sys_vgui(".x%x.c coords %xBASE2 %d %d %d %d\n",
sys_vgui(".x%lx.c coords %xBASE2 %d %d %d %d\n",
canvas, x,
xpos, ypos,
xpos + x->x_gui.x_h, ypos + x->x_gui.x_h);
sys_vgui(".x%x.c coords %xLABEL %d %d\n",
sys_vgui(".x%lx.c coords %xLABEL %d %d\n",
canvas, x, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%x.c coords %xOUT%d %d %d %d %d\n",
sys_vgui(".x%lx.c coords %xOUT%d %d %d %d %d\n",
canvas, x, 0,
xpos, ypos + x->x_gui.x_h+2,
xpos+7, ypos + x->x_gui.x_h+3);
if(!x->x_gui.x_fsf.x_rcv_able)
sys_vgui(".x%x.c coords %xIN%d %d %d %d %d\n",
sys_vgui(".x%lx.c coords %xIN%d %d %d %d %d\n",
canvas, x, 0,
xpos, ypos-2,
xpos+7, ypos-1);
......@@ -206,29 +206,29 @@ static void knob_draw_erase(t_knob* x,t_glist* glist)
{
t_canvas *canvas=glist_getcanvas(glist);
sys_vgui(".x%x.c delete %xBASE\n", canvas, x);
sys_vgui(".x%x.c delete %xBASE2\n", canvas, x);
sys_vgui(".x%x.c delete %xKNOB\n", canvas, x);
sys_vgui(".x%x.c delete %xLABEL\n", canvas, x);
sys_vgui(".x%lx.c delete %xBASE\n", canvas, x);
sys_vgui(".x%lx.c delete %xBASE2\n", canvas, x);
sys_vgui(".x%lx.c delete %xKNOB\n", canvas, x);
sys_vgui(".x%lx.c delete %xLABEL\n", canvas, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0);
sys_vgui(".x%lx.c delete %xOUT%d\n", canvas, x, 0);
if(!x->x_gui.x_fsf.x_rcv_able)
sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0);
sys_vgui(".x%lx.c delete %xIN%d\n", canvas, x, 0);
}
static void knob_draw_config(t_knob* x,t_glist* glist)
{
t_canvas *canvas=glist_getcanvas(glist);
sys_vgui(".x%x.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n",
sys_vgui(".x%lx.c itemconfigure %xLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize,
x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"");
sys_vgui(".x%x.c itemconfigure %xKNOB -fill #%6.6x\n", canvas,
sys_vgui(".x%lx.c itemconfigure %xKNOB -fill #%6.6x\n", canvas,
x, x->x_gui.x_fcol);
sys_vgui(".x%x.c itemconfigure %xBASE2 -outline #%6.6x\n", canvas,
sys_vgui(".x%lx.c itemconfigure %xBASE2 -outline #%6.6x\n", canvas,
x, x->x_gui.x_fcol);
sys_vgui(".x%x.c itemconfigure %xBASE -fill #%6.6x\n", canvas,
sys_vgui(".x%lx.c itemconfigure %xBASE -fill #%6.6x\n", canvas,
x, x->x_gui.x_bcol);
}
......@@ -239,21 +239,21 @@ static void knob_draw_io(t_knob* x,t_glist* glist, int old_snd_rcv_flags)
t_canvas *canvas=glist_getcanvas(glist);
if((old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && !x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xOUT%d\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %xOUT%d\n",
canvas,
xpos, ypos + x->x_gui.x_h+2,
xpos+7, ypos + x->x_gui.x_h+3,
x, 0);
if(!(old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%x.c delete %xOUT%d\n", canvas, x, 0);
sys_vgui(".x%lx.c delete %xOUT%d\n", canvas, x, 0);
if((old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && !x->x_gui.x_fsf.x_rcv_able)
sys_vgui(".x%x.c create rectangle %d %d %d %d -tags %xIN%d\n",
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %xIN%d\n",
canvas,
xpos, ypos-2,
xpos+7, ypos-1,
x, 0);
if(!(old_snd_rcv_flags & IEM_GUI_OLD_RCV_FLAG) && x->x_gui.x_fsf.x_rcv_able)
sys_vgui(".x%x.c delete %xIN%d\n", canvas, x, 0);
sys_vgui(".x%lx.c delete %xIN%d\n", canvas, x, 0);
}
static void knob_draw_select(t_knob *x, t_glist *glist)
......@@ -263,16 +263,16 @@ static void knob_draw_select(t_knob *x, t_glist *glist)
if(x->x_gui.x_fsf.x_selected)
{
pd_bind(&x->x_gui.x_obj.ob_pd, iemgui_key_sym);
sys_vgui(".x%x.c itemconfigure %xBASE2 -outline #%6.6x\n", canvas, x, IEM_GUI_COLOR_SELECTED);
sys_vgui(".x%x.c itemconfigure %xBASE -fill #%6.6x\n", canvas, x, IEM_GUI_COLOR_SELECTED);
sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, IEM_GUI_COLOR_SELECTED);
sys_vgui(".x%lx.c itemconfigure %xBASE2 -outline #%6.6x\n", canvas, x, IEM_GUI_COLOR_SELECTED);
sys_vgui(".x%lx.c itemconfigure %xBASE -fill #%6.6x\n", canvas, x, IEM_GUI_COLOR_SELECTED);
sys_vgui(".x%lx.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, IEM_GUI_COLOR_SELECTED);
}
else
{
pd_unbind(&x->x_gui.x_obj.ob_pd, iemgui_key_sym);
sys_vgui(".x%x.c itemconfigure %xBASE -fill #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL);
sys_vgui(".x%x.c itemconfigure %xBASE2 -outline #%6.6x\n", canvas, x, x->x_gui.x_fcol);
sys_vgui(".x%x.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, x->x_gui.x_lcol);
sys_vgui(".x%lx.c itemconfigure %xBASE -fill #%6.6x\n", canvas, x, IEM_GUI_COLOR_NORMAL);
sys_vgui(".x%lx.c itemconfigure %xBASE2 -outline #%6.6x\n", canvas, x, x->x_gui.x_fcol);
sys_vgui(".x%lx.c itemconfigure %xLABEL -fill #%6.6x\n", canvas, x, x->x_gui.x_lcol);
}
}
......
......@@ -34,7 +34,7 @@ $(TARGETPATH)/%.o : $(SRCDIR)/%.c
$(TARGET):: $(TARGETPATH)
$(TARGET):: $(COBJS) $(CPPOBJS)
$(CXX) $(LDFLAGS) $(LIBPATH) -o $@ $(COBJS) $(CPPOBJS) $(LIBS)
$(CXX) $(LDFLAGS) $(LIBPATH) -o $@ $(COBJS) $(CPPOBJS) $(LIBS)
chmod 755 $@
ifndef DEBUG
ifndef PROFILE
......
NAME=psql
CSYM=psql
## Pd library template version 1.0.12
# For instructions on how to use this template, see:
# http://puredata.info/docs/developer/MakefileTemplate
LIBRARY_NAME = psql
PDDIR=/usr/local/lib/pd
INCLUDE = -I/usr/include/postgresql
# add your .c source files, one object per file, to the SOURCES
# variable, help files will be included automatically, and for GUI
# objects, the matching .tcl file too
SOURCES = psql.c
all: pd_linux
current: pd_linux
# list all pd objects (i.e. myobject.pd) files here, and their helpfiles will
# be included automatically
PDOBJECTS =
LDFLAGS = -lc -lm -lpq
# example patches and related files, in the 'examples' subfolder
EXAMPLES =
# Postgres ----------------------
# manuals and related files, in the 'manual' subfolder
MANUAL =
SRCDIR= /usr/include
TARGDIR= ./
# if you want to include any other files in the source and binary tarballs,
# list them here. This can be anything from header files, test patches,
# documentation, etc. README.txt and LICENSE.txt are required and therefore
# automatically included
EXTRA_DIST =
#include Makefile.global #needed for postgresql stuff
# unit tests and related files here, in the 'unittests' subfolder
UNITTESTS =
# Linux ----------------------------------------------
pd_linux: $(NAME).pd_linux
.SUFFIXES: .pd_linux
#------------------------------------------------------------------------------#
#
# things you might need to edit if you are using other C libraries
#
#------------------------------------------------------------------------------#
LINUXCFLAGS = -g -DPD -O0 -fPIC -funroll-loops -fomit-frame-pointer \
-Wall -W -Wshadow -Wstrict-prototypes -Werror \
-Wno-unused -Wno-parentheses -Wno-switch
ALL_CFLAGS = -I"$(PD_INCLUDE)" -I/usr/include/postgresql -I/sw/include/postgresql
ALL_LDFLAGS =
SHARED_LDFLAGS =
ALL_LIBS = -lpq
.c.pd_linux:
$(CC) $(LINUXCFLAGS) $(INCLUDE) -o $*.o -c $*.c
$(CC) --export-dynamic -shared -o $*.pd_linux $*.o $(LDFLAGS)
strip --strip-unneeded $*.pd_linux
rm $*.o
# Darwin ----------------------------------------------
pd_darwin: $(NAME).pd_darwin
#------------------------------------------------------------------------------#
#
# you shouldn't need to edit anything below here, if we did it right :)
#
#------------------------------------------------------------------------------#
.SUFFIXES: .pd_darwin
# these can be set from outside without (usually) breaking the build
CFLAGS = -Wall -W -g
LDFLAGS =
LIBS =
DARWINCFLAGS = -DPD -O3 -Wall -W -Wshadow -Wstrict-prototypes \
-Wno-unused -Wno-parentheses -Wno-switch -L/usr/local/lib/
# get library version from meta file
LIBRARY_VERSION = $(shell sed -n 's|^\#X text [0-9][0-9]* [0-9][0-9]* VERSION \(.*\);|\1|p' $(LIBRARY_NAME)-meta.pd)
.c.pd_darwin:
$(CC) $(DARWINCFLAGS) $(INCLUDE) -o $*.o -c $*.c
$(CC) -bundle -undefined dynamic_lookup -o $(NAME).pd_darwin $*.o $(LDFLAGS)
rm -f *.o
ALL_CFLAGS += -DPD -DVERSION='"$(LIBRARY_VERSION)"'
# Install ----------------------------------------------
PD_INCLUDE = $(PD_PATH)/include/pd
# where to install the library, overridden below depending on platform
prefix = /usr/local
libdir = $(prefix)/lib
pkglibdir = $(libdir)/pd-externals
objectsdir = $(pkglibdir)
install:
cp $(NAME).pd_* $(PDDIR)/extra/
INSTALL = install
INSTALL_PROGRAM = $(INSTALL) -p -m 644
INSTALL_DATA = $(INSTALL) -p -m 644
INSTALL_DIR = $(INSTALL) -p -m 755 -d
# Clean ----------------------------------------------
ALLSOURCES := $(SOURCES) $(SOURCES_android) $(SOURCES_cygwin) $(SOURCES_macosx) \
$(SOURCES_iphoneos) $(SOURCES_linux) $(SOURCES_windows) \
$(SOURCES_gnu)
DISTDIR=$(LIBRARY_NAME)-$(LIBRARY_VERSION)
ORIGDIR=pd-$(LIBRARY_NAME:~=)_$(LIBRARY_VERSION)
UNAME := $(shell uname -s)
ifeq ($(UNAME),Darwin)
CPU := $(shell uname -p)
ifeq ($(CPU),arm) # iPhone/iPod Touch
SOURCES += $(SOURCES_iphoneos)
EXTENSION = pd_darwin
SHARED_EXTENSION = dylib
OS = iphoneos
PD_PATH = /Applications/Pd-extended.app/Contents/Resources
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
ALL_CFLAGS := $(IPHONE_CFLAGS) $(ALL_CFLAGS)
ALL_LDFLAGS += -arch armv6 -bundle -undefined dynamic_lookup $(ISYSROOT)
SHARED_LDFLAGS += -arch armv6 -dynamiclib -undefined dynamic_lookup $(ISYSROOT)
ALL_LIBS += -lc $(LIBS_iphoneos)
STRIP = strip -x
DISTBINDIR=$(DISTDIR)-$(OS)
else # Mac OS X
SOURCES += $(SOURCES_macosx)
EXTENSION = pd_darwin
SHARED_EXTENSION = dylib
OS = macosx
PD_PATH = /Applications/Pd-extended.app/Contents/Resources
OPT_CFLAGS = -ftree-vectorize -ftree-vectorizer-verbose=2 -fast
# build universal 32-bit on 10.4 and 32/64 on newer
ifeq ($(shell uname -r | sed 's|\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*|\1|'), 8)
FAT_FLAGS = -arch ppc -arch i386 -mmacosx-version-min=10.4
else
FAT_FLAGS = -arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=10.4
SOURCES += $(SOURCES_iphoneos)
endif
ALL_CFLAGS += $(FAT_FLAGS) -fPIC -I/sw/include
# if the 'pd' binary exists, check the linking against it to aid with stripping
BUNDLE_LOADER = $(shell test ! -e $(PD_PATH)/bin/pd || echo -bundle_loader $(PD_PATH)/bin/pd)
ALL_LDFLAGS += $(FAT_FLAGS) -headerpad_max_install_names -bundle $(BUNDLE_LOADER) \
-undefined dynamic_lookup -L/sw/lib
SHARED_LDFLAGS += $(FAT_FLAGS) -dynamiclib -undefined dynamic_lookup \
-install_name @loader_path/$(SHARED_LIB) -compatibility_version 1 -current_version 1.0
ALL_LIBS += -lc $(LIBS_macosx)
STRIP = strip -x
DISTBINDIR=$(DISTDIR)-$(OS)
# install into ~/Library/Pd on Mac OS X since /usr/local isn't used much
pkglibdir=$(HOME)/Library/Pd
endif
endif
# Tho Android uses Linux, we use this fake uname to provide an easy way to
# setup all this things needed to cross-compile for Android using the NDK
ifeq ($(UNAME),ANDROID)
CPU := arm
SOURCES += $(SOURCES_android)
EXTENSION = pd_linux
SHARED_EXTENSION = so
OS = android
PD_PATH = /usr
NDK_BASE := /usr/local/android-ndk
NDK_PLATFORM_VERSION := 5
NDK_SYSROOT=$(NDK_BASE)/platforms/android-$(NDK_PLATFORM_VERSION)/arch-arm
NDK_UNAME := $(shell uname -s | tr '[A-Z]' '[a-z]')
NDK_TOOLCHAIN_BASE=$(NDK_BASE)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/$(NDK_UNAME)-x86
CC := $(NDK_TOOLCHAIN_BASE)/bin/arm-linux-androideabi-gcc --sysroot=$(NDK_SYSROOT)
OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
CFLAGS +=
LDFLAGS += -rdynamic -shared
SHARED_LDFLAGS += -Wl,-soname,$(SHARED_LIB) -shared
LIBS += -lc $(LIBS_android)
STRIP := $(NDK_TOOLCHAIN_BASE)/bin/arm-linux-androideabi-strip \
--strip-unneeded -R .note -R .comment
DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
endif
ifeq ($(UNAME),Linux)
CPU := $(shell uname -m)
SOURCES += $(SOURCES_linux)
EXTENSION = pd_linux
SHARED_EXTENSION = so
OS = linux
PD_PATH = /usr
OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
ALL_CFLAGS += -fPIC
ALL_LDFLAGS += -rdynamic -shared -fPIC -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags
SHARED_LDFLAGS += -Wl,-soname,$(SHARED_LIB) -shared
ALL_LIBS += -lc $(LIBS_linux)
STRIP = strip --strip-unneeded -R .note -R .comment
DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
endif
ifeq ($(UNAME),GNU)
# GNU/Hurd, should work like GNU/Linux for basically all externals
CPU := $(shell uname -m)
SOURCES += $(SOURCES_linux)
EXTENSION = pd_linux
SHARED_EXTENSION = so
OS = linux
PD_PATH = /usr
OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
ALL_CFLAGS += -fPIC
ALL_LDFLAGS += -rdynamic -shared -fPIC -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags
SHARED_LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB)
ALL_LIBS += -lc $(LIBS_linux)
STRIP = strip --strip-unneeded -R .note -R .comment
DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
endif
ifeq ($(UNAME),GNU/kFreeBSD)
# Debian GNU/kFreeBSD, should work like GNU/Linux for basically all externals
CPU := $(shell uname -m)
SOURCES += $(SOURCES_linux)
EXTENSION = pd_linux
SHARED_EXTENSION = so
OS = linux
PD_PATH = /usr
OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
ALL_CFLAGS += -fPIC
ALL_LDFLAGS += -rdynamic -shared -fPIC -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags
SHARED_LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB)
ALL_LIBS += -lc $(LIBS_linux)