Full windowed mode should now work correctly on linux. On windows it doesn't work...
[NALCG.git] / tools / makefile_updater.sh
blob1913b079104281c54c545e2a18d458cd457fb52c
1 #!/bin/bash
3 # initializing
4 relative_src_location="../src"
5 where_was_I=`pwd`
6 src_dir=`readlink -f "$relative_src_location"`
7 if [[ "$where_was_I" != "$src_dir" ]]; then
8 echo "Switching from $where_was_I to $src_dir"
9 cd "$src_dir"
12 # for linker options
13 GCCFLAGS=`pkg-config --libs --cflags CEGUI-OGRE OIS OGRE CEGUI`
15 function usage {
16 echo "usage: sh $0 class1 class2 class3"
17 echo "to update all dependencies: sh $0 --all"
19 function fixLinkerFlags() {
20 sed -e "s:^\(LINKER_FLAGS=\).*$:\1$GCCFLAGS:g" -i Makefile
23 if [[ $# == 0 ]]; then
24 usage
25 echo -e "\nValid files:"
26 #files="`find . -iregex '.*\.cpp'`"
27 files="*.cpp logic/*.cpp view/*.cpp"
28 for f in $files
30 echo -en "${f%.cpp} "
31 done
32 echo ""
33 else
34 # check if user wants to go through all dependencies
35 if [[ $1 == "--all" ]]; then
36 #files="`find . -iregex '.*\.cpp'`"
37 files="*.cpp logic/*.cpp view/*.cpp"
38 else
39 files=$@
41 fixLinkerFlags
42 for f in $files
44 # parse off the extension
45 file=${f%.cpp}
46 filepath="${f%/*}/"
48 if [[ "${f}/" == "${filepath}" ]]; then
49 filepath=""
51 if [[ -f "$file.cpp" ]]; then
52 # check if target is already in the OBJS-list
53 objs=`grep "^OBJS=.*$file.o" Makefile`
55 # add target to OBJS-list if it is missing
56 if [[ -z "$objs" ]]; then
57 sed -e "s%\(^OBJS=.*\)%\1 $file.o%g" -i Makefile
58 echo "object $file.o added to list of known objects"
60 else
61 echo "file not found: $f / $file"
62 usage
64 done
67 if [[ "$where_was_I" != "`pwd`" ]]; then
68 echo "Switching back to $where_was_I"
69 cd "$where_was_I"