5 # ***** BEGIN GPL LICENSE BLOCK *****
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License
9 # as published by the Free Software Foundation; either version 2
10 # of the License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software Foundation,
19 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
22 # All rights reserved.
24 # The Original Code is: all of this file.
26 # Contributor(s): none yet.
28 # ***** END GPL LICENSE BLOCK *****
34 if ( test "WIN32" = "$TARGET" ) then
36 CFLAGS="-funsigned-char -O2";
39 LDFLAGS="-Bshareable -lm";
40 elif ( test $UNAME = "IRIX64" -o $UNAME = "IRIX" ) then
42 CFLAGS="-KPIC -O2 -mips3";
46 elif ( test $UNAME = "FreeBSD" ) then
48 CFLAGS="-fPIC -funsigned-char -O2";
51 LDFLAGS="-Bshareable";
52 elif ( test $UNAME = "OpenBSD" ) then
54 CFLAGS="-fPIC -funsigned-char -O2";
57 LDFLAGS="-Bshareable";
58 elif ( test $UNAME = "Linux" ) then
60 CFLAGS="-fPIC -funsigned-char -O2";
63 LDFLAGS="-Bshareable";
64 elif ( test $UNAME = "SunOS" ) then
70 elif ( test $UNAME = "Darwin" ) then
72 CFLAGS="-fPIC -funsigned-char -O2 -fno-common";
74 LDFLAGS="-flat_namespace -bundle -bundle_loader ../../blender.app/Contents/MacOS/blender -lm";
78 if ( test "$#" = "1" ) then
79 if ( test -f $1 ) then
80 BASE_FILE=`echo $1 | sed -e "1 s/\.c//g"`;
87 SOFILE="$BASE_FILE.$EXT"
89 if ( test -f $1$2 ) then
90 BASE_FILE=`echo $2 | sed -e "1 s/\.c//g"`;
95 CFILE="$1$BASE_FILE.c"
96 if (test "$TARGET" = "WIN32" ) then
97 DLLFILE="$BASE_FILE.dll";
100 SOFILE="$BASE_FILE.$EXT"
104 if ( test -f plugin.h ) then
106 elif ( test -f "include/plugin.h" ) then
108 elif ( test -f "../plugin.h" ) then
110 elif ( test -f "../include/plugin.h" ) then
111 INCLUDES=-I../include
113 echo "Couldn't find plugin.h";
117 LIBM=`fgrep "#include <math.h>" $CFILE`
118 LIBC=`fgrep "#include <std" $CFILE`
122 if ( test -n "$LIBM" ) then
125 if ( test -n "$LIBC" ) then
129 echo "$CC $CFLAGS -c $CFILE $INCLUDES"
130 $CC $CFLAGS -c $CFILE $INCLUDES
132 if ( test "$?" != "0") then
133 echo "Compile error";
137 echo "$LD $LDFLAGS $OFILE -o $SOFILE $LIBS"
138 $LD $LDFLAGS $OFILE -o $SOFILE $LIBS
140 if ( test "$?" != "0") then