Better SENF configuration support (local_config.hh)
[senf.git] / find-sources.sh
index df2080b..be46965 100755 (executable)
@@ -1,8 +1,28 @@
-#!/bin/sh
+#!/bin/sh -e
+
+if [ -z "$1" ]; then
+    echo "Usage:"
+    echo "     $0 [-c] <commands>"
+    echo
+    echo "-c Only list C/C++ source files"
+    echo
+    echo "<commands> are any find commands (which should contain a -print somewhere)"
+    echo "which are matched for any file fond"
+    exit 1
+fi
+
+cond=""
+if [ "$1" = "-c" ]; then
+    shift
+    cond='( -name *.h -o -name *.hh -o -name *.ih -o -name *.c -o -name *.cc -o -name *.cci -o -name *.ct -o -name *.cti -o -name *.mpp )'
+fi
+
+set -f
 
 find . \
        -name .svn -prune -o \
        -name doc -prune -o \
+       -name debian -prune -o \
        -name "*.a" -o \
        -name "*.o" -o \
        -name "*~" -o \
@@ -11,5 +31,5 @@ find . \
        -name .test.bin -o \
        -name "*.stamp" -o \
        -name ".sconsign*" -o \
-       -type f \( "$@" \)
+    -type f $cond \( "$@" \)