Merge pull request #2 from danielt3/master
[BennuGD.git] / newBuild-debian.sh
blobc8de0f1a8bc6e009c9b3f9e85ca5ced5a2851ce8
1 #!/bin/sh
3 TARGET=i386-linux-gnu
4 MY_PKG_CONFIG_PATH=/usr/lib/${TARGET}/pkgconfig
6 echo "### Building core... ### "
7 cd core
8 case $1 in
9 release)
10 autoreconf --install && PKG_CONFIG_PATH=${MY_PKG_CONFIG_PATH} CFLAGS=-Wl,--rpath=. ./configure --host=${TARGET} && make
12 clean)
13 make distclean
14 make clean
15 rm -rf aclocal.m4 autom4te.cache/ compile config.guess config.log config.status config.sub configure depcomp install-sh libtool ltmain.sh m4/ Makefile.in missing Makefile
16 find . -name *.in -exec rm {} \;
19 make
21 esac
22 if [ $? -ne 0 ]; then
23 echo "*** ERROR building core! ***"
24 exit 1
26 cd -
28 echo "### Building modules... ### "
29 cd modules
30 case $1 in
31 release)
32 autoreconf --install && PKG_CONFIG_PATH=${MY_PKG_CONFIG_PATH} CFLAGS=-Wl,--rpath=. ./configure --host=${TARGET} && make
34 clean)
35 make distclean
36 make clean
37 rm -rf aclocal.m4 autom4te.cache/ compile config.guess config.log config.status config.sub configure depcomp install-sh libtool ltmain.sh m4/ Makefile.in missing Makefile
38 find . -name *.in -exec rm {} \;
41 make
43 esac
44 if [ $? -ne 0 ]; then
45 echo "*** ERROR building modules! ***"
46 exit 1
48 cd -
50 echo "### Building tools... ### "
51 cd tools/moddesc
52 case $1 in
53 release)
54 autoreconf --install && PKG_CONFIG_PATH=${MY_PKG_CONFIG_PATH} CFLAGS=-Wl,--rpath=. ./configure --host=${TARGET} && make
56 clean)
57 make distclean
58 make clean
59 rm -rf aclocal.m4 autom4te.cache/ compile config.guess config.log config.status config.sub configure depcomp install-sh libtool ltmain.sh m4/ Makefile.in missing Makefile
60 find . -name *.in -exec rm {} \;
63 make
65 esac
66 if [ $? -ne 0 ]; then
67 echo "*** ERROR building tools! ***"
68 exit 1
70 cd -
72 echo "#### Deploying..."
73 mkdir -p bin/${TARGET} 2>/dev/null
74 cp core/bgdi/src/.libs/bgdi bin/${TARGET}
75 cp core/bgdc/src/bgdc bin/${TARGET}
76 cp core/bgdrtm/src/.libs/libbgdrtm.so bin/${TARGET}
77 find modules -name '*.so' -exec cp {} bin/${TARGET} \;
78 cp tools/moddesc/moddesc bin/${TARGET}
80 echo "#### Striping..."
81 strip bin/${TARGET}/bgdi
82 strip bin/${TARGET}/bgdc
83 strip bin/${TARGET}/libbgdrtm.so
84 strip bin/${TARGET}/moddesc
85 find bin/${TARGET} -name '*.so' -exec strip {} \;
87 echo "### Done! ###"