aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2003-08-18 00:02:06 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2003-08-18 00:02:06 +0000
commitb63fb5e692d69f16882f010e7082b3d744b0de31 (patch)
tree42ff4d1a2283e5859f133cc1c5049d7cdf8227ef
parentff73d71bb849ceab4994d182dd80a324144d7678 (diff)
first attempt at single Makefile for all objects; doesn't compile all objects yet; behaves strangely
svn path=/trunk/externals/unauthorized/; revision=875
-rw-r--r--Makefile121
1 files changed, 121 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b2fba41
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,121 @@
+EXT=pd_darwin
+
+INSTALL_PREFIX=/usr/local
+CC=gcc
+
+# find all files to compile
+TARGETS=$(subst .tk,.tk2c,$(wildcard *.tk)) $(subst .c,.$(EXT),$(wildcard *.c))
+
+current: $(EXT)
+
+.SUFFIXES: .pd_linux .pd_darwin .pd_irix5 .pd_irix6 .dll .tk .tk2c
+
+# ----------------------- prep -----------------------
+# copy all of the files into the root dir for compiling
+
+prep:
+ cp */*.c */*.h */*.cc */*.tk .
+ rm grid*.* mp*.*
+
+# ----------------------- Mac OSX -----------------------
+
+pd_darwin: $(TARGETS)
+
+
+DARWINCFLAGS = -DPD -DUNIX -DMACOSX -DICECAST -O2 -Wall -W -Wshadow -Wstrict-prototypes \
+ -Wno-unused -Wno-parentheses -Wno-switch
+
+.c.osx:
+ $(CC) $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
+
+.tk.tk2c:
+ ./tk2c.bash < $*.tk > $*.tk2c
+
+.c.pd_darwin:
+ $(CC) $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
+ $(CC) -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o
+ -rm $*.o
+
+# ----------------------- NT -----------------------
+
+pd_nt: prep $(NAME).dll
+
+PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo
+VC="C:\Program Files\Microsoft Visual Studio\Vc98"
+
+PDNTINCLUDE = /I. /I\tcl\include /I\ftp\pd\src /I$(VC)\include
+
+PDNTLDIR = $(VC)\lib
+PDNTLIB = $(PDNTLDIR)\libc.lib \
+ $(PDNTLDIR)\oldnames.lib \
+ $(PDNTLDIR)\kernel32.lib \
+ \ftp\pd\bin\pd.lib
+
+.c.ont:
+ cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c
+
+.c.dll:
+ cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c
+# need to find a way to replace $(CSYM)
+# link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB)
+
+# ----------------------- IRIX 5.x -----------------------
+
+pd_irix5: prep $(NAME).pd_irix5
+
+SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2
+
+SGIINCLUDE = -I../../src
+
+.c.oi5:
+ $(CC) $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c
+
+.c.pd_irix5:
+ $(CC) $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c
+ ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o
+ rm $*.o
+
+# ----------------------- IRIX 6.x -----------------------
+
+pd_irix6: prep $(NAME).pd_irix6
+
+SGICFLAGS6 = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
+ -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
+ -Ofast=ip32
+
+.c.oi6:
+ $(CC) $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c
+
+.c.pd_irix6:
+ $(CC) $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c
+ ld -n32 -IPA -shared -rdata_shared -o $*.pd_irix6 $*.o
+ rm $*.o
+
+# ----------------------- LINUX i386 -----------------------
+
+pd_linux: prep $(NAME).pd_linux
+
+LINUXCFLAGS = -DPD -DUNIX -DICECAST -O2 -funroll-loops -fomit-frame-pointer \
+ -Wall -W -Wno-shadow -Wstrict-prototypes -g \
+ -Wno-unused -Wno-parentheses -Wno-switch -Werror
+
+LINUXINCLUDE = -I../../src -I/usr/local/src/pd/src
+
+.c.o:
+ $(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
+
+.c.pd_linux:
+ ./tk2c.bash < $*.tk > $*.tk2c
+ $(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
+ ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm
+ strip --strip-unneeded $*.pd_linux
+ rm $*.o
+
+# ----------------------------------------------------------
+
+install:
+ cp */*.pd ../../doc/5.reference
+
+clean:
+ -rm -f *.?~ *.o *.pd_* *.dll *.tk2c core so_locations
+ -rm -f ./*.c ./*.h ./*.cc ./*.tk