From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA20415; Tue, 19 Oct 2004 14:49:53 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA20578 for ; Tue, 19 Oct 2004 14:49:52 +0200 (MET DST) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.202]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i9JCnpNZ015056 for ; Tue, 19 Oct 2004 14:49:52 +0200 Received: by mproxy.gmail.com with SMTP id 79so287600rnk for ; Tue, 19 Oct 2004 05:49:51 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=t5sTwcXcaUYWSS8tdSvhZ7Yc7SFGHHBnmPZSY3p7sODxcGndEUx6FWM7FVZF3kzukKslLYlNZWPLGTCZ9+fCq9X58okmJRrdXLV1oYhtD8cAh6cvJWwvYGTyNy2XgOWZ0HncM/9RfH5iWEYd15gbL/tRfkTw743toz6yfFylJzk Received: by 10.38.78.37 with SMTP id a37mr2153154rnb; Tue, 19 Oct 2004 05:49:51 -0700 (PDT) Received: by 10.38.75.19 with HTTP; Tue, 19 Oct 2004 05:49:51 -0700 (PDT) Message-ID: <7f8e92aa041019054919917bef@mail.gmail.com> Date: Tue, 19 Oct 2004 15:49:51 +0300 From: Radu Grigore Reply-To: Radu Grigore To: caml-list Subject: [Caml-list] make Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41750D6F.003 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; faq:01 caml-list:01 ocamake:01 overwrite:01 ocamldep:01 dependencies:01 ocamldep:01 cmx:01 cmx:01 'standard':01 ocamlc:01 ocamlc:01 cmo:01 cmo:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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