looking good with scripted cleanup
[feisty_meow.git] / scripts / clam / make_subdirs.sh
diff --git a/scripts/clam/make_subdirs.sh b/scripts/clam/make_subdirs.sh
new file mode 100644 (file)
index 0000000..ac95055
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# travels down each subdirectory and builds using make.
+function make_subdirectories()
+{
+  # keep the variable local to avoid contaminating
+  # other runs.
+  local burlap51
+
+  # find all the subdirectories.
+  for burlap51 in $(find . -mindepth 1 -maxdepth 1 -type d); do
+    # make sure there's a makefile there.
+    if [ -f "$burlap51/makefile" ]; then
+#echo "inside barriers, with filename=$burlap51 and all conditions met."
+      pushd "$burlap51"
+      make --silent -I "$CLAM_DIR" NOT_FIRST_MAKE=t 
+      popd
+    else
+      echo "Skipping makefile-less directory $burlap51..."
+    fi
+  done
+}
+
+# executes our subdirectory make function.
+make_subdirectories $*
+