diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2005-11-15 02:42:34 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2005-11-15 02:42:34 +0000 |
commit | 440e3d9c5d549f55c74fe4242d7217c95886ec97 (patch) | |
tree | 6e2919a3b93ca7f61c7f78056cf73d04d986533c /externals/build | |
parent | 699bd1f1bb443d3043193d5649ffb1279d9fe0b8 (diff) |
got basically everything building with MinGW, now got to get things linking dynamically instead of statically
svn path=/trunk/; revision=3907
Diffstat (limited to 'externals/build')
-rw-r--r-- | externals/build/win/m_pd.h | 13 | ||||
-rw-r--r-- | externals/build/win/makefile | 54 | ||||
-rwxr-xr-x | externals/build/win/makefile.nmake | 52 |
3 files changed, 94 insertions, 25 deletions
diff --git a/externals/build/win/m_pd.h b/externals/build/win/m_pd.h deleted file mode 100644 index e31b8ad7..00000000 --- a/externals/build/win/m_pd.h +++ /dev/null @@ -1,13 +0,0 @@ -/* windows compatibility stuff - cr 2004 */
-
-#include "../../../src/m_pd.h"
-
-#define setenv(a,b,c) _putenv(a)
-#define drand48() ((double)rand()/RAND_MAX)
-#define srand48(n) srand((n));
-#define expm1(e) exp(e)-1
-#define bzero(p,n) memset(p,0,n)
-#define PROT_READ 1
-#define MAP_PRIVATE 2
-#define O_NONBLOCK 1
-#define O_NDELAY O_NONBLOCK
diff --git a/externals/build/win/makefile b/externals/build/win/makefile index c9289591..7b48c1a9 100644 --- a/externals/build/win/makefile +++ b/externals/build/win/makefile @@ -1,34 +1,64 @@ # Adapt the PDPATH if your pd is not installed in the standard place -PDPATH="$(PROGRAMFILES)/pd" - - - +# path for compiling against an installed version of Pd +#PDPATH="$(PROGRAMFILES)/pd" +# path for compiling from CVS with the standard developer layout +PDPATH=../../../pd EXTERNALS = $(shell ls ../src) -all: - make -k externals +all: externals externals: $(EXTERNALS:.c=.dll) .SUFFIXES: .dll -DEFINES = -DPD -DNT -CFLAGS = -Wall -W -Wshadow -Wstrict-prototypes \ - -Wno-unused -Wno-parentheses -Wno-switch +# these are little macros for remapping things on Windows +WINDOWS_COMPAT_DEFINES = \ + -D'drand48()=((double)rand()/RAND_MAX)' \ + -D'srand48(n)=srand((n))' \ +# -D'bzero(p,n)=memset(p,0,n)' \ +# -D'PROT_READ=1' \ +# -D'MAP_PRIVATE=2' \ +# -D'O_NONBLOCK=1' \ +# -D'O_NDELAY=O_NONBLOCK' + +DEFINES = -DPD -DNT $(WINDOWS_COMPAT_DEFINES) + + +# Generic x86 (tune for 686, since that's most common these days) +OPTIM_FLAGS = -O2 -march=i686 -mfpmath=sse -msse +# Pentium MMX +#OPTIM_FLAGS = -O3 -march=pentium-mmx -mmmx +# Pentium Pro +#OPTIM_FLAGS = -O3 -march=pentiumpro -mmmx +# Pentium II/Celeron +#OPTIM_FLAGS = -O3 -mfpmath=sse -mmmx -msse -march=pentium2 +# Pentium III/Celeron2 +#OPTIM_FLAGS = -O3 -mfpmath=sse -mmmx -msse -march=pentium3 +# Pentium 4 +#OPTIM_FLAGS = -O3 -mfpmath=sse -mmmx -msse -msse2 -march=pentium4 + +# AMD Athlon XP K7 +#OPTIM_FLAGS = -O3 -march=athlon-xp -m3dnow -msse -mfpmath=sse + +CFLAGS = -Wall -W -Wshadow -Wstrict-prototypes -Wno-unused -Wno-parentheses \ + -Wno-switch $(OPTIM_FLAGS) INCLUDE = -I. -I.. -I$(PDPATH)/src +DLLWRAP_FLAGS = --as=$(AS) --export-all --driver-name $(CC) -s %.dll: ../src/%.c - $(CC) -mms-bitfields $(CFLAGS) $(DEFINES) $(INCLUDE) -o "$*.o" -c "../src/$*.c" + $(CC) -mms-bitfields $(CFLAGS) $(DEFINES) $(INCLUDE) \ + -o "$*.o" -c "../src/$*.c" gcc -shared -o "$*.dll" "$*.o" $(PDPATH)/bin/pd.dll \ - `test -f $*.libs && cat $*.libs` `test -f ../src/$*.libs && cat ../src/$*.libs` + `test -f $*.libs && cat $*.libs` \ + `test -f ../src/$*.libs && cat ../src/$*.libs` clean: - -rm *.a *.def *.dll *.o + -rm *.a *.def *.dll *.o *.obj install-doc: @test -d $(PDPATH)/doc/5.reference || mkdir -p $(PDPATH)/doc/5.reference diff --git a/externals/build/win/makefile.nmake b/externals/build/win/makefile.nmake new file mode 100755 index 00000000..32a44852 --- /dev/null +++ b/externals/build/win/makefile.nmake @@ -0,0 +1,52 @@ +# ----------------------- NT ----------------------- + + +EXTERNALS=\ +#!IF ![f exist filelist.inc del filelist.inc & for %i in (*.c) do @echo %i \>> filelist.inc] +!INCLUDE filelist.inc +#!ENDIF + +all: filelist.inc link.stamp $(EXTERNALS:.c=.dll) + +.SUFFIXES: .dll + +PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo +VC="C:\Program Files\Microsoft Visual Studio\Vc98" +SRCPATH=..\src + +PDNTINCLUDE = /I. /I.. /I..\..\..\pd\src /I$(VC)\include + +PDNTLDIR = $(VC)\lib +PDNTLIB = $(PDNTLDIR)\libc.lib \ + $(PDNTLDIR)\oldnames.lib \ + $(PDNTLDIR)\kernel32.lib \ + $(PDNTLDIR)\wsock32.lib \ + ..\..\..\pd\bin\pd.lib + +.c.dll: + cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c + link /dll /export:$(*:~=_tilde)_setup $(*).obj $(PDNTLIB) + del $*.obj $*.lib $*.exp + +filelist.inc: + if exist filelist.inc del filelist.inc +# for %i in ($(SRCPATH)\*.c) do @echo %~ni%~xi \>> filelist.inc + for %i in ($(SRCPATH)\*.c) do @echo %~ni%~xi \>> filelist.inc + +transfer: + copy $(SRCPATH)\*.c . + +link.stamp: filelist.inc + copy $(SRCPATH)\*.c . + copy /y nul link.stamp + nmake + +clean: +# don't delete filelist.inc at the moment, as some externals can't be compiled +# on win32 + -del link.stamp + -del *.c + -del *.obj + -del *.lib + -del *.exp + -del *.dll |