4 relative_src_location
="../src"
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"
13 GCCFLAGS
=`pkg-config --libs --cflags CEGUI-OGRE OIS OGRE CEGUI`
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
25 echo -e "\nValid files:"
26 #files="`find . -iregex '.*\.cpp'`"
27 files
="*.cpp logic/*.cpp view/*.cpp"
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"
44 # parse off the extension
48 if [[ "${f}/" == "${filepath}" ]]; then
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"
61 echo "file not found: $f / $file"
67 if [[ "$where_was_I" != "`pwd`" ]]; then
68 echo "Switching back to $where_was_I"