Fixed a small bug involving null <-> Sylph::null in Sylph.h
[libs.git] / developers.sh
blob3aa15b1f68fe42318cca4154870e07cf10257427
1 #!/bin/bash
2 #
3 # File: developers.sh
4 # Author: SeySayux
7 log() {
8 echo $@ >&2
11 do-git() {
12 #prepare for GIT
13 cat > README-GIT << EOT
14 You have checked out the current master branch from Git. Code from Git does
15 not always compile or can be incomplete.
16 EOT
17 if [ "$1" == "compile" ]; then
18 cat >> README-GIT << EOT
19 However, current code seems to compile. Be warned that it may still have many
20 bugs, or can be simply incomplete. If you want to have working code, please
21 check out the latest relase from the 'unstable' branch.
22 EOT
23 else
24 cat >> README-GIT << EOT
25 GIT is currently known to be broken. Please check out the latest release from
26 the 'unstable' branch.
27 EOT
29 cat >> README-GIT << EOT
31 For instructions on building and installing, please see the README file in this
32 directory. You might need to recreate the src/SourcesList.txt files. In order to
33 do so, please run:
35 ./developers.sh cmake
37 This will create the required files for the build.
38 EOT
42 do-cmake() {
43 log Creating/updating SourcesList.txt...
44 pushd src
45 echo '# This file is automatically generated by developers.sh in' \
46 > SourcesList.txt
47 echo '# the main source directory. DO NOT EDIT MANUALLY!' >> SourcesList.txt
48 echo >> SourcesList.txt
49 echo 'SET ( SYLPH_ALL_SRC ' >> SourcesList.txt
51 for x in `find * | grep '\.cpp$'`; do
52 echo -n "$x " >> SourcesList.txt
53 done
55 echo ' )' >> SourcesList.txt
56 popd
58 pushd test
59 echo '# This file is automatically generated by developers.sh in' \
60 > SourcesList.txt
61 echo '# the main source directory. DO NOT EDIT MANUALLY!' >> SourcesList.txt
62 echo >> SourcesList.txt
63 echo 'SET ( STEST_ALL_PRE_SRC ' >> SourcesList.txt
65 for x in `find * | grep '\.tst$'`; do
66 echo -n "$x " >> SourcesList.txt
67 done
69 echo ' )' >> SourcesList.txt
70 echo >> SourcesList.txt
71 echo 'SET ( STEST_ALL_SRC ' >> SourcesList.txt
73 for x in `find * | grep '\.tst$'`; do
74 y=`echo $x | sed 's/tst$/cpp/'`
75 echo -n "$y " >> SourcesList.txt
76 done
78 echo ' )' >> SourcesList.txt
79 popd
80 log 'Done!'
83 do-release() {
84 if [ -z "$1" ]; then error; fi
85 log Preparing for release "$1" of LibSylph...
86 log Cleaning SVN stuff...
87 rm -f README-SVN
88 find . -name '.svn' -exec rm -rf '{}' \;
89 log Creating CMake stuff
90 do-cmake
91 log Cleaning build...
92 make clean
93 log Removing old builds
94 for x in `ls | grep "^libsylph-.*-src.tar.bz2$"`; do
95 rm -v $x;
96 done;
97 log Creating tarball in parent directory...
98 pushd ..
99 cp sylph libsylph-"$1"-src
100 tar cjf libsylph-"$1"-src libsylph-"$1"-src.tar.bz2
101 rm -rf libsylph-"$1"-src
102 popd
103 log Removing this script '('don\'t worry, it\'s up in SVN')'...
104 rm -f developers.sh
105 log 'Done!'
108 error() {
109 echo "Syntax error."
110 exit 1
113 case "$1" in
114 git)
115 case "$2" in
116 compile|nocompile)
117 do-git "$2"
120 error
122 esac
124 cmake)
125 do-cmake
127 release)
128 do-release "$1"
131 echo 'This script contains several useful functions for the LibSylph devs.'
133 esac