projects
/
tatoo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Further simplify Remakefile. Remove some inefficiency in module dependency checking...
[tatoo.git]
/
tools
/
ocamlmoduledep.sh
diff --git
a/tools/ocamlmoduledep.sh
b/tools/ocamlmoduledep.sh
index
a9f2ee9
..
2833671
100755
(executable)
--- a/
tools/ocamlmoduledep.sh
+++ b/
tools/ocamlmoduledep.sh
@@
-11,10
+11,11
@@
INCLUDES=""
MODULES=""
NATIVE=0
INTER=0
MODULES=""
NATIVE=0
INTER=0
+OCAMLWHERE=$(ocamlc -where)
while true; do
case $1 in
-I)
while true; do
case $1 in
-I)
- dir=`echo "$2" | sed "s:^+:$
(ocamlc -where)
/:"`
+ dir=`echo "$2" | sed "s:^+:$
{OCAMLWHERE}
/:"`
INCLUDES="$INCLUDES
$dir"
shift
INCLUDES="$INCLUDES
$dir"
shift
@@
-43,22
+44,23
@@
else
ext=cmo
fi
ext=cmo
fi
+
for MODULE in $MODULES; do
for MODULE in $MODULES; do
- module="$(echo $
MODULE | cut -b1 | tr A-Z a-z)$(echo $MODULE | cut -b2-
)"
+ module="$(echo $
{MODULE} | sed -e 's:\(.*\):\l\1:'
)"
echo "$INCLUDES" | while read include; do
if test -z "$include"; then continue; fi
echo "$INCLUDES" | while read include; do
if test -z "$include"; then continue; fi
- base="$
include/$module
"
+ base="$
{include}/${module}
"
if test \( "$INTER" = "1" \) -a \( -f "$base".mli \) ; then
## if we want to depend only on cmi of a module
if test \( "$INTER" = "1" \) -a \( -f "$base".mli \) ; then
## if we want to depend only on cmi of a module
-
echo -n "$base
"."cmi "
- elif test -f "$base".ml -o -f "$base".mly -o -f "$base".mll -o -f "$base".pack; then
+
/bin/echo -n "${base}
"."cmi "
+ elif test -f "$base".ml -o -f "$base".mly -o -f "$base".mll -o -f "$base".pack
-o -f "$base".ml.str
; then
## else we depend on the implementation
## else we depend on the implementation
-
echo -n "$base"."$ext
"
+
/bin/echo -n "${base}"."${ext}
"
break
break
- elif test -f "$
base
".mli; then
+ elif test -f "$
{base}
".mli; then
## and fall back on depending on the cmi if the cmx is not available
## (which prevents cross-module inlining in the case of cmx)
## and fall back on depending on the cmi if the cmx is not available
## (which prevents cross-module inlining in the case of cmx)
-
echo -n "$base
"."cmi "
+
/bin/echo -n "${base}
"."cmi "
break
fi
done
break
fi
done