caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Guillaume Rousse <Guillaume.Rousse@inria.fr>
To: autoconf@gnu.org, caml-list@yquem.inria.fr
Subject: managing ocaml dependencies
Date: Thu, 16 Nov 2006 15:20:42 +0100	[thread overview]
Message-ID: <455C73BA.1030803@inria.fr> (raw)

I'm trying to use autoconf for ocaml project, and I have troubles with
managing dependencies.

They are generated through a specific program, ocamldep, that basically
output makefile rules, so as to be used this way:
.depend:
	$(OCAMLDEP) *.ml *.mli > .depend

include .depend

They are two different strategies here, either generate them on
maintainer host and ship them in the distribution, either generate them
on user's host.

The first seems safe, excepted when you have conditional build options:
if the user has not the same setup as the maintainer host, there might
be inconsistencies. I also saw some comments in autotools description
than this strategy was also considered insecure for other languages.

The second strategy, however, heavily relies on make implementation.
Whereas GNU make happily generate .depend file on the fly with previous
snippet, some other implementations don't, such as Digital Unix's one
(and potentially others).
Make: Cannot open ../.depend.  Stop.

I also discovered than GNU make use current directory to resolve path of
included files, even when the inclusion directive is found in an
included makefile, whereas Digital Unix's one consider the directory
containing the makefile containing the inclusion directive instead.

Given the following setup:
|-- Makefile.rules
`-- a
    `-- Makefile

If the inclusion directive is given in top level Makefile.rules, itself
included in lower level a/Makefile, GNU make resolve the .depend file in
a directory, whereas Digital Unix resolve it in top-level directory.

Finally, it seems the safest strategy would be to use configure to
produce those .depend file, or is there any other possibility ?


             reply	other threads:[~2006-11-16 14:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-16 14:20 Guillaume Rousse [this message]
2006-11-16 16:47 ` [Caml-list] " skaller
2006-11-16 19:01   ` Jean-Christophe Filliatre
2006-11-16 21:43   ` Nicolas Pouillard
2006-11-17  0:36     ` skaller
2006-11-16 21:21 ` Ralf Wildenhues

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=455C73BA.1030803@inria.fr \
    --to=guillaume.rousse@inria.fr \
    --cc=autoconf@gnu.org \
    --cc=caml-list@yquem.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).