00ba783c6d389a7f12d1a182b3b814872132298a
[feisty_meow.git] / scripts / clam / clean_subdirs.sh
1 #!/bin/bash
2
3 # travels down each subdirectory and cleans using make.
4 function clean_subdirectories()
5 {
6   # keep the variable local to avoid contaminating
7   # other runs.
8   local smoot87
9
10   # find all the subdirectories.
11   for smoot87 in $(find . -mindepth 1 -maxdepth 1 -type d); do
12     # make sure there's a makefile there.
13     if [ -f "$smoot87/makefile" ]; then
14 #echo "inside barriers, with filename=$smoot87 and all conditions met."
15       pushd "$smoot87"
16       make --silent -I "$CLAM_DIR" NOT_FIRST_MAKE=t clean
17       popd
18     else
19       echo "Skipping makefile-less directory $smoot87..."
20     fi
21   done
22 }
23
24 # execute our function on current directory.
25 clean_subdirectories
26