caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Robbert VanRenesse <rvr@cs.cornell.edu>
To: caml-list@pauillac.inria.fr
Subject: mkdepend for caml programs
Date: Fri, 3 Nov 1995 14:20:29 -0500	[thread overview]
Message-ID: <199511031920.OAA01257@gungnir.cs.cornell.edu> (raw)



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




                 reply	other threads:[~1995-11-07 20:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199511031920.OAA01257@gungnir.cs.cornell.edu \
    --to=rvr@cs.cornell.edu \
    --cc=caml-list@pauillac.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).