Factor Remakefie and add more tests for parallel query composition.
[tatoo.git] / tools / ocamlmoduledep.sh
index 3bab186..befd4cd 100755 (executable)
@@ -10,6 +10,7 @@ usage() {
 INCLUDES=""
 MODULES=""
 NATIVE=0
+INTER=0
 while true; do
     case $1 in
         -I)
@@ -21,6 +22,9 @@ $2"
         -native)
             NATIVE=1
             ;;
+        -inter)
+            INTER=1
+            ;;
         [A-Z]*)
                 MODULES="$MODULES $1"
             ;;
@@ -44,7 +48,9 @@ for MODULE in $MODULES; do
     echo "$INCLUDES" | while read include; do
         base="$include/$module"
         if test -z "$include"; then continue; fi
-        if test -f "$base".ml -o -f "$base".mly -o -f "$base".mll -o -f "$base".pack; then
+        if test  \( "$INTER" = "1" \) -a \( -f "$base".mli \) ; then
+                echo -n "$base"."cmi "
+        elif test -f "$base".ml -o -f "$base".mly -o -f "$base".mll -o -f "$base".pack; then
             echo -n "$base"."$ext "
             break
         elif test -f "$base".mli; then