aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/buildsys
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2004-12-20 05:06:19 +0000
committerThomas Grill <xovo@users.sourceforge.net>2004-12-20 05:06:19 +0000
commit6dacabe813f4ccab33669b5dd3e3b5f61be500af (patch)
tree81abcc117357483b0a0dc0a1a7ba5b118964775f /externals/grill/flext/buildsys
parent5370cdab3db6ddfa60fef41ca22756284fa700dd (diff)
simplified make system
updated make system for BCC updated make system updated build system svn path=/trunk/; revision=2416
Diffstat (limited to 'externals/grill/flext/buildsys')
-rw-r--r--externals/grill/flext/buildsys/bmake-flext.inc90
-rw-r--r--externals/grill/flext/buildsys/bmake-sub.mak28
-rw-r--r--externals/grill/flext/buildsys/bmake.mak141
-rw-r--r--externals/grill/flext/buildsys/build-bcc.bat3
-rw-r--r--externals/grill/flext/buildsys/build-cygwin.sh3
-rw-r--r--externals/grill/flext/buildsys/build-gcc.sh3
-rw-r--r--externals/grill/flext/buildsys/build-mingw.bat3
-rw-r--r--externals/grill/flext/buildsys/build-msvc.bat3
-rw-r--r--externals/grill/flext/buildsys/gnumake-flext.inc89
-rw-r--r--externals/grill/flext/buildsys/gnumake-sub.mak29
-rw-r--r--externals/grill/flext/buildsys/gnumake.mak150
-rw-r--r--externals/grill/flext/buildsys/lnx/make-gcc.inc68
-rw-r--r--externals/grill/flext/buildsys/lnx/pd/config-gcc.def15
-rw-r--r--externals/grill/flext/buildsys/lnx/pd/make-gcc.inc10
-rw-r--r--externals/grill/flext/buildsys/mac/make-gcc.inc68
-rw-r--r--externals/grill/flext/buildsys/mac/pd/config-gcc.def18
-rw-r--r--externals/grill/flext/buildsys/mac/pd/make-gcc.inc10
-rw-r--r--externals/grill/flext/buildsys/nmake-flext.inc88
-rw-r--r--externals/grill/flext/buildsys/nmake-sub.mak27
-rw-r--r--externals/grill/flext/buildsys/nmake.mak142
-rw-r--r--externals/grill/flext/buildsys/win/make-bcc.inc128
-rw-r--r--externals/grill/flext/buildsys/win/make-cygwin.inc92
-rw-r--r--externals/grill/flext/buildsys/win/make-mingw.inc93
-rw-r--r--externals/grill/flext/buildsys/win/make-msvc.inc103
-rw-r--r--externals/grill/flext/buildsys/win/max/config-mingw.def17
-rw-r--r--externals/grill/flext/buildsys/win/max/config-msvc.def17
-rw-r--r--externals/grill/flext/buildsys/win/max/make-mingw.inc10
-rw-r--r--externals/grill/flext/buildsys/win/max/make-msvc.inc10
-rw-r--r--externals/grill/flext/buildsys/win/pd/config-bcc.def19
-rw-r--r--externals/grill/flext/buildsys/win/pd/config-cygwin.def15
-rw-r--r--externals/grill/flext/buildsys/win/pd/config-mingw.def15
-rw-r--r--externals/grill/flext/buildsys/win/pd/config-msvc.def19
-rw-r--r--externals/grill/flext/buildsys/win/pd/make-bcc.inc8
-rw-r--r--externals/grill/flext/buildsys/win/pd/make-cygwin.inc11
-rw-r--r--externals/grill/flext/buildsys/win/pd/make-mingw.inc9
-rw-r--r--externals/grill/flext/buildsys/win/pd/make-msvc.inc9
36 files changed, 1563 insertions, 0 deletions
diff --git a/externals/grill/flext/buildsys/bmake-flext.inc b/externals/grill/flext/buildsys/bmake-flext.inc
new file mode 100644
index 00000000..9ee6e5c4
--- /dev/null
+++ b/externals/grill/flext/buildsys/bmake-flext.inc
@@ -0,0 +1,90 @@
+##############################################
+# flext defines
+##############################################
+
+!ifdef SHARED
+# --- shared ---
+DEFS=$(DEFS) /DFLEXT_SHARED
+
+!else
+!ifdef THREADED
+# --- static multi-threaded ---
+DEFS=$(DEFS) /DFLEXT_THREADS
+
+!else
+# --- static single-threaded ---
+
+!endif
+!endif
+
+
+!ifdef FLEXTBUILD
+DEFS=$(DEFS) /DFLEXT_EXPORTS
+!endif
+
+##############################################
+# name of flext library
+##############################################
+
+!ifdef SHARED
+
+!ifdef DEBUG
+FLEXTNAME=flext-$(RTSYS)_d
+!else
+FLEXTNAME=flext-$(RTSYS)
+!endif
+
+!else
+
+!ifdef THREADED
+!ifdef DEBUG
+FLEXTNAME=flext-$(RTSYS)_td
+!else
+FLEXTNAME=flext-$(RTSYS)_t
+!endif
+!else
+!ifdef DEBUG
+FLEXTNAME=flext-$(RTSYS)_d
+!else
+FLEXTNAME=flext-$(RTSYS)
+!endif
+!endif
+
+!endif # SHARED
+
+##############################################
+# build subdirectories
+##############################################
+
+!ifdef FLEXTBUILD
+
+!ifdef SHARED
+
+!ifdef DEBUG
+OUTSUB=dd
+!else
+OUTSUB=dr
+!endif
+
+!else # SHARED
+
+!ifdef THREADED
+!ifdef DEBUG
+OUTSUB=td
+!else
+OUTSUB=tr
+!endif
+!else
+!ifdef DEBUG
+OUTSUB=sd
+!else
+OUTSUB=sr
+!endif
+!endif
+
+!endif # SHARED
+
+!else # FLEXTBUILD
+OUTSUB=.
+!endif # FLEXTBUILD
+
diff --git a/externals/grill/flext/buildsys/bmake-sub.mak b/externals/grill/flext/buildsys/bmake-sub.mak
new file mode 100644
index 00000000..4cd3df30
--- /dev/null
+++ b/externals/grill/flext/buildsys/bmake-sub.mak
@@ -0,0 +1,28 @@
+!include $(BUILDPATH)config-$(PLATFORM)-$(RTSYS)-$(COMPILER).txt
+
+###############################
+
+# these are project specific
+
+# package info
+!include $(USRINFO)
+
+# special package settings
+!ifdef USRCONFIG
+!include $(USRCONFIG)
+!endif
+
+# package specific make stuff
+!ifdef USRMAKE
+!include $(USRMAKE)
+!endif
+
+##############################
+
+# flext-specific make stuff
+!include $(BUILDPATH)bmake-flext.inc
+
+# platform-specific make stuff
+!include $(BUILDPATH)$(PLATFORM)\$(RTSYS)\make-$(COMPILER).inc
+# general make stuff
+!include $(BUILDPATH)$(PLATFORM)\make-$(COMPILER).inc
diff --git a/externals/grill/flext/buildsys/bmake.mak b/externals/grill/flext/buildsys/bmake.mak
new file mode 100644
index 00000000..2c341029
--- /dev/null
+++ b/externals/grill/flext/buildsys/bmake.mak
@@ -0,0 +1,141 @@
+# required settings:
+#
+# PLATFORM - win/mac/lnx
+# RTSYS - pd/max
+# COMPILER - msvc/gcc/mingw/cygwin
+# BUILDPATH including trailing \
+
+# package info
+USRINFO=package.txt
+
+!include $(USRINFO)
+
+
+SYSCONFIG=$(BUILDPATH)config-$(PLATFORM)-$(RTSYS)-$(COMPILER).txt
+SYSDEFAULT=$(BUILDPATH)$(PLATFORM)\$(RTSYS)\config-$(COMPILER).def
+
+
+OPTIONS=-f $(BUILDPATH)bmake-sub.mak -N \
+ PLATFORM=$(PLATFORM) RTSYS=$(RTSYS) COMPILER=$(COMPILER) \
+ BUILDPATH=$(BUILDPATH) USRINFO=$(USRINFO)
+
+
+!ifdef BUILDDIR
+USRCONFIG=config.txt
+USRDEFAULT=$(BUILDDIR)\config-$(PLATFORM).def
+
+USRMAKE=$(BUILDDIR)\makefile-$(PLATFORM)-$(COMPILER).inc
+
+OPTIONS=$(OPTIONS) USRCONFIG=$(USRCONFIG) USRMAKE=$(USRMAKE)
+!endif
+
+
+!ifdef FLEXTBUILD
+all: flext
+!else
+all: build-sr
+
+shared: build-tr
+!endif
+
+flext: flext-release flext-debug
+
+flext-release: build-dr build-tr build-sr
+
+flext-debug: build-dd build-td build-sd
+
+install: install-dr install-tr install-sr install-dd install-td install-sd
+
+clean: clean-dr clean-tr clean-sr clean-dd clean-td clean-sd
+
+
+build-sr: config
+ $(MAKE) $(OPTIONS) _all_
+
+build-sd: config
+ $(MAKE) $(OPTIONS) DEBUG=1 _all_
+
+build-tr: config
+ $(MAKE) $(OPTIONS) THREADED=1 _all_
+
+build-td: config
+ $(MAKE) $(OPTIONS) THREADED=1 DEBUG=1 _all_
+
+build-dr: config
+ $(MAKE) $(OPTIONS) SHARED=1 _all_
+
+build-dd: config
+ $(MAKE) $(OPTIONS) SHARED=1 DEBUG=1 _all_
+
+
+install-sr:
+ $(MAKE) $(OPTIONS) _install_
+
+install-sd:
+ $(MAKE) $(OPTIONS) DEBUG=1 _install_
+
+install-tr:
+ $(MAKE) $(OPTIONS) THREADED=1 _install_
+
+install-td:
+ $(MAKE) $(OPTIONS) THREADED=1 DEBUG=1 _install_
+
+install-dr:
+ $(MAKE) $(OPTIONS) SHARED=1 _install_
+
+install-dd:
+ $(MAKE) $(OPTIONS) SHARED=1 DEBUG=1 _install_
+
+
+clean-sr:
+ $(MAKE) $(OPTIONS) _clean_
+
+clean-sd:
+ $(MAKE) $(OPTIONS) DEBUG=1 _clean_
+
+clean-tr:
+ $(MAKE) $(OPTIONS) THREADED=1 _clean_
+
+clean-td:
+ $(MAKE) $(OPTIONS) THREADED=1 DEBUG=1 _clean_
+
+clean-dr:
+ $(MAKE) $(OPTIONS) SHARED=1 _clean_
+
+clean-dd:
+ $(MAKE) $(OPTIONS) SHARED=1 DEBUG=1 _clean_
+
+
+config: $(USRMAKE) $(SYSCONFIG) $(USRCONFIG)
+
+
+.precious: $(SYSCONFIG) $(USRCONFIG)
+
+$(SYSCONFIG): $(SYSDEFAULT)
+ @copy $** $@
+ @echo -------------------------------------------------------------------------
+ @echo A default system configuration file has been created.
+ @echo Please edit $(SYSCONFIG)
+ @echo to match your platform and start again.
+ @echo -------------------------------------------------------------------------
+ @exit 1
+
+!ifdef BUILDDIR
+$(USRCONFIG): $(USRDEFAULT)
+ @copy $** $@
+ @echo -------------------------------------------------------------------------
+ @echo A default package configuration file has been created.
+ @echo Please edit $(USRCONFIG) and start again.
+ @echo -------------------------------------------------------------------------
+ @exit 1
+
+$(USRDEFAULT) $(USRMAKE):
+ @echo -------------------------------------------------------------------------
+ @echo Your combination of platform, system and compiler is not supported yet.
+ @echo Required files:
+ @echo $(USRDEFAULT)
+ @echo and
+ @echo $(USRMAKE)
+ @echo -------------------------------------------------------------------------
+ @exit 1
+!endif
diff --git a/externals/grill/flext/buildsys/build-bcc.bat b/externals/grill/flext/buildsys/build-bcc.bat
new file mode 100644
index 00000000..bf5c4bff
--- /dev/null
+++ b/externals/grill/flext/buildsys/build-bcc.bat
@@ -0,0 +1,3 @@
+@set build=%~dp0
+
+make -f %build%bmake.mak -N PLATFORM=%1 RTSYS=%2 COMPILER=bcc BUILDPATH=%build% %3 %4 %5 %6 %7 %8 %9
diff --git a/externals/grill/flext/buildsys/build-cygwin.sh b/externals/grill/flext/buildsys/build-cygwin.sh
new file mode 100644
index 00000000..fa740016
--- /dev/null
+++ b/externals/grill/flext/buildsys/build-cygwin.sh
@@ -0,0 +1,3 @@
+build=${0%/*}/
+
+make -f ${build}gnumake.mak PLATFORM=$1 RTSYS=$2 COMPILER=cygwin BUILDPATH=${build} $3 $4 $5 $6 $7 $8 $9
diff --git a/externals/grill/flext/buildsys/build-gcc.sh b/externals/grill/flext/buildsys/build-gcc.sh
new file mode 100644
index 00000000..3fffd918
--- /dev/null
+++ b/externals/grill/flext/buildsys/build-gcc.sh
@@ -0,0 +1,3 @@
+build=${0%/*}/
+
+make -f ${build}gnumake.mak PLATFORM=$1 RTSYS=$2 COMPILER=gcc BUILDPATH=${build} $3 $4 $5 $6 $7 $8 $9
diff --git a/externals/grill/flext/buildsys/build-mingw.bat b/externals/grill/flext/buildsys/build-mingw.bat
new file mode 100644
index 00000000..11a39ed3
--- /dev/null
+++ b/externals/grill/flext/buildsys/build-mingw.bat
@@ -0,0 +1,3 @@
+@set build=%~dp0
+
+mingw32-make -f %build%gnumake.mak PLATFORM=%1 RTSYS=%2 COMPILER=mingw BUILDPATH=%build% %3 %4 %5 %6 %7 %8 %9
diff --git a/externals/grill/flext/buildsys/build-msvc.bat b/externals/grill/flext/buildsys/build-msvc.bat
new file mode 100644
index 00000000..b7cbb8f1
--- /dev/null
+++ b/externals/grill/flext/buildsys/build-msvc.bat
@@ -0,0 +1,3 @@
+@set build=%~dp0
+
+nmake -f %build%nmake.mak PLATFORM=%1 RTSYS=%2 COMPILER=msvc BUILDPATH=%build% %3 %4 %5 %6 %7 %8 %9
diff --git a/externals/grill/flext/buildsys/gnumake-flext.inc b/externals/grill/flext/buildsys/gnumake-flext.inc
new file mode 100644
index 00000000..bc3a5ab5
--- /dev/null
+++ b/externals/grill/flext/buildsys/gnumake-flext.inc
@@ -0,0 +1,89 @@
+##############################################
+# flext defines
+##############################################
+
+ifdef SHARED
+# --- shared ---
+DEFS+=-DFLEXT_SHARED
+
+else
+ifdef THREADED
+# --- static multi-threaded ---
+DEFS+=-DFLEXT_THREADS
+
+else
+# --- static single-threaded ---
+
+endif
+endif
+
+
+ifdef FLEXTBUILD
+DEFS+=-DFLEXT_EXPORTS
+endif
+
+##############################################
+# name of flext library
+##############################################
+
+ifdef SHARED
+
+ifdef DEBUG
+FLEXTNAME=flext-$(RTSYS)_d
+else
+FLEXTNAME=flext-$(RTSYS)
+endif
+
+else
+
+ifdef THREADED
+ifdef DEBUG
+FLEXTNAME=flext-$(RTSYS)_td
+else
+FLEXTNAME=flext-$(RTSYS)_t
+endif
+else
+ifdef DEBUG
+FLEXTNAME=flext-$(RTSYS)_d
+else
+FLEXTNAME=flext-$(RTSYS)
+endif
+endif
+
+endif # SHARED
+
+##############################################
+# build subdirectories
+##############################################
+
+ifdef FLEXTBUILD
+
+ifdef SHARED
+
+ifdef DEBUG
+OUTSUB=dd
+else
+OUTSUB=dr
+endif
+
+else # SHARED
+
+ifdef THREADED
+ifdef DEBUG
+OUTSUB=td
+else
+OUTSUB=tr
+endif
+else
+ifdef DEBUG
+OUTSUB=sd
+else
+OUTSUB=sr
+endif
+endif
+
+endif # SHARED
+
+else # FLEXTBUILD
+OUTSUB=.
+endif # FLEXTBUILD
diff --git a/externals/grill/flext/buildsys/gnumake-sub.mak b/externals/grill/flext/buildsys/gnumake-sub.mak
new file mode 100644
index 00000000..91440532
--- /dev/null
+++ b/externals/grill/flext/buildsys/gnumake-sub.mak
@@ -0,0 +1,29 @@
+# system settings
+include $(BUILDPATH)config-$(PLATFORM)-$(RTSYS)-$(COMPILER).txt
+
+###############################
+
+# these are project specific
+
+# package info
+include $(USRINFO)
+
+# special settings
+ifdef USRCONFIG
+include $(USRCONFIG)
+endif
+
+# package specific make stuff
+ifdef USRMAKE
+include $(USRMAKE)
+endif
+
+##############################
+
+# flext-specific make stuff
+include $(BUILDPATH)gnumake-flext.inc
+
+# platform-specific make stuff
+include $(BUILDPATH)$(PLATFORM)/$(RTSYS)/make-$(COMPILER).inc
+# general make stuff
+include $(BUILDPATH)$(PLATFORM)/make-$(COMPILER).inc
diff --git a/externals/grill/flext/buildsys/gnumake.mak b/externals/grill/flext/buildsys/gnumake.mak
new file mode 100644
index 00000000..5b191702
--- /dev/null
+++ b/externals/grill/flext/buildsys/gnumake.mak
@@ -0,0 +1,150 @@
+# required settings:
+#
+# PLATFORM - win/mac/lnx
+# RTSYS - pd/max
+# COMPILER - msvc/gcc/mingw/cygwin
+# BUILDPATH including trailing /
+
+# package info
+USRINFO=package.txt
+
+include $(USRINFO)
+
+
+ifeq ($(PLATFORM),win)
+ # substitute eventual \ by /
+ UBUILDPATH=$(subst \,/,$(BUILDPATH))
+else
+ UBUILDPATH=$(BUILDPATH)
+endif
+
+
+SYSCONFIG=$(UBUILDPATH)config-$(PLATFORM)-$(RTSYS)-$(COMPILER).txt
+SYSDEFAULT=$(UBUILDPATH)$(PLATFORM)/$(RTSYS)/config-$(COMPILER).def
+
+
+OPTIONS=-f $(UBUILDPATH)gnumake-sub.mak \
+ PLATFORM=$(PLATFORM) RTSYS=$(RTSYS) COMPILER=$(COMPILER) \
+ BUILDPATH=$(UBUILDPATH) USRINFO=$(USRINFO)
+
+
+ifdef BUILDDIR
+USRCONFIG=config.txt
+USRDEFAULT=$(BUILDDIR)/config-$(PLATFORM).def
+
+USRMAKE=$(BUILDDIR)/makefile-$(PLATFORM)-$(COMPILER).inc
+
+OPTIONS+=USRCONFIG=$(USRCONFIG) USRMAKE=$(USRMAKE)
+endif
+
+
+ifdef FLEXTBUILD
+all: flext
+else
+all: build-sr
+
+shared: build-tr
+endif
+
+flext: flext-release flext-debug
+
+flext-release: build-dr build-tr build-sr
+
+flext-debug: build-dd build-td build-sd
+
+install: install-dr install-tr install-sr install-dd install-td install-sd
+
+clean: clean-dr clean-tr clean-sr clean-dd clean-td clean-sd
+
+
+build-sr: config
+ $(MAKE) $(OPTIONS) _all_
+
+build-sd: config
+ $(MAKE) $(OPTIONS) DEBUG=1 _all_
+
+build-tr: config
+ $(MAKE) $(OPTIONS) THREADED=1 _all_
+
+build-td: config
+ $(MAKE) $(OPTIONS) THREADED=1 DEBUG=1 _all_
+
+build-dr: config
+ $(MAKE) $(OPTIONS) SHARED=1 _all_
+
+build-dd: config
+ $(MAKE) $(OPTIONS) SHARED=1 DEBUG=1 _all_
+
+
+install-sr:
+ $(MAKE) $(OPTIONS) _install_
+
+install-sd:
+ $(MAKE) $(OPTIONS) DEBUG=1 _install_
+
+install-tr:
+ $(MAKE) $(OPTIONS) THREADED=1 _install_
+
+install-td:
+ $(MAKE) $(OPTIONS) THREADED=1 DEBUG=1 _install_
+
+install-dr:
+ $(MAKE) $(OPTIONS) SHARED=1 _install_
+
+install-dd:
+ $(MAKE) $(OPTIONS) SHARED=1 DEBUG=1 _install_
+
+
+clean-sr:
+ $(MAKE) $(OPTIONS) _clean_
+
+clean-sd:
+ $(MAKE) $(OPTIONS) DEBUG=1 _clean_
+
+clean-tr:
+ $(MAKE) $(OPTIONS) THREADED=1 _clean_
+
+clean-td:
+ $(MAKE) $(OPTIONS) THREADED=1 DEBUG=1 _clean_
+
+clean-dr:
+ $(MAKE) $(OPTIONS) SHARED=1 _clean_
+
+clean-dd:
+ $(MAKE) $(OPTIONS) SHARED=1 DEBUG=1 _clean_
+
+
+
+config: $(USRMAKE) $(SYSCONFIG) $(USRCONFIG)
+
+
+.precious: $(SYSCONFIG) $(USRCONFIG)
+
+$(SYSCONFIG): $(SYSDEFAULT)
+ @cp $< $@
+ @echo -------------------------------------------------------------------------
+ @echo A default system configuration file has been created.
+ @echo Please edit $(SYSCONFIG)
+ @echo to match your platform, then start again.
+ @echo -------------------------------------------------------------------------
+ @false
+
+ifdef BUILDDIR
+$(USRCONFIG): $(USRDEFAULT)
+ @cp $< $@
+ @echo -------------------------------------------------------------------------
+ @echo A default package configuration file has been created.
+ @echo Please edit $(USRCONFIG), then start again.
+ @echo -------------------------------------------------------------------------
+ @false
+
+$(USRDEFAULT) $(USRMAKE):
+ @echo -------------------------------------------------------------------------
+ @echo Your combination of platform, system and compiler is not supported yet.
+ @echo Required files:
+ @echo $(USRDEFAULT)
+ @echo and
+ @echo $(USRMAKE)
+ @echo -------------------------------------------------------------------------
+ @false
+endif
diff --git a/externals/grill/flext/buildsys/lnx/make-gcc.inc b/externals/grill/flext/buildsys/lnx/make-gcc.inc
new file mode 100644
index 00000000..5e22a236
--- /dev/null
+++ b/externals/grill/flext/buildsys/lnx/make-gcc.inc
@@ -0,0 +1,68 @@
+LDFLAGS += -shared -Wl,-x
+
+ifdef DEBUG
+CFLAGS += -g -D_DEBUG
+else
+CFLAGS += $(OFLAGS) -DNDEBUG
+LDFLAGS += -Wl,-S
+endif
+
+##############################################
+
+INCPATH += -I$(FLEXTPATH)
+LIBPATH += -L$(FLEXTPATH)
+
+ifdef SHARED
+# --- shared ---
+DEFS += -DFLEXT_SHARED
+
+else
+ifdef THREADED
+# --- static multi-threaded ---
+DEFS += -DFLEXT_THREADS
+
+else
+# --- static single-threaded ---
+
+endif
+endif
+
+##############################################
+
+TARGET=$(OUTPATH)/$(NAME).$(EXT)
+
+CSRCS=$(patsubst %.c,$(SRCDIR)/%.c,$(filter %.c,$(SRCS)))
+CPPSRCS=$(patsubst %.cpp,$(SRCDIR)/%.cpp,$(filter %.cpp,$(SRCS)))
+COBJS=$(patsubst %.c,$(OUTPATH)/%.o,$(filter %.c,$(SRCS)))
+CPPOBJS=$(patsubst %.cpp,$(OUTPATH)/%.opp,$(filter %.cpp,$(SRCS)))
+
+# default target
+all: $(OUTPATH) $(TARGET)
+
+$(CSRCS) $(CPPSRCS): $(patsubst %,$(SRCDIR)/%,$(HDRS))
+ touch $@
+
+$(OUTPATH):
+ mkdir $(OUTPATH)
+
+$(OUTPATH)/%.opp : $(SRCDIR)/%.cpp
+ $(CXX) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
+
+$(OUTPATH)/%.o : $(SRCDIR)/%.c
+ $(CC) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
+
+$(TARGET) : $(COBJS) $(CPPOBJS)
+ $(CXX) $(LDFLAGS) $(LIBPATH) -o $@ $^ $(LIBS)
+ chmod 755 $@
+
+$(INSTPATH):
+ mkdir $(INSTPATH)
+
+install:: $(INSTPATH)
+
+install:: $(TARGET)
+ install $^ $(INSTPATH)
+
+.PHONY: clean
+clean:
+ $(RM) $(COBJS) $(CPPOBJS) $(TARGET)
diff --git a/externals/grill/flext/buildsys/lnx/pd/config-gcc.def b/externals/grill/flext/buildsys/lnx/pd/config-gcc.def
new file mode 100644
index 00000000..e60e92a4
--- /dev/null
+++ b/externals/grill/flext/buildsys/lnx/pd/config-gcc.def
@@ -0,0 +1,15 @@
+# where is the PD source package?
+PDPATH=/usr/local/src/pd-0.38-0test10
+
+# where should the external be installed?
+INSTPATH=/usr/local/lib/pd/extra
+
+# where do the flext headers and libraries reside?
+FLEXTPATH=/usr/local/lib/pd/flext
+
+# where should the external be built?
+OUTPATH=pd-linux
+
+# user defined compiler flags
+# (check if they match your system!)
+OFLAGS=-O2 -march=pentium4 -msse
diff --git a/externals/grill/flext/buildsys/lnx/pd/make-gcc.inc b/externals/grill/flext/buildsys/lnx/pd/make-gcc.inc
new file mode 100644
index 00000000..3ae01ad0
--- /dev/null
+++ b/externals/grill/flext/buildsys/lnx/pd/make-gcc.inc
@@ -0,0 +1,10 @@
+DEFS += -DFLEXT_SYS=2
+
+INCPATH += -I$(PDPATH)/src
+LIBPATH += -L$(PDPATH)/bin
+
+LDFLAGS +=
+
+LIBS +=
+
+EXT=pd_linux
diff --git a/externals/grill/flext/buildsys/mac/make-gcc.inc b/externals/grill/flext/buildsys/mac/make-gcc.inc
new file mode 100644
index 00000000..39f4849a
--- /dev/null
+++ b/externals/grill/flext/buildsys/mac/make-gcc.inc
@@ -0,0 +1,68 @@
+LDFLAGS += -Wl,-x -framework ApplicationServices -framework vecLib
+
+ifdef DEBUG
+CFLAGS += -g -D_DEBUG
+else
+CFLAGS += $(OFLAGS) -DNDEBUG
+LDFLAGS += -Wl,-S
+endif
+
+##############################################
+
+INCPATH += -I$(FLEXTPATH)
+LIBPATH += -L$(FLEXTPATH)
+
+ifdef SHARED
+# --- shared ---
+DEFS += -DFLEXT_SHARED
+
+else
+ifdef THREADED
+# --- static multi-threaded ---
+DEFS += -DFLEXT_THREADS
+
+else
+# --- static single-threaded ---
+
+endif
+endif
+
+##############################################
+
+TARGET=$(OUTPATH)/$(NAME).$(EXT)
+
+CSRCS=$(patsubst %.c,$(SRCDIR)/%.c,$(filter %.c,$(SRCS)))
+CPPSRCS=$(patsubst %.cpp,$(SRCDIR)/%.cpp,$(filter %.cpp,$(SRCS)))
+COBJS=$(patsubst %.c,$(OUTPATH)/%.o,$(filter %.c,$(SRCS)))
+CPPOBJS=$(patsubst %.cpp,$(OUTPATH)/%.opp,$(filter %.cpp,$(SRCS)))
+
+# default target
+all: $(OUTPATH) $(TARGET)
+
+$(CSRCS) $(CPPSRCS): $(patsubst %,$(SRCDIR)/%,$(HDRS))
+ touch $@
+
+$(OUTPATH):
+ mkdir $(OUTPATH)
+
+$(OUTPATH)/%.opp : $(SRCDIR)/%.cpp
+ $(CXX) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
+
+$(OUTPATH)/%.o : $(SRCDIR)/%.c
+ $(CC) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
+
+$(TARGET) : $(COBJS) $(CPPOBJS)
+ $(CXX) $(LDFLAGS) $(LIBPATH) -o $@ $^ $(LIBS)
+ chmod 755 $@
+
+$(INSTPATH):
+ mkdir $(INSTPATH)
+
+install:: $(INSTPATH)
+
+install:: $(TARGET)
+ install $^ $(INSTPATH)
+
+.PHONY: clean
+clean:
+ $(RM) $(COBJS) $(CPPOBJS) $(TARGET)
diff --git a/externals/grill/flext/buildsys/mac/pd/config-gcc.def b/externals/grill/flext/buildsys/mac/pd/config-gcc.def
new file mode 100644
index 00000000..1f8ab2cd
--- /dev/null
+++ b/externals/grill/flext/buildsys/mac/pd/config-gcc.def
@@ -0,0 +1,18 @@
+# where is the PD installation?
+PDPATH=/usr/local/lib/pd
+
+# where is the PD executable?
+PDBIN=/usr/local/bin/pd
+
+# where should the external be installed?
+INSTPATH=$(PDPATH)/extra
+
+# where do the flext headers and libraries reside?
+FLEXTPATH=$(PDPATH)/flext
+
+# where should the external be built?
+OUTPATH=pd-darwin
+
+# user defined compiler flags
+# (check if they match your system!)
+OFLAGS=-O2 -mcpu=G4 -malign-natural -maltivec -faltivec
diff --git a/externals/grill/flext/buildsys/mac/pd/make-gcc.inc b/externals/grill/flext/buildsys/mac/pd/make-gcc.inc
new file mode 100644
index 00000000..05c2cd08
--- /dev/null
+++ b/externals/grill/flext/buildsys/mac/pd/make-gcc.inc
@@ -0,0 +1,10 @@
+DEFS += -DFLEXT_SYS=2
+
+INCPATH += -I$(PDPATH)/src
+LIBPATH += -L$(PDPATH)/bin
+
+LDFLAGS += -bundle -bundle_loader $(PDBIN)
+
+LIBS +=
+
+EXT=pd_darwin
diff --git a/externals/grill/flext/buildsys/nmake-flext.inc b/externals/grill/flext/buildsys/nmake-flext.inc
new file mode 100644
index 00000000..7b21e7d0
--- /dev/null
+++ b/externals/grill/flext/buildsys/nmake-flext.inc
@@ -0,0 +1,88 @@
+##############################################
+# flext defines
+##############################################
+
+!ifdef SHARED
+# --- shared ---
+DEFS=$(DEFS) /DFLEXT_SHARED
+
+!elseifdef THREADED
+# --- static multi-threaded ---
+DEFS=$(DEFS) /DFLEXT_THREADS
+
+!else
+# --- static single-threaded ---
+
+!endif
+
+
+!ifdef FLEXTBUILD
+DEFS=$(DEFS) /DFLEXT_EXPORTS
+!endif
+
+##############################################
+# name of flext library
+##############################################
+
+!ifdef SHARED
+
+!ifdef DEBUG
+FLEXTNAME=flext-$(RTSYS)_d
+!else
+FLEXTNAME=flext-$(RTSYS)
+!endif
+
+!else
+
+!ifdef THREADED
+!ifdef DEBUG
+FLEXTNAME=flext-$(RTSYS)_td
+!else
+FLEXTNAME=flext-$(RTSYS)_t
+!endif
+!else
+!ifdef DEBUG
+FLEXTNAME=flext-$(RTSYS)_d
+!else
+FLEXTNAME=flext-$(RTSYS)
+!endif
+!endif
+
+!endif # SHARED
+
+##############################################
+# build subdirectories
+##############################################
+
+!ifdef FLEXTBUILD
+
+!ifdef SHARED
+
+!ifdef DEBUG
+OUTSUB=dd
+!else
+OUTSUB=dr
+!endif
+
+!else # SHARED
+
+!ifdef THREADED
+!ifdef DEBUG
+OUTSUB=td
+!else
+OUTSUB=tr
+!endif
+!else
+!ifdef DEBUG
+OUTSUB=sd
+!else
+OUTSUB=sr
+!endif
+!endif
+
+!endif # SHARED
+
+!else # FLEXTBUILD
+OUTSUB=.
+!endif # FLEXTBUILD
+
diff --git a/externals/grill/flext/buildsys/nmake-sub.mak b/externals/grill/flext/buildsys/nmake-sub.mak
new file mode 100644
index 00000000..9e640fff
--- /dev/null
+++ b/externals/grill/flext/buildsys/nmake-sub.mak
@@ -0,0 +1,27 @@
+# general settings
+!include $(BUILDPATH)config-$(PLATFORM)-$(RTSYS)-$(COMPILER).txt
+
+##############################
+
+# package info
+!include $(USRINFO)
+
+# special package settings
+!ifdef USRCONFIG
+!include $(USRCONFIG)
+!endif
+
+# package specific make stuff
+!ifdef USRMAKE
+!include $(USRMAKE)
+!endif
+
+##############################
+
+# flext-specific make stuff
+!include $(BUILDPATH)nmake-flext.inc
+
+# platform-specific make stuff
+!include $(BUILDPATH)$(PLATFORM)\$(RTSYS)\make-$(COMPILER).inc
+# general make stuff
+!include $(BUILDPATH)$(PLATFORM)\make-$(COMPILER).inc
diff --git a/externals/grill/flext/buildsys/nmake.mak b/externals/grill/flext/buildsys/nmake.mak
new file mode 100644
index 00000000..40a8d8c4
--- /dev/null
+++ b/externals/grill/flext/buildsys/nmake.mak
@@ -0,0 +1,142 @@
+# required settings:
+#
+# PLATFORM - win/mac/lnx
+# RTSYS - pd/max
+# COMPILER - msvc/gcc/mingw/cygwin
+# BUILDPATH including trailing \
+
+# package info
+USRINFO=package.txt
+
+!include $(USRINFO)
+
+
+SYSCONFIG=$(BUILDPATH)config-$(PLATFORM)-$(RTSYS)-$(COMPILER).txt
+SYSDEFAULT=$(BUILDPATH)$(PLATFORM)\$(RTSYS)\config-$(COMPILER).def
+
+
+OPTIONS=-f $(BUILDPATH)nmake-sub.mak \
+ PLATFORM=$(PLATFORM) RTSYS=$(RTSYS) COMPILER=$(COMPILER) \
+ BUILDPATH=$(BUILDPATH) USRINFO=$(USRINFO)
+
+
+!ifdef BUILDDIR
+USRCONFIG=config.txt
+USRDEFAULT=$(BUILDDIR)\config-$(PLATFORM).def
+
+USRMAKE=$(BUILDDIR)\makefile-$(PLATFORM)-$(COMPILER).inc
+
+OPTIONS=$(OPTIONS) USRCONFIG=$(USRCONFIG) USRMAKE=$(USRMAKE)
+!endif
+
+
+!ifdef FLEXTBUILD
+all: flext
+!else
+all: build-sr
+
+shared: build-tr
+!endif
+
+flext: flext-release flext-debug
+
+flext-release: build-dr build-tr build-sr
+
+flext-debug: build-dd build-td build-sd
+
+install: install-dr install-tr install-sr install-dd install-td install-sd
+
+clean: clean-dr clean-tr clean-sr clean-dd clean-td clean-sd
+
+
+build-sr: config
+ $(MAKE) $(OPTIONS) _all_
+
+build-sd: config
+ $(MAKE) $(OPTIONS) DEBUG=1 _all_
+
+build-tr: config
+ $(MAKE) $(OPTIONS) THREADED=1 _all_
+
+build-td: config
+ $(MAKE) $(OPTIONS) THREADED=1 DEBUG=1 _all_
+
+build-dr: config
+ $(MAKE) $(OPTIONS) SHARED=1 _all_
+
+build-dd: config
+ $(MAKE) $(OPTIONS) SHARED=1 DEBUG=1 _all_
+
+
+install-sr:
+ $(MAKE) $(OPTIONS) _install_
+
+install-sd:
+ $(MAKE) $(OPTIONS) DEBUG=1 _install_
+
+install-tr:
+ $(MAKE) $(OPTIONS) THREADED=1 _install_
+
+install-td:
+ $(MAKE) $(OPTIONS) THREADED=1 DEBUG=1 _install_
+
+install-dr:
+ $(MAKE) $(OPTIONS) SHARED=1 _install_
+
+install-dd:
+ $(MAKE) $(OPTIONS) SHARED=1 DEBUG=1 _install_
+
+
+clean-sr:
+ $(MAKE) $(OPTIONS) _clean_
+
+clean-sd:
+ $(MAKE) $(OPTIONS) DEBUG=1 _clean_
+
+clean-tr:
+ $(MAKE) $(OPTIONS) THREADED=1 _clean_
+
+clean-td:
+ $(MAKE) $(OPTIONS) THREADED=1 DEBUG=1 _clean_
+
+clean-dr:
+ $(MAKE) $(OPTIONS) SHARED=1 _clean_
+
+clean-dd:
+ $(MAKE) $(OPTIONS) SHARED=1 DEBUG=1 _clean_
+
+
+
+config: $(USRMAKE) $(SYSCONFIG) $(USRCONFIG)
+
+
+.precious: $(SYSCONFIG) $(USRCONFIG)
+
+$(SYSCONFIG): $(SYSDEFAULT)
+ @copy $** $@
+ @echo -------------------------------------------------------------------------
+ @echo A default system configuration file has been created.
+ @echo Please edit $(SYSCONFIG)
+ @echo to match your platform and start again.
+ @echo -------------------------------------------------------------------------
+ @exit 1
+
+!ifdef BUILDDIR
+$(USRCONFIG): $(USRDEFAULT)
+ @copy $** $@
+ @echo -------------------------------------------------------------------------
+ @echo A default package configuration file has been created.
+ @echo Please edit $(USRCONFIG) and start again.
+ @echo -------------------------------------------------------------------------
+ @exit 1
+
+$(USRDEFAULT) $(USRMAKE):
+ @echo -------------------------------------------------------------------------
+ @echo Your combination of platform, system and compiler is not supported yet.
+ @echo Required files:
+ @echo $(USRDEFAULT)
+ @echo and
+ @echo $(USRMAKE)
+ @echo -------------------------------------------------------------------------
+ @exit 1
+!endif
diff --git a/externals/grill/flext/buildsys/win/make-bcc.inc b/externals/grill/flext/buildsys/win/make-bcc.inc
new file mode 100644
index 00000000..dbe6b08c
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/make-bcc.inc
@@ -0,0 +1,128 @@
+!ifndef FLEXTBUILD
+INCPATH=$(INCPATH) -I$(FLEXTPATH)
+LIBPATH=$(LIBPATH) -L$(FLEXTPATH)
+LIBS=$(LIBS) $(FLEXTNAME).lib
+!endif
+
+!ifdef BCCPATH
+INCPATH=$(INCPATH) -I$(BCCPATH)\include
+LIBPATH=$(LIBPATH) -L$(BCCPATH)\lib
+!endif
+
+LIBS=$(LIBS) cw32.lib import32.lib C0D32.OBJ
+CFLAGS=$(CFLAGS) -tWD -tWM -w-8004 -w-8027 -w-8057
+LDFLAGS=$(LDFLAGS) /C /Tpd
+
+##############################################
+
+# use multithreaded static libraries
+!ifdef DEBUG
+CFLAGS=$(CFLAGS) -v -D_DEBUG
+LDFLAGS=$(LDFLAGS) /v
+!else
+CFLAGS=$(CFLAGS) $(OFLAGS) -DNDEBUG
+!endif
+
+##############################################
+
+!ifdef FLEXTBUILD
+OUTNAME=$(FLEXTNAME)
+
+!ifdef SHARED
+EXT=dll
+!else
+EXT=lib
+BUILDLIB=1
+!endif
+
+!else
+OUTNAME=$(NAME)
+!endif
+
+##############################################
+
+TARGETPATH=$(OUTPATH)\$(OUTSUB)
+TARGET=$(TARGETPATH)\$(OUTNAME).$(EXT)
+
+##############################################
+
+!ifdef PDPATH
+
+$(TARGETPATH)\pd.lib : $(PDPATH)\bin\pd.dll
+ implib -a $< $**
+
+$(TARGETPATH)\pthreadVC.lib : $(PDPATH)\bin\pthreadVC.dll
+ implib -a $< $**
+
+PDTARGETS=$(TARGETPATH)\pd.lib $(TARGETPATH)\pthreadVC.lib
+
+!endif
+
+##############################################
+
+# default target
+_all_: $(TARGET)
+
+# convert both *.c and *.cpp
+OBJSTMP= $(SRCS:.c=.obj)
+OBJS= $(OBJSTMP:.objpp=.obj)
+
+$(TARGETPATH):
+ if not exist $(OUTPATH) mkdir $(OUTPATH) > nul
+ if not exist $@ mkdir $@ > nul
+
+!ifndef FLEXTBUILD
+SETUPFUNCTION=$(NAME)_setup
+
+$(TARGETPATH)\$(NAME).def:
+ @echo EXPORTS $(SETUPFUNCTION) = _$(SETUPFUNCTION) > $<
+# this next line fixes a strange problem with implib - lacking underscore?!
+ @echo IMPORTS _rtext_retext=PD.rtext_retext >> $<
+
+$(TARGET) :: $(TARGETPATH)\$(NAME).def
+!endif
+
+{$(SRCDIR)}.cpp{}.obj:
+ bcc32 -c $(CFLAGS) $(DEFS) $(INCPATH) -n$(TARGETPATH) $<
+
+{$(SRCDIR)}.c{}.obj:
+ bcc32 -c $(CFLAGS) $(DEFS) $(INCPATH) -n$(TARGETPATH) $<
+
+$(TARGET) :: $(TARGETPATH) $(PDTARGETS)
+
+$(TARGET) :: $(OBJS)
+ cd $(TARGETPATH)
+!ifdef BUILDLIB
+ -del $(<F)
+ tlib "$(<F)" +$(OBJS: = +)
+ cd ..
+!else
+ ilink32 $(LDFLAGS) $(LIBPATH) -L. $(OBJS) ,$(<F),,$(LIBS),$(NAME).def
+!endif
+ cd ..
+
+##############################################
+
+_clean_:
+ -del /q $(TARGET) > nul
+ -cd $(TARGETPATH)
+ -del /q $(OBJS) > nul
+
+##############################################
+
+$(INSTPATH):
+ if not exist $@ mkdir $@ > nul
+
+$(FLEXTPATH):
+ if not exist $@ mkdir $@ > nul
+
+_install_ :: $(INSTPATH) $(FLEXTPATH)
+
+_install_ ::
+!ifdef FLEXTBUILD
+ -copy $(TARGET) $(FLEXTPATH) > nul
+ @cd $(SRCDIR)
+ -for %%i in ($(HDRS)) do @copy %%i $(FLEXTPATH) > nul
+!else
+ copy $(TARGET) $(INSTPATH) > nul
+!endif
diff --git a/externals/grill/flext/buildsys/win/make-cygwin.inc b/externals/grill/flext/buildsys/win/make-cygwin.inc
new file mode 100644
index 00000000..beaeef83
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/make-cygwin.inc
@@ -0,0 +1,92 @@
+ifndef FLEXTBUILD
+INCPATH += -I$(FLEXTPATH)
+LIBPATH += -L$(FLEXTPATH)
+LIBS+=$(FLEXTPATH)/$(FLEXTNAME).a
+endif
+
+LDFLAGS += -shared -Wl,-x
+
+##############################################
+
+ifdef DEBUG
+CFLAGS += -g -D_DEBUG
+else
+CFLAGS += $(OFLAGS) -DNDEBUG
+LDFLAGS += -Wl,-S
+endif
+
+##############################################
+
+ifdef FLEXTBUILD
+OUTNAME=$(FLEXTNAME)
+
+ifdef SHARED
+EXT=dll
+else
+EXT=a
+BUILDLIB=1
+endif
+
+else
+OUTNAME=$(NAME)
+endif
+
+##############################################
+
+TARGETPATH=$(OUTPATH)/$(OUTSUB)
+TARGET=$(TARGETPATH)/$(OUTNAME).$(EXT)
+
+##############################################
+
+CSRCS=$(patsubst %.c,$(SRCDIR)/%.c,$(filter %.c,$(SRCS)))
+CPPSRCS=$(patsubst %.cpp,$(SRCDIR)/%.cpp,$(filter %.cpp,$(SRCS)))
+COBJS=$(patsubst %.c,$(TARGETPATH)/%.o,$(filter %.c,$(SRCS)))
+CPPOBJS=$(patsubst %.cpp,$(TARGETPATH)/%.opp,$(filter %.cpp,$(SRCS)))
+
+# default target
+_all_: $(TARGET)
+
+$(CSRCS) $(CPPSRCS): $(patsubst %,$(SRCDIR)/%,$(HDRS))
+ touch $@
+
+$(TARGETPATH):
+ -mkdir $(OUTPATH)
+ -mkdir $@
+
+$(TARGETPATH)/%.opp : $(SRCDIR)/%.cpp
+ $(CXX) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
+
+$(TARGETPATH)/%.o : $(SRCDIR)/%.c
+ $(CC) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
+
+$(TARGET) :: $(TARGETPATH)
+
+$(TARGET) :: $(COBJS) $(CPPOBJS)
+ifdef BUILDLIB
+ $(AR) rc $@ $(COBJS) $(CPPOBJS)
+else
+ $(CXX) $(LDFLAGS) $(LIBPATH) -o $@ $(COBJS) $(CPPOBJS) $(LIBS)
+ chmod 755 $@
+endif
+
+##############################################
+
+_clean_:
+ rm $(COBJS) $(CPPOBJS) $(TARGET)
+
+##############################################
+
+$(INSTPATH):
+ -mkdir $@
+
+$(FLEXTPATH):
+ -mkdir $@
+
+_install_:: $(INSTPATH) $(FLEXTPATH)
+
+_install_:: $(TARGET)
+ifdef FLEXTBUILD
+ cp $(TARGET) $(patsubst %,$(SRCDIR)/%,$(HDRS)) $(FLEXTPATH)
+else
+ install $(TARGET) $(INSTPATH)
+endif
diff --git a/externals/grill/flext/buildsys/win/make-mingw.inc b/externals/grill/flext/buildsys/win/make-mingw.inc
new file mode 100644
index 00000000..693f2947
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/make-mingw.inc
@@ -0,0 +1,93 @@
+ifndef FLEXTBUILD
+INCPATH += -I$(FLEXTPATH)
+LIBPATH += -L$(FLEXTPATH)
+LIBS+=$(FLEXTPATH)/$(FLEXTNAME).lib
+endif
+
+LDFLAGS += -shared -Wl,-x
+
+##############################################
+
+ifdef DEBUG
+CFLAGS += -g -D_DEBUG
+else
+CFLAGS += $(OFLAGS) -DNDEBUG
+LDFLAGS += -Wl,-S
+endif
+
+##############################################
+
+ifdef FLEXTBUILD
+OUTNAME=$(FLEXTNAME)
+
+ifdef SHARED
+EXT=dll
+else
+EXT=lib
+BUILDLIB=1
+endif
+
+else
+OUTNAME=$(NAME)
+endif
+
+##############################################
+
+TARGETPATH=$(OUTPATH)/$(OUTSUB)
+TARGET=$(TARGETPATH)/$(OUTNAME).$(EXT)
+
+##############################################
+
+CSRCS=$(patsubst %.c,$(SRCDIR)/%.c,$(filter %.c,$(SRCS)))
+CPPSRCS=$(patsubst %.cpp,$(SRCDIR)/%.cpp,$(filter %.cpp,$(SRCS)))
+COBJS=$(patsubst %.c,$(TARGETPATH)/%.o,$(filter %.c,$(SRCS)))
+CPPOBJS=$(patsubst %.cpp,$(TARGETPATH)/%.opp,$(filter %.cpp,$(SRCS)))
+
+
+# default target
+_all_: $(TARGET)
+
+#$(CSRCS) $(CPPSRCS): $(patsubst %,$(SRCDIR)/%,$(HDRS))
+# touch $@
+
+$(TARGETPATH):
+ -mkdir $(subst /,\,$(OUTPATH))
+ -mkdir $(subst /,\,$@)
+
+$(TARGETPATH)/%.opp : $(SRCDIR)/%.cpp
+ $(CXX) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
+
+$(TARGETPATH)/%.o : $(SRCDIR)/%.c
+ $(CC) -c $(CFLAGS) $(DEFS) $(INCPATH) $< -o $@
+
+$(TARGET) :: $(TARGETPATH)
+
+$(TARGET) :: $(COBJS) $(CPPOBJS)
+ifdef BUILDLIB
+ $(AR) rc $@ $(COBJS) $(CPPOBJS)
+else
+ $(CXX) $(LDFLAGS) $(LIBPATH) -o $@ $(COBJS) $(CPPOBJS) $(LIBS)
+endif
+
+##############################################
+
+_clean_:
+ -del $(subst /,\,$(COBJS) $(CPPOBJS) $(TARGET))
+
+##############################################
+
+$(FLEXTPATH):
+ -mkdir $(subst /,\,$@)
+
+$(INSTPATH):
+ -mkdir $(subst /,\,$@)
+
+_install_:: $(INSTPATH) $(FLEXTPATH)
+
+_install_:: $(TARGET)
+ifdef FLEXTBUILD
+ copy $(subst /,\,$(TARGET) $(FLEXTPATH))
+ -for %%i in ($(subst /,\,$(patsubst %,$(SRCDIR)/%,$(HDRS)))) do @copy %%i $(subst /,\,$(FLEXTPATH)) > nul
+else
+ copy $(subst /,\,$(TARGET) $(INSTPATH))
+endif
diff --git a/externals/grill/flext/buildsys/win/make-msvc.inc b/externals/grill/flext/buildsys/win/make-msvc.inc
new file mode 100644
index 00000000..eb9e87bf
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/make-msvc.inc
@@ -0,0 +1,103 @@
+!ifndef FLEXTBUILD
+INCPATH=$(INCPATH) /I$(FLEXTPATH)
+LIBPATH=$(LIBPATH) /LIBPATH:$(FLEXTPATH)
+LIBS=$(LIBS) $(FLEXTNAME).lib
+!endif
+
+!ifdef MSVCPATH
+INCPATH=$(INCPATH) /I$(MSVCPATH)\include
+LIBPATH=$(LIBPATH) /LIBPATH:$(MSVCPATH)\lib
+!endif
+
+# for VC7 - enable exception handling
+CFLAGS=$(CFLAGS) /EHsc
+
+##############################################
+
+!ifdef DEBUG
+CFLAGS=$(CFLAGS) /D_DEBUG /DMTd
+LDFLAGS=$(LDFLAGS) /DEBUG
+!else
+CFLAGS=$(CFLAGS) $(OFLAGS) /DNDEBUG /DMT
+LDFLAGS=$(LDFLAGS) /INCREMENTAL:NO
+!endif
+
+##############################################
+
+!ifdef FLEXTBUILD
+OUTNAME=$(FLEXTNAME)
+
+!ifdef SHARED
+EXT=dll
+!else
+EXT=lib
+BUILDLIB=1
+!endif
+
+!else
+OUTNAME=$(NAME)
+!endif
+
+##############################################
+
+TARGETPATH=$(OUTPATH)\$(OUTSUB)
+TARGET=$(TARGETPATH)\$(OUTNAME).$(EXT)
+
+##############################################
+
+# default target
+_all_: $(TARGET)
+
+# convert both *.c and *.cpp
+OBJSTMP= $(SRCS:.c=.obj)
+OBJS= $(OBJSTMP:.objpp=.obj)
+
+$(TARGETPATH):
+ if not exist $(OUTPATH) mkdir $(OUTPATH) > nul
+ if not exist $@ mkdir $@ > nul
+
+{$(SRCDIR)}.cpp{}.obj:
+ cl /c /LD $(CFLAGS) $(DEFS) $(INCPATH) $** /Fo$(TARGETPATH)\$@
+
+{$(SRCDIR)}.c{}.obj:
+ cl /c /LD $(CFLAGS) $(DEFS) $(INCPATH) $** /Fo$(TARGETPATH)\$@
+
+$(TARGET):: $(TARGETPATH)
+
+$(TARGET):: $(OBJS)
+ @cd $(TARGETPATH)
+!ifdef BUILDLIB
+ lib /OUT:$(@F) $(OBJS)
+ cd ..
+!else
+ echo $**
+ link /DLL $(LDFLAGS) $(LIBPATH) $(OBJS) $(LIBS) /out:$(@F)
+!endif
+ cd ..
+
+##############################################
+
+# remove build
+_clean_:
+ -del /q $(TARGET) > nul
+ -cd $(TARGETPATH)
+ -del /q $(OBJS) > nul
+
+##############################################
+
+$(INSTPATH):
+ if not exist $@ mkdir $@ > nul
+
+$(FLEXTPATH):
+ if not exist $@ mkdir $@ > nul
+
+_install_:: $(INSTPATH) $(FLEXTPATH)
+
+_install_::
+!ifdef FLEXTBUILD
+ -copy $(TARGET) $(FLEXTPATH) > nul
+ @cd $(SRCDIR)
+ -for %%i in ($(HDRS)) do @copy %%i $(FLEXTPATH) > nul
+!else
+ copy $(TARGET) $(INSTPATH) > nul
+!endif
diff --git a/externals/grill/flext/buildsys/win/max/config-mingw.def b/externals/grill/flext/buildsys/win/max/config-mingw.def
new file mode 100644
index 00000000..5bd543df
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/max/config-mingw.def
@@ -0,0 +1,17 @@
+# where are the Max/MSP SDK header files?
+# you should have the latest version!
+MAXSDKPATH="c:/data/prog/audio/maxmspsdk_win/4.5 headers/c74support"
+
+# where should the external be installed?
+INSTPATH="%CommonProgramFiles%/Cycling '74/externals/flext"
+
+# where do the flext headers and libraries reside?
+FLEXTPATH="%CommonProgramFiles%/Cycling '74/flext"
+
+# where should the external be built?
+# (path for temporary files)
+OUTPATH=max-mingw
+
+# some user-definable flags
+# (check if they match your system!)
+OFLAGS=-O2 -march=pentium4 -msse
diff --git a/externals/grill/flext/buildsys/win/max/config-msvc.def b/externals/grill/flext/buildsys/win/max/config-msvc.def
new file mode 100644
index 00000000..ae313e14
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/max/config-msvc.def
@@ -0,0 +1,17 @@
+# where are the Max/MSP SDK header files?
+# you should have the latest version!
+MAXSDKPATH="c:\data\prog\audio\maxmspsdk_win\4.5 headers\c74support"
+
+# where should the external be installed?
+INSTPATH="%CommonProgramFiles%\Cycling '74\externals\flext"
+
+# where do the flext headers and libraries reside?
+FLEXTPATH="%CommonProgramFiles%\Cycling '74\flext"
+
+# where should the external be built?
+# (path for temporary files)
+OUTPATH=max-msvc
+
+# some user-definable flags
+# (check if they match your system!)
+OFLAGS=/G6 /Ox /arch:SSE
diff --git a/externals/grill/flext/buildsys/win/max/make-mingw.inc b/externals/grill/flext/buildsys/win/max/make-mingw.inc
new file mode 100644
index 00000000..baa5c9d7
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/max/make-mingw.inc
@@ -0,0 +1,10 @@
+DEFS += -DFLEXT_SYS=1
+CFLAGS += -fpack-struct=2
+
+INCPATH += -I$(MAXSDKPATH)/max-includes -I$(MAXSDKPATH)/msp-includes
+LIBPATH += -L$(MAXSDKPATH)/max-includes -L$(MAXSDKPATH)/msp-includes
+
+# these are both in PDPATH
+LIBS += -lmaxapi -lmaxaudio
+
+EXT=mxe
diff --git a/externals/grill/flext/buildsys/win/max/make-msvc.inc b/externals/grill/flext/buildsys/win/max/make-msvc.inc
new file mode 100644
index 00000000..e3bd547e
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/max/make-msvc.inc
@@ -0,0 +1,10 @@
+DEFS=$(DEFS) /DFLEXT_SYS=1
+CFLAGS=$(CFLAGS) /Zp2
+
+INCPATH=$(INCPATH) /I$(MAXSDKPATH)\max-includes /I$(MAXSDKPATH)\msp-includes
+LIBPATH=$(LIBPATH) /LIBPATH:$(MAXSDKPATH)\max-includes /LIBPATH:$(MAXSDKPATH)\msp-includes
+
+# these are both in MAXSDKPATH
+LIBS=$(LIBS) maxapi.lib maxaudio.lib
+
+EXT=mxe
diff --git a/externals/grill/flext/buildsys/win/pd/config-bcc.def b/externals/grill/flext/buildsys/win/pd/config-bcc.def
new file mode 100644
index 00000000..85f78a22
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/pd/config-bcc.def
@@ -0,0 +1,19 @@
+# where is PD?
+PDPATH=c:\programme\audio\pd
+
+# where should the external be installed?
+INSTPATH=$(PDPATH)\extra
+
+# where do the flext headers and libraries reside?
+FLEXTPATH=$(PDPATH)\flext
+
+# where is BorlandC++?
+BCCPATH=C:\Programme\prog\bcc55
+
+# where should the external be built?
+OUTPATH=pd-bcc
+
+# user defined compiler flags
+# (check if they match your system!)
+OFLAGS=-6 -O2 -OS -ff -d
+
diff --git a/externals/grill/flext/buildsys/win/pd/config-cygwin.def b/externals/grill/flext/buildsys/win/pd/config-cygwin.def
new file mode 100644
index 00000000..0a63ea3f
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/pd/config-cygwin.def
@@ -0,0 +1,15 @@
+# where is PD?
+PDPATH=/cygdrive/c/programme/audio/pd
+
+# where should the external be installed?
+INSTPATH=$(PDPATH)/extra
+
+# where do the flext headers and libraries reside?
+FLEXTPATH=$(PDPATH)/flext
+
+# where should the external be built?
+OUTPATH=pd-cygwin
+
+# user defined compiler flags
+# (check if they match your system!)
+OFLAGS=-O2 -march=pentium4 -msse
diff --git a/externals/grill/flext/buildsys/win/pd/config-mingw.def b/externals/grill/flext/buildsys/win/pd/config-mingw.def
new file mode 100644
index 00000000..2082f34b
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/pd/config-mingw.def
@@ -0,0 +1,15 @@
+# where is PD?
+PDPATH=c:/programme/audio/pd
+
+# where should the external be installed?
+INSTPATH=$(PDPATH)/extra
+
+# where do the flext headers and libraries reside?
+FLEXTPATH=$(PDPATH)/flext
+
+# where should the external be built?
+OUTPATH=pd-mingw
+
+# user defined compiler flags
+# (check if they match your system!)
+OFLAGS=-O2 -march=pentium4 -msse
diff --git a/externals/grill/flext/buildsys/win/pd/config-msvc.def b/externals/grill/flext/buildsys/win/pd/config-msvc.def
new file mode 100644
index 00000000..e50837a6
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/pd/config-msvc.def
@@ -0,0 +1,19 @@
+# where is PD?
+PDPATH=c:\programme\audio\pd
+
+# where should the external be installed?
+INSTPATH=$(PDPATH)\extra
+
+# where do the flext headers and libraries reside?
+FLEXTPATH=$(PDPATH)\flext
+
+# where is MS VC++?
+# (not necessary if the build is run with the compiler environment)
+# MSVCPATH=C:\Programme\Microsoft Visual Studio .NET 2003\Vc7
+
+# where should the external be built?
+OUTPATH=pd-msvc
+
+# user defined compiler flags
+# (check if they match your system!)
+OFLAGS=/G6 /Ox /arch:SSE
diff --git a/externals/grill/flext/buildsys/win/pd/make-bcc.inc b/externals/grill/flext/buildsys/win/pd/make-bcc.inc
new file mode 100644
index 00000000..c4a9892c
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/pd/make-bcc.inc
@@ -0,0 +1,8 @@
+DEFS=$(DEFS) /DFLEXT_SYS=2
+
+INCPATH=$(INCPATH) -I$(PDPATH)\src
+
+# these are both in FLEXTPATH
+LIBS=$(LIBS) pd.lib pthreadVC.lib
+
+EXT=dll
diff --git a/externals/grill/flext/buildsys/win/pd/make-cygwin.inc b/externals/grill/flext/buildsys/win/pd/make-cygwin.inc
new file mode 100644
index 00000000..d1641769
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/pd/make-cygwin.inc
@@ -0,0 +1,11 @@
+DEFS += -DFLEXT_SYS=2
+
+INCPATH += -I$(PDPATH)/src
+
+# trick PD in a way that only the cygwin pthread headers are used
+CFLAGS += -include /usr/include/pthread.h -DPTHREAD_H
+
+LIBS += $(PDPATH)/bin/pd.dll
+#LIBS += $(PDPATH)/bin/pthreadVC.dll
+
+EXT=dll
diff --git a/externals/grill/flext/buildsys/win/pd/make-mingw.inc b/externals/grill/flext/buildsys/win/pd/make-mingw.inc
new file mode 100644
index 00000000..836ef3b6
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/pd/make-mingw.inc
@@ -0,0 +1,9 @@
+DEFS += -DFLEXT_SYS=2
+
+INCPATH += -I$(PDPATH)/src
+LIBPATH += -L$(PDPATH)/bin
+
+# these are both in PDPATH
+LIBS += -lpd -lpthreadVC
+
+EXT=dll
diff --git a/externals/grill/flext/buildsys/win/pd/make-msvc.inc b/externals/grill/flext/buildsys/win/pd/make-msvc.inc
new file mode 100644
index 00000000..41a7cd30
--- /dev/null
+++ b/externals/grill/flext/buildsys/win/pd/make-msvc.inc
@@ -0,0 +1,9 @@
+DEFS=$(DEFS) /DFLEXT_SYS=2
+
+INCPATH=$(INCPATH) /I$(PDPATH)\src
+LIBPATH=$(LIBPATH) /LIBPATH:$(PDPATH)\bin
+
+# these are both in PDPATH
+LIBS=$(LIBS) pd.lib pthreadVC.lib
+
+EXT=dll