caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* mkdepend for caml programs
@ 1995-11-03 19:20 Robbert VanRenesse
  0 siblings, 0 replies; only message in thread
From: Robbert VanRenesse @ 1995-11-03 19:20 UTC (permalink / raw)
  To: caml-list



I wasn't aware of the existence of one, so I produced the following.
I'm not entirely sure of its correctness, but it's a start.  If
somebody knows of a better one, I'd be interested.

				Robbert

----------8<----------8<----------8<----------8<----------8<----------

#
# camldep -- produce Makefile dependencies for caml programs.
#
# Usage: camldep *.ml *.mli >> Makefile
# 

for file
do
	case $file in
	*.ml)	base=`basename $file .ml`
		obj=$base.zo
		dep="$base"
		;;
	*.mli)	base=`basename $file .mli`
		obj=$base.zi
		dep=""
		;;
	*)	echo "Unknown file type: $file" >&2
		exit 1
	esac
	echo -n $obj: $file
	dep="$dep "`sed -n -e 's/.*#open *"\([^"]*\)".*/\#\#\1/p' \
		-e 's/\([a-zA-Z][a-zA-Z0-9_]*\)__[a-zA-Z][a-zA-Z0-9_]*/\\
\##\\1\\
/gp' $file | sed -n -e "/##$base/d" -e 's/^##\(.*\)/\1/p' | sort -u`
	for i in $dep
	do
		if test -f $i.mli
		then
			echo -n " $i.zi"
		elif test -f $i.ml -a $i != $base
		then
			echo -n " $i.zo"
		fi
	done
	echo
done




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-11-07 20:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-11-03 19:20 mkdepend for caml programs Robbert VanRenesse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).