caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Ocamldep too "gentle".
@ 2003-12-02 16:26 David Brown
  2003-12-02 16:42 ` Nicolas George
  2003-12-02 17:48 ` Remi Vanicat
  0 siblings, 2 replies; 6+ messages in thread
From: David Brown @ 2003-12-02 16:26 UTC (permalink / raw)
  To: Caml List

I'm having a problem with ocamldep being too "gentle".  I have a file
units.ml that is generated with extract_crc.  The problem is that
ocamldep gets run at the beginning of the make, when units.ml doesn't
yet exist.  ocamldep doesn't output the dependency on units.cmo and
units.cmx because it can't find the source file.

I know that ocamldep doesn't have any way of knowing which directory the
dependency is to be located in, so I'm really just looking for
suggestions.

Dave

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Ocamldep too "gentle".
  2003-12-02 16:26 [Caml-list] Ocamldep too "gentle" David Brown
@ 2003-12-02 16:42 ` Nicolas George
  2003-12-02 16:53   ` samsaga2
  2003-12-02 17:48 ` Remi Vanicat
  1 sibling, 1 reply; 6+ messages in thread
From: Nicolas George @ 2003-12-02 16:42 UTC (permalink / raw)
  To: David Brown; +Cc: Caml mailing list

[-- Attachment #1: Type: text/plain, Size: 280 bytes --]

Le duodi 12 frimaire, an CCXII, David Brown a écrit :
> I know that ocamldep doesn't have any way of knowing which directory the
> dependency is to be located in, so I'm really just looking for
> suggestions.

What about: write the dependencies of units.ml in the makefile?

[-- Attachment #2: Type: application/pgp-signature, Size: 185 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Ocamldep too "gentle".
  2003-12-02 16:42 ` Nicolas George
@ 2003-12-02 16:53   ` samsaga2
  2003-12-02 16:59     ` Nicolas George
  0 siblings, 1 reply; 6+ messages in thread
From: samsaga2 @ 2003-12-02 16:53 UTC (permalink / raw)
  To: Caml mailing list

[-- Attachment #1: Type: text/plain, Size: 392 bytes --]

Or you can try create an empty units.ml before calculate dependency

Nicolas George wrote:

>Le duodi 12 frimaire, an CCXII, David Brown a écrit :
>  
>
>>I know that ocamldep doesn't have any way of knowing which directory the
>>dependency is to be located in, so I'm really just looking for
>>suggestions.
>>    
>>
>
>What about: write the dependencies of units.ml in the makefile?
>  
>


[-- Attachment #2: Type: text/html, Size: 802 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Ocamldep too "gentle".
  2003-12-02 16:53   ` samsaga2
@ 2003-12-02 16:59     ` Nicolas George
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas George @ 2003-12-02 16:59 UTC (permalink / raw)
  To: samsaga2

[-- Attachment #1: Type: text/plain, Size: 236 bytes --]

Le duodi 12 frimaire, an CCXII, samsaga2 a écrit :
> Content-Type: multipart/alternative;

:-(

> Or you can try create an empty units.ml before calculate dependency

This would lead to wrong dependencies if they are not empty.

[-- Attachment #2: Type: application/pgp-signature, Size: 185 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Ocamldep too "gentle".
  2003-12-02 16:26 [Caml-list] Ocamldep too "gentle" David Brown
  2003-12-02 16:42 ` Nicolas George
@ 2003-12-02 17:48 ` Remi Vanicat
  2003-12-02 17:57   ` Damien
  1 sibling, 1 reply; 6+ messages in thread
From: Remi Vanicat @ 2003-12-02 17:48 UTC (permalink / raw)
  To: caml-list

David Brown <caml-list@davidb.org> writes:

> I'm having a problem with ocamldep being too "gentle".  I have a file
> units.ml that is generated with extract_crc.  The problem is that
> ocamldep gets run at the beginning of the make, when units.ml doesn't
> yet exist.  ocamldep doesn't output the dependency on units.cmo and
> units.cmx because it can't find the source file.

The solution is to generate units.ml before generating the
dependency.... 

You could try to look at what the OcamlMakefile do for ocamllex and
ocamlyacc generated ml file.

-- 
Rémi Vanicat

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Ocamldep too "gentle".
  2003-12-02 17:48 ` Remi Vanicat
@ 2003-12-02 17:57   ` Damien
  0 siblings, 0 replies; 6+ messages in thread
From: Damien @ 2003-12-02 17:57 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 574 bytes --]

On Tue, 02 Dec 2003 18:48:18 +0100 Remi Vanicat wrote:

> You could try to look at what the OcamlMakefile do for ocamllex and
> ocamlyacc generated ml file.

I had the same problem with packages (-pack), 
but since there is no source file at all, one cannot do something like
what does OCamlMakefile.

Currently, I do "touch toto.ml; ocamldep ...; rm toto.ml"

but I've also written the attached small patch to ocamldep, 
which add an option "-f <file>", allowing the user to force some
dependencies to be generated even if there is no .ml[i] file.


Hope this help,
damien

[-- Attachment #2: ocamldep.diff --]
[-- Type: text/plain, Size: 765 bytes --]

26a27
> let additional_dependencies = ref ([] : string list)
41a43,48
> let add_to_dependencies file = 
>   additional_dependencies := file :: !additional_dependencies
> 
> let dependency_exists file = 
>   List.mem file !additional_dependencies || Sys.file_exists file
> 
55c62,64
<   find_in_path !load_path
---
>     if      List.mem name  !additional_dependencies then name
>     else if List.mem uname !additional_dependencies then uname
>     else    find_in_path !load_path
212c221
< let usage = "Usage: ocamldep [-I <dir>] [-native] <files>"
---
> let usage = "Usage: ocamldep [-I <dir>] [-f <file>] [-native] <files>"
219a229,230
>      "-f", Arg.String add_to_dependencies,
>        "<file> Generate dependencies against <file> even if it doesn't exist";

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-12-02 17:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-02 16:26 [Caml-list] Ocamldep too "gentle" David Brown
2003-12-02 16:42 ` Nicolas George
2003-12-02 16:53   ` samsaga2
2003-12-02 16:59     ` Nicolas George
2003-12-02 17:48 ` Remi Vanicat
2003-12-02 17:57   ` Damien

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).