first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / scripts / buildor / check_makefile.sh
1 #!/bin/bash
2
3 for dir in $*; do
4
5   if [ ! -d "$dir" ]; then continue; fi
6
7   problems_seen=
8   pushd $dir &>/dev/null
9   for i in $(find . -iname "*cpp" -o -iname "*.rc" -o -iname "*.resx" -o -iname "*.cs" ); do
10
11     if [ ! -z "$(echo "$i" | grep '.svn')" ]; then continue; fi
12
13     is_lib_cpp=$(echo $i | sed -n -e 's/^\(.*_library.cpp\)$/\1/p')
14     if [ ! -z "$is_lib_cpp" ]; then
15       # don't require the X_library.cpp file to be listed.
16       continue;
17     fi
18
19     # make the exe variant to search for that as a secondary possibility.
20     altered_file="$(echo $i | sed -e 's/\.cpp$/\.exe/')"
21
22     for q in makefile*; do
23       grep -l $(echo $i | sed -e 's/^\.\///' ) $q &>/dev/null
24       if [ $? -ne 0 ]; then
25
26         # try again with the exe form of the name.
27         grep -l $(echo "$altered_file" | sed -e 's/^\.\///' ) $q &>/dev/null
28
29         if [ $? -ne 0 ]; then
30           # complain now, it's definitely missing.
31           echo "missing $i in $dir/$q"
32           problems_seen=true
33         fi 
34       fi 
35     done
36   done
37   popd &>/dev/null
38
39   if [ -z "$problems_seen" ]; then
40     echo "makefiles okay in $dir"
41   fi
42
43 done
44