caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* pb with ocamldep
@ 2000-06-07 14:21 Christophe Raffalli
  2000-06-07 18:48 ` Michael Hicks
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Christophe Raffalli @ 2000-06-07 14:21 UTC (permalink / raw)
  To: caml-list


It would be nice ocamldep coud also accept the -pp option to call a
preprocessor.

I have some problems with files that are not syntacticaly correct before
preprocessing !
So I can not use ocamldep on these files and this is annoying.

-- 
Christophe Raffalli
Université de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex

tél: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42
mail: Christophe.Raffalli@univ-savoie.fr
www: http://www.lama.univ-savoie.fr/~RAFFALLI




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

* Re: pb with ocamldep
  2000-06-07 14:21 pb with ocamldep Christophe Raffalli
@ 2000-06-07 18:48 ` Michael Hicks
  2000-06-07 22:24 ` Max Skaller
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Michael Hicks @ 2000-06-07 18:48 UTC (permalink / raw)
  To: Christophe Raffalli; +Cc: caml-list


> It would be nice ocamldep coud also accept the -pp option to call a
> preprocessor.
> 
> I have some problems with files that are not syntacticaly correct before
> preprocessing !
> So I can not use ocamldep on these files and this is annoying.

I had the same problem with our active networking software, in which we use
the camlp4 ifdef syntax.  Therefore, to do dependency generation, we use
camlp4 with pr_depend (provided with the distribution), e.g.:

camlp4 pa_ifdef.cmo pr_depend.cmo -- $(INCLUDES) $(IFDEF_FLAGS) file1 file2
  ...

If you aren't using camlp4 for your preprocessor, then your suggestion above
would be more appropriate.

Mike

-- 
Michael Hicks
Ph.D. Candidate, the University of Pennsylvania
http://www.cis.upenn.edu/~mwh            mailto://mwh@dsl.cis.upenn.edu
"In essential things, unity; in doubtful things, liberty; in all things, 
 charity."




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

* Re: pb with ocamldep
  2000-06-07 14:21 pb with ocamldep Christophe Raffalli
  2000-06-07 18:48 ` Michael Hicks
@ 2000-06-07 22:24 ` Max Skaller
  2000-06-08  8:57 ` Sven LUTHER
  2000-06-08 13:01 ` Daniel de Rauglaudre
  3 siblings, 0 replies; 7+ messages in thread
From: Max Skaller @ 2000-06-07 22:24 UTC (permalink / raw)
  Cc: caml-list

Christophe Raffalli wrote:
> 
> It would be nice ocamldep coud also accept the -pp option to call a
> preprocessor.
> 
> I have some problems with files that are not syntacticaly correct before
> preprocessing !
> So I can not use ocamldep on these files and this is annoying.

FYI: the lack of a standard preprocessor is a minor obstacle to
commercial use.  By 'standard' I mean "supplied with the
main distribution" and the implication is for ease of
configuration, and integration with other tools.

As it happens, the lack of a preprocessor doesn't concern _me_,
since I use a powerful literate programming tool as a code
generator; however, ocamlyacc is annoying, since it isn't so
easy to generate #line directives (and it isn't clear these would
be respected in the generated code). This is mandatory for
use with any code generator (including my LP tool).

-- 
John (Max) Skaller at OTT [Open Telecommications Ltd]
mailto:maxs@in.ot.com.au      -- at work
mailto:skaller@maxtal.com.au  -- at home




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

* Re: pb with ocamldep
  2000-06-07 14:21 pb with ocamldep Christophe Raffalli
  2000-06-07 18:48 ` Michael Hicks
  2000-06-07 22:24 ` Max Skaller
@ 2000-06-08  8:57 ` Sven LUTHER
  2000-06-08 12:01   ` Christophe Raffalli
  2000-06-08 13:01 ` Daniel de Rauglaudre
  3 siblings, 1 reply; 7+ messages in thread
From: Sven LUTHER @ 2000-06-08  8:57 UTC (permalink / raw)
  To: Christophe Raffalli; +Cc: caml-list

On Wed, Jun 07, 2000 at 04:21:08PM +0200, Christophe Raffalli wrote:
> 
> It would be nice ocamldep coud also accept the -pp option to call a
> preprocessor.
> 
> I have some problems with files that are not syntacticaly correct before
> preprocessing !
> So I can not use ocamldep on these files and this is annoying.

What about piping them through the preprocessor before handling them over to
ocamldep, in true unixish tradition ?

Something like (surely not exact, but you will understand the thought) :

ls *.ml* | cpp <options> | ocamldep >>.depend

Friendly,

Sven LUTHER




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

* Re: pb with ocamldep
  2000-06-08  8:57 ` Sven LUTHER
@ 2000-06-08 12:01   ` Christophe Raffalli
  0 siblings, 0 replies; 7+ messages in thread
From: Christophe Raffalli @ 2000-06-08 12:01 UTC (permalink / raw)
  To: caml-list

Sven LUTHER a écrit :

> What about piping them through the preprocessor before handling them over to
> ocamldep, in true unixish tradition ?
> 
> Something like (surely not exact, but you will understand the thought) :
> 
> ls *.ml* | cpp <options> | ocamldep >>.depend

ocamldep doest not read its standard input because it needs the
filename.

I did somthing similar by runing the preprocessor on all files and
writing the result in a temporary folder ... It is not nice.

Michael Hicks  a écrit :
> camlp4 pa_ifdef.cmo pr_depend.cmo -- $(INCLUDES) $(IFDEF_FLAGS) file1 file2

I do not want to ask my user to install yet another tool (normally it is
not a problem as
I distribute my software with the depend file included).


-- 
Christophe Raffalli
Université de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex

tél: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42
mail: Christophe.Raffalli@univ-savoie.fr
www: http://www.lama.univ-savoie.fr/~RAFFALLI




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

* Re: pb with ocamldep
  2000-06-07 14:21 pb with ocamldep Christophe Raffalli
                   ` (2 preceding siblings ...)
  2000-06-08  8:57 ` Sven LUTHER
@ 2000-06-08 13:01 ` Daniel de Rauglaudre
  3 siblings, 0 replies; 7+ messages in thread
From: Daniel de Rauglaudre @ 2000-06-08 13:01 UTC (permalink / raw)
  To: Christophe Raffalli; +Cc: caml-list

Hello,

On Wed, Jun 07, 2000 at 04:21:08PM +0200, Christophe Raffalli wrote:
> 
> It would be nice ocamldep coud also accept the -pp option to call a
> preprocessor.

If preprocessed by Camlp4, you can use:
      camlp4o pr_depend.cmo foo.ml

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/




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

* Re: pb with ocamldep
@ 2000-06-08 10:25 Gerard Huet
  0 siblings, 0 replies; 7+ messages in thread
From: Gerard Huet @ 2000-06-08 10:25 UTC (permalink / raw)
  To: Christophe Raffalli; +Cc: caml-list

At 16:21 07/06/00 +0200, Christophe Raffalli wrote:
>
>It would be nice ocamldep coud also accept the -pp option to call a
>preprocessor.
>
>I have some problems with files that are not syntacticaly correct before
>preprocessing !
>So I can not use ocamldep on these files and this is annoying.
>
>-- 
>Christophe Raffalli

This is an instance of a general problem, the design of a programming
environment for the Caml family of languages with the various tools 
operating on abstract syntax rather than concrete syntax, so that they can
be used for all dialects through proper preprocessing. If you use an Emacs
editing support tool such as Tuareg you will have problems if you try to
adopt non-archaic syntax. 

For ocamldep the problem may be circumvented by some magic "pr_depend"
module written by Daniel for use with camlp4. Here is my own Makefile
depend entry, which should be adaptable to other syntax variants :

depend: $(SOURCES) 
	> .depend.new
	for i in $(SOURCES); do \
	camlp4r my_own_syntax_extension.cmo pr_depend.cmo -- -I . $$i >>
.depend.new ; \
	done
	mv .depend.new .depend

Gérard





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

end of thread, other threads:[~2000-06-09 16:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-07 14:21 pb with ocamldep Christophe Raffalli
2000-06-07 18:48 ` Michael Hicks
2000-06-07 22:24 ` Max Skaller
2000-06-08  8:57 ` Sven LUTHER
2000-06-08 12:01   ` Christophe Raffalli
2000-06-08 13:01 ` Daniel de Rauglaudre
2000-06-08 10:25 Gerard Huet

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