Commit d01fe099 authored by thomas's avatar thomas
Browse files

updated build system for OSX

git-svn-id: https://svn.grrrr.org/ext/trunk@935 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent f356049f
#!/bin/sh
. config-max-darwin.txt
make -f makefile.max-darwin &&
{
if [ $INSTDIR != "" ]; then
echo Now install as root
sudo make -f makefile.max-darwin install
fi
}
@echo --- Building flext with MS Visual C++ ---
nmake -f makefile.max-msvc clean
nmake -f makefile.max-msvc
@echo --- Building flext with BorlandC++ ---
make -f makefile.pd-bcc %1 %2 %3 %4 %5 %6 %7 %8 %9
#!/bin/sh
. config-pd-cygwin.txt
make -f makefile.pd-cygwin &&
{
if [ $INSTDIR != "" ]; then
make -f makefile.pd-cygwin install
fi
}
#!/bin/sh
. config-pd-darwin.txt
make -f makefile.pd-darwin &&
{
if [ $INSTDIR != "" ]; then
echo Now install as root
sudo make -f makefile.pd-darwin install
fi
}
#!/bin/sh
. config-pd-linux.txt
make -f makefile.pd-linux &&
{
echo Will now install flext to ${INSTDIR}
if [ ${INSTDIR} != "" ]; then
echo Now install as root
su -c "make -f makefile.pd-linux install"
fi
}
mingw32-make -f makefile.pd-mingw
mingw32-make -f makefile.pd-mingw install
@echo --- Building flext with MS Visual C++ ---
nmake -f makefile.pd-msvc clean
nmake -f makefile.pd-msvc
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net)
#
# your c++ compiler (define only if it's different than g++)
# CXX=g++-3.3
# where is the Max SDK? (version 4.5 upwards!!)
MAXSDKPATH="/Volumes/Daten/Prog/MaxMSP-SDK/4.5 headers/c74support"
# where is the SndObj include directory?
# (leave blank or comment out to disable SndObj support)
# SNDOBJ=/usr/src/sndobj/include
# where is the STK include directory?
# (leave blank or comment out to disable STK support)
# STK=/usr/src/stk/include
# where should flext libraries be built?
TARGDIR=./max-darwin
# where should flext libraries be installed?
# (leave blank to omit installation)
INSTDIR="/Library/Application Support/Cycling '74/flext"
# additional compiler flags
# (check if they fit for your system!)
UFLAGS=-DFLEXT_USE_SIMD -malign-power -maltivec -faltivec
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net)
#
# where is the Max SDK?
MAXSDKPATH="C:\data\prog\audio\maxmspsdk_win\4.5 headers\c74support"
# where is MS VC++?
# (should be commented out when called from the Visual Studio Command prompt)
# MSVCPATH="c:\programme\prog\microsoft visual studio\VC98"
# where is the SndObj include directory?
# headers are searched in SNDOBJ/include, the sndobj.lib in SNDOBJ/lib
# (leave blank or comment out to disable SndObj support)
# SNDOBJ=f:\prog\audio\sndobj
# where is the STK include directory?
# headers are searched in STK/include, the stk.lib in STK/lib
# (leave blank or comment out to disable STK support)
# STK=f:\prog\audio\stk
# where should flext libraries be built?
# object files will be placed in subfolders
OUTPATH=".\max-msvc"
# where should flext libraries be installed?
# (leave blank to omit installation)
INSTDIR="%CommonProgramFiles%\Cycling '74\flext"
# user-definable compiler flags
# e.g. FLEXT_USE_SIMD enables SIMD support for capable CPUs (for VC++ 6, you need the Processor Pack)
UFLAGS=/DFLEXT_USE_SIMD /G6 /arch:SSE
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net)
#
# where is PD?
PDPATH=c:\programme\audio\pd
# where is BorlandC++?
BCCPATH=c:\programme\prog\bcc55
# where is the SndObj include directory?
# (leave blank or comment out to disable SndObj support)
SNDOBJ=c:\data\prog\audio\sndobj\include
# where is the STK include directory?
# (leave blank or comment out to disable STK support)
STK=c:\data\prog\audio\stk\include
# build directory for flext libraries?
OUTPATH=.\pd-bcc
# where should flext libraries be installed?
# (leave blank to omit installation)
INSTDIR=$(PDPATH)\flext
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net)
#
# your c++ compiler (define only if it's different than g++)
# CXX=g++
# where is PD?
PDPATH=/cygdrive/c/programme/audio/pd
# where is the SndObj include directory?
# (leave blank or comment out to disable SndObj support)
# SNDOBJ=/cygdrive/f/prog/audio/sndobj/include
# where is the STK include directory?
# (leave blank or comment out to disable STK support)
# STK=/cygdrive/f/prog/audio/stk/include
# where should flext libraries be built?
TARGDIR=./pd-cygwin
# where should flext libraries be installed?
# (leave blank to omit installation)
INSTDIR=${PDPATH}/flext
# additional compiler flags
# (check if they fit for your system!)
UFLAGS=-mcpu=pentium4 -msse
\ No newline at end of file
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net)
#
# your c++ compiler (define only if it's different than g++)
# CXX=g++-3.3
# where are the PD header files? (m_pd.h, m_imp.h, g_canvas.h)
PDPATH=/Applications/audio/Pd-0.38-0test13.app/Contents/Resources/src
# where is the SndObj include directory?
# (leave blank or comment out to disable SndObj support)
# SNDOBJ=/usr/src/sndobj/include
# where is the STK include directory?
# (leave blank or comment out to disable STK support)
# STK=/usr/src/stk/include
# where should flext libraries be built?
TARGDIR=./pd-darwin
# where should flext libraries be installed?
# (leave blank to omit installation)
INSTDIR=/Applications/audio/Pd-0.38-0test10.app/Contents/Resources/flext
# additional compiler flags
# (check if they fit for your system!)
UFLAGS=-DFLEXT_USE_SIMD -maltivec -faltivec
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net)
#
# your c++ compiler (define only if it's different than g++)
# CXX=g++
# where are the PD header files? (m_pd.h, m_imp.h, g_canvas.h)
# if it is a system include path (like /usr/local/include)
# you should leave it blank (as e.g. g++ 3.2 complains about it)
PDPATH=../../../pd/src
# where is the SndObj include directory?
# (leave blank or comment out to disable SndObj support)
#SNDOBJ=/usr/local/include
# where is the STK include directory?
# (leave blank or comment out to disable STK support)
#STK=/usr/src/stk-4.1.1/include
# where should flext libraries be built?
TARGDIR=./pd-linux
# where should flext libraries be installed?
# (leave blank to omit installation)
# Note: the shared libraries will also be installed there. For them to be found you have to add this folder
# to the path of the dynamic linker, e.g. by adding a line in /etc/ld.so.conf
INSTDIR=/usr/local/lib/pd/flext
# additional compiler flags
# (check if they fit for your system!)
# UFLAGS=-mcpu=pentiumpro # gcc 2.95
# UFLAGS=-mcpu=pentium3 -msse # gcc 3.2
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net)
#
# your c++ compiler (define only if it's different than g++)
# CXX=g++
# where is PD?
PDPATH=c:/programme/audio/pd
# where is the SndObj include directory?
# (leave blank or comment out to disable SndObj support)
#SNDOBJ=f:/prog/audio/sndobj/include
# where is the STK include directory?
# (leave blank or comment out to disable STK support)
#STK=f:/prog/audio/stk/include
# where should flext libraries be built?
TARGDIR=./pd-mingw
# where should flext libraries be installed?
# (leave blank to omit installation)
INSTDIR=${PDPATH}/flext
# additional compiler flags
# (check if they fit for your system!)
UFLAGS=-mcpu=pentium4 -msse
\ No newline at end of file
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001-2004 Thomas Grill (gr@grrrr.org)
#
# where is PD?
PDPATH=c:\programme\audio\pd
# where is the pthreads package?
# (comment out if you use the standard pd package where pthreads are included)
# PTHREADS=c:\data\prog\packs\pthreads
# where is MS VC++?
# (should be commented out when called from the Visual Studio Command prompt)
# MSVCPATH="c:\programme\prog\microsoft visual studio\VC98"
# where is the SndObj directory?
# headers are searched in SNDOBJ/include, the sndobj.lib in SNDOBJ/lib
# (leave blank or comment out to disable SndObj support)
SNDOBJ=c:\data\prog\audio\sndobj
# where is the STK include directory?
# headers are searched in STK/include, the stk.lib in STK/lib
# (leave blank or comment out to disable STK support)
STK=c:\data\prog\audio\stk
# where should flext libraries be built?
# object files will be placed in subfolders
OUTPATH=".\pd-msvc"
# where should flext libraries be installed?
# (leave blank to omit installation)
INSTDIR=$(PDPATH)\flext
# user-definable compiler flags
# e.g. FLEXT_USE_SIMD enables SIMD support for capable CPUs (for MSVC6, you need the Processor Pack)
UFLAGS=/DFLEXT_USE_SIMD /G6 /arch:SSE
SRCDIR=source
SRCS= \
flbase.cpp flext.cpp flbuf.cpp fldsp.cpp fllib.cpp \
flxlet.cpp flattr.cpp flattr_ed.cpp flsupport.cpp \
flutil.cpp flatom.cpp flatom_pr.cpp flthr.cpp fltimer.cpp flsimd.cpp flout.cpp \
flatom_app.cpp flatom_part.cpp flitem.cpp flmeth.cpp flmsg.cpp \
flproxy.cpp flqueue.cpp flbind.cpp
HDRS= \
flprefix.h flstdc.h flbase.h flclass.h flext.h flsupport.h flmap.h fldsp.h flinternal.h \
fldefs.h fldefs_hdr.h fldefs_setup.h \
fldefs_methcb.h fldefs_meththr.h fldefs_methadd.h fldefs_methbind.h fldefs_methcall.h \
fldefs_attrcb.h fldefs_attrvar.h fldefs_attradd.h
SRCS_SNDOBJ=flsndobj.cpp
HDRS_SNDOBJ=flsndobj.h
SRCS_STK=flstk.cpp
HDRS_STK=flstk.h
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net)
#
# ----- for internal use ----------------------
#
!include config-max-msvc.txt
NAME=flext
# source files
SOURCE=source
# includes
INCPATH=/I$(MAXSDKPATH)\max-includes /I$(MAXSDKPATH)\msp-includes /I$(SOURCE)
LDFLAGS=
!ifdef MSVCPATH
INCPATH=$(INCPATH) /I$(MSVCPATH)\include
LDFLAGS=$(LDFLAGS) /LIBPATH:$(MSVCPATH)\lib
!endif
# compiler definitions and flags
DEFS=/DFLEXT_SYS=1 $(UFLAGS)
CFLAGS=/GX /GD /Zp2
OFLAGS=/Ox
DFLAGS=/Od /Zi
TARGET=maxwin # appendix to lib name
!ifdef FLEXT_SHARED
DEFS=$(DEFS) /DFLEXT_SHARED /DFLEXT_EXPORTS
!ifdef _DEBUG
LIBS=$(LIBS) $(MAXSDKPATH)\max-includes\win-includes\debug\maxapi.lib $(MAXSDKPATH)\msp-includes\win-includes\debug\maxaudio.lib
!else
LIBS=$(LIBS) $(MAXSDKPATH)\max-includes\win-includes\release\maxapi.lib $(MAXSDKPATH)\msp-includes\win-includes\release\maxaudio.lib
!endif
EXT=dll
!ifndef _DEBUG
CFLAGS=$(CFLAGS) $(OFLAGS) /MT /LD
OBJPATH=l
!else
CFLAGS=$(CFLAGS) $(DFLAGS) /MTd /LDd
OBJPATH=ld
!endif
!else
EXT=lib
!ifdef FLEXT_THREADS
DEFS=$(DEFS) /DFLEXT_THREADS
!ifndef _DEBUG
CFLAGS=$(CFLAGS) $(OFLAGS) /MT
OBJPATH=t
!else
CFLAGS=$(CFLAGS) $(DFLAGS) /MTd
OBJPATH=td
!endif
!else
!ifndef _DEBUG
CFLAGS=$(CFLAGS) $(OFLAGS) /MT
OBJPATH=s
!else
CFLAGS=$(CFLAGS) $(DFLAGS) /MTd
OBJPATH=sd
!endif
!endif # FLEXT_THREADS
!endif # FLEXT_SHARED
# the rest can stay untouched
# ----------------------------------------------
# all the source files from the package
!include make-files.txt
!ifdef SNDOBJ
SRCS=$(SRCS) $(SRCS_SNDOBJ)
HDRS=$(HDRS) $(HDRS_SNDOBJ)
INCPATH=$(INCPATH) /I$(SNDOBJ)/include
!endif
!ifdef STK
SRCS=$(SRCS) $(SRCS_STK)
HDRS=$(HDRS) $(HDRS_STK)
INCPATH=$(INCPATH) /I$(STK)/include
!endif
#default target
all: $(OUTPATH)\$(NAME)-$(TARGET).$(EXT)
# remove build
clean:
-cd $(OUTPATH)
-del /s /q $(OBJPATH) > nul
-rmdir $(OBJPATH)
-cd ..
-del /q $(OUTPATH)\$(NAME)-$(TARGET).$(EXT) > nul
-rmdir $(OUTPATH)
# -----------------------------------------------
OBJS= $(SRCS:.cpp=.obj)
{$(SOURCE)\}.cpp.obj:
@-if not exist $(OUTPATH) mkdir $(OUTPATH)
@cd $(OUTPATH)
@-if not exist $(OBJPATH) mkdir $(OBJPATH)
@cd ..
cl /c $(CFLAGS) $(DEFS) $(INCPATH) /Fo$(OUTPATH)\$(OBJPATH)\$@ $<
$(OUTPATH)\$(NAME)-$(TARGET).lib: $(OBJS)
@cd $(OUTPATH)\$(OBJPATH)
lib /OUT:..\$(NAME)-$(TARGET).lib $(OBJS)
@cd ..\..
!ifdef INSTDIR
@-if not exist $(OBJPATH) mkdir $(INSTDIR)
copy $(OUTPATH)\$(NAME)-$(TARGET).lib $(INSTDIR) > nul
copy $(SOURCE)\*.h $(INSTDIR) > nul
!endif
$(OUTPATH)\$(NAME)-$(TARGET).dll: $(OBJS)
@cd $(OUTPATH)\$(OBJPATH)
link /DLL /NOLOGO $(LDFLAGS) /OUT:..\$(NAME)-$(TARGET).dll $(LIBS) $(OBJS)
@cd ..\..
!ifdef INSTDIR
@-if not exist $(OBJPATH) mkdir $(INSTDIR)
copy $(OUTPATH)\$(NAME)-$(TARGET).dll $(INSTDIR) > nul
copy $(SOURCE)\*.h $(INSTDIR) > nul
!endif
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001-2004 Thomas Grill (gr@grrrr.org)
#
# Makefile for BorlandC++
#
# usage: make -f makefile.bcc
!include config-pd-bcc.txt
TARGET=pdwin # appendix to lib name
# includes
INCPATH=-I$(BCCPATH)\include -I$(PDPATH)\src -I$(SRCDIR)
# compiler definitions and flags
DEFS=-DFLEXT_SYS=2
CFLAGS=-tWD
!ifdef DEBUG
CFLAGS=$(CFLAGS) -v
DEFS=$(DEFS) -DFLEXT_DEBUG
!else
CFLAGS=$(CFLAGS) -6 -O2 -OS -ff
!endif
!ifdef THREADED
CFLAGS=$(CFLAGS) -tWM
DEFS=$(DEFS) -DFLEXT_THREADS
!endif
# the rest can stay untouched
# ----------------------------------------------
# all the source files from the package
!include make-files.txt
!ifdef SNDOBJ
INCPATH=$(INCPATH) -I$(SNDOBJ)
SRCS=$(SRCS) $(SRCS_SNDOBJ)
HDRS=$(HDRS) $(HDRS_SNDOBJ)
!endif
!ifdef STK
INCPATH=$(INCPATH) -I$(STK)
SRCS=$(SRCS) $(SRCS_STK)
HDRS=$(HDRS) $(HDRS_STK)
!endif
TARGET=$(OUTPATH)\$(NAME)-$(TARGET).lib
#default target
all: $(OUTPATH) $(TARGET) $(OUTPATH)\pd.lib $(OUTPATH)\pthreadVC.lib
# remove build
clean:
-del /s /q $(OUTPATH) > nul
rmdir $(OUTPATH)
# -----------------------------------------------
OBJS= $(SRCS:.cpp=.obj)
#.PATH.obj=$(OUTPATH)
DIR="/"
$(OUTPATH)\pd.lib: $(PDPATH)\bin\pd.dll
implib -a $< $**
$(OUTPATH)\pthreadVC.lib: $(PDPATH)\bin\pthreadVC.dll
implib -a $< $**
{$(SRCDIR)}.cpp.obj:
bcc32 -c $(CFLAGS) $(DEFS) $(INCPATH) -n$(OUTPATH) $<
$(OUTPATH):
@-if not exist $< mkdir $<
$(TARGET): $(OBJS)
@-del "$<"
cd $(OUTPATH)
tlib "..\$<" +$(**: = +)
cd ..
!if $d(INSTDIR) && "$(INSTDIR)" != ""
@-if not exist $(INSTDIR) mkdir $(INSTDIR)
-copy $< $(INSTDIR) >nul
-copy $(OUTPATH)\pd.lib $(INSTDIR) >nul
-copy $(OUTPATH)\pthreadVC.lib $(INSTDIR) >nul
-copy $(SRCDIR)\*.h $(INSTDIR) >nul
!endif
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net)
#
# ----- for internal use ----------------------
#
!include config-pd-msvc.txt
NAME=flext
# source files
SOURCE=source
# includes
INCPATH=/I$(PDPATH)\src /I$(SOURCE)
!ifdef MSVCPATH
INCPATH=$(INCPATH) /I$(MSVCPATH)\include
!endif
!ifdef PTHREADS
INCPATH=$(INCPATH) /I$(PTHREADS)
!endif
LDFLAGS=/LIBPATH:$(MSVCPATH)\lib
# compiler definitions and flags
DEFS=/DFLEXT_SYS=2 $(UFLAGS)
CFLAGS=/GX /GD
OFLAGS=/Ox
DFLAGS=/Od /Zi
TARGET=pdwin # appendix to lib name
!ifdef FLEXT_SHARED
DEFS=$(DEFS) /DFLEXT_SHARED /DFLEXT_EXPORTS
EXT=dll
!ifndef _DEBUG
CFLAGS=$(CFLAGS) $(OFLAGS) /MT /LD
OBJPATH=l
!else
CFLAGS=$(CFLAGS) $(DFLAGS) /MTd /LDd
OBJPATH=ld
!endif
LIBS=$(PDPATH)\bin\pd.lib
!ifdef PTHREADS
LIBS=$(LIBS) $(PTHREADS)\pthreadVC.lib
!else
LIBS=$(LIBS) $(PDPATH)\bin\pthreadVC.lib
!endif
!else
EXT=lib
!ifdef FLEXT_THREADS
DEFS=$(DEFS) /DFLEXT_THREADS
!ifndef _DEBUG