3 # Copyright © 2006-2013 SplinterGU (Fenix/Bennugd)
5 # This file is part of Bennu - Game Development
7 # This software is provided 'as-is', without any express or implied
8 # warranty. In no event will the authors be held liable for any damages
9 # arising from the use of this software.
11 # Permission is granted to anyone to use this software for any purpose,
12 # including commercial applications, and to alter it and redistribute it
13 # freely, subject to the following restrictions:
15 # 1. The origin of this software must not be misrepresented; you must not
16 # claim that you wrote the original software. If you use this software
17 # in a product, an acknowledgment in the product documentation would be
18 # appreciated but is not required.
20 # 2. Altered source versions must be plainly marked as such, and must not be
21 # misrepresented as being the original software.
23 # 3. This notice may not be removed or altered from any source
28 TARGET
=i386-linux-gnu-static
32 for i
in $
(ls -d $PWD/modules
/*|
grep -v mathi
); do if [ -d $i ]; then echo -n " -I$i "; fi; done
37 for i
in $
(find modules
-name '*.a'|
grep -v mod_mathi
); do echo -n "-L$PWD/$(dirname $i) -l$(basename $i .a) "|
sed 's/-llib/-l/g'; done
40 echo "#### building necessaries files ####"
42 cd 3rdparty
/des-4.04b
> /dev
/null
2> /dev
/null
45 make -f Makefile.uni clean
49 cd - > /dev
/null
2> /dev
/null
51 COMMON_LDFLAGS
="-L$PWD/3rdparty/des-4.04b -ldes"
52 COMMON_CFLAGS
="-I$PWD/3rdparty/des-4.04b -DUSE_LIBDES"
54 EXTRA_STATIC_CFLAGS
="$(sdl-config --cflags)"
55 export EXTRA_STATIC_CFLAGS
57 EXTRA_STATIC_LDFLAGS
=$
(ldflags
)
58 export EXTRA_STATIC_LDFLAGS
60 cd core
> /dev
/null
2> /dev
/null
65 .
/configure
--enable-static COMMON_LDFLAGS
="$COMMON_LDFLAGS" COMMON_CFLAGS
="$COMMON_CFLAGS" CFLAGS
="$COMMON_CFLAGS" && make clean
70 cd bgdrtm
> /dev
/null
2> /dev
/null
76 cd - > /dev
/null
2> /dev
/null
78 cd ..
/modules
> /dev
/null
2> /dev
/null
81 .
/configure
--enable-static COMMON_LDFLAGS
="$COMMON_LDFLAGS" COMMON_CFLAGS
="$COMMON_CFLAGS" CFLAGS
="$COMMON_CFLAGS" && make clean
89 cd ..
> /dev
/null
2> /dev
/null
91 EXTRA_STATIC_CFLAGS
="$(cflags) $(sdl-config --cflags)"
93 rm -Rf core
/bgdi
/src
/bgdi core
/bgdc
/src
/bgdc
95 cd core
/bgdc
> /dev
/null
2> /dev
/null
102 if [ $?
-ne 0 ]; then
106 cd - > /dev
/null
2> /dev
/null
108 cd core
/bgdi
> /dev
/null
2> /dev
/null
115 if [ $?
-ne 0 ]; then
119 cd - > /dev
/null
2> /dev
/null
121 echo "### Copying files to bin folder ###"
123 mkdir
-p bin
/$TARGET 2>/dev
/null
124 #cp 3rdparty/des-4.04b/libdes.so bin/$TARGET
125 cp core
/bgdi
/src
/bgdi bin
/$TARGET
126 cp core
/bgdc
/src
/bgdc bin
/$TARGET
128 echo "### Build done! ###"