Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] make
@ 2004-10-19 12:49 Radu Grigore
  2004-10-19 13:02 ` Nicolas Cannasse
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Radu Grigore @ 2004-10-19 12:49 UTC (permalink / raw)
  To: caml-list

I have a problem with writing makefiles for OCaml and with compilation
order. Probably a FAQ.

Searching the caml-list archives I've found info about a tool by
Nicolas Cannesse (ocamake) that can be used to compile a set of ml
files into an executable or to generate a makefile such that a
subsequent make command will construct the executable. However this is
not quite what I want.

Using a makefile has the advantage that only necessary recompilations
are performed. So I want to use a makefile. If I add a source (ml)
file in the project directory then the generated makefile becomes
obsolete and needs to be regenerated. But... a regeneration might
overwrite any subsequent changes I've done.

What I'd love is an enhanced ocamldep that in addition to the
dependencies prints also a topologically sorted list of files, like
this:

---
$ocamldep main.ml parser.ml ast.ml lexer.ml
main.cmo: lexer.cmo parser.cmo
main.cmx: lexer.cmx parser.cmx
parser.cmo: ast.cmo
parser.cmx: ast.cmx
lexer.cmo: parser.cmo
lexer.cmx: parser.cmx
CMO_FILES=ast.cmo parser.cmo lexer.cmo main.cmo
CMX_FILES=ast.cmx parser.cmx lexer.cmx main.cmx
---

This way I would be able to write a kind of 'standard' makefile:

---
include .depend
all: $(CMO_FILES)
   ocamlc -o my_app $(CMO_FILES)

depend:
  ocamldep *.ml > .depend

%.cmo: %.ml
   ocamlc -c $<
---

Does such a tool exists? Does ocamldep already knows to do this and I
didn't found it in the docs? Thanks.

-- 
regards,
 radu
http://rgrig.idilis.ro/

-------------------
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] 12+ messages in thread

end of thread, other threads:[~2004-10-22 18:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-19 12:49 [Caml-list] make Radu Grigore
2004-10-19 13:02 ` Nicolas Cannasse
2004-10-20  0:28   ` skaller
2004-10-19 13:16 ` Julien Signoles
2004-10-19 13:35   ` Radu Grigore
2004-10-19 19:12     ` noweb/nuweb (was: Re: [Caml-list] make) David MENTRE
2004-10-20  5:08       ` Radu Grigore
2004-10-21 11:12   ` [Caml-list] ocamldsort and directories Richard Jones
2004-10-22 18:04     ` Dimitri Ara
2004-10-19 14:48 ` [Caml-list] make Eric C. Cooper
2004-10-19 23:23   ` skaller
2004-10-21  2:41 ` Aleksey Nogin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox