From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id A46F8BB81 for ; Tue, 27 Sep 2005 04:03:24 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j8R23NEt009980 for ; Tue, 27 Sep 2005 04:03:23 +0200 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 EAA18276 for ; Tue, 27 Sep 2005 04:03:22 +0200 (MET DST) Received: from mail.rsise.anu.edu.au (mail.rsise.anu.edu.au [150.203.208.4]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j8R23JLS025930 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 27 Sep 2005 04:03:21 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id 0D74F20B39 for ; Tue, 27 Sep 2005 12:03:16 +1000 (EST) Received: from mail.rsise.anu.edu.au ([150.203.208.4]) by localhost (mail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 24075-09 for ; Tue, 27 Sep 2005 12:03:15 +1000 (EST) Received: from pulp.rsise.anu.edu.au (pulp.rsise.anu.edu.au [150.203.208.49]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id E86DD1B33A for ; Tue, 27 Sep 2005 12:03:13 +1000 (EST) Received: by pulp.rsise.anu.edu.au (Postfix, from userid 1560) id 0AC6D25B7BA; Tue, 27 Sep 2005 12:03:08 +1000 (EST) Date: Tue, 27 Sep 2005 12:03:08 +1000 From: Pietro Abate To: ocaml ml Subject: ocamlmake problem Message-ID: <20050927020308.GA9665@pulp.anu.edu.au> Mail-Followup-To: Pietro Abate , ocaml ml Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline X-Operating-System: GNU/Linux X-Organization: Research School of Information Science and Engineering (Australian National University) User-Agent: Mutt/1.5.10i X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at mail.rsise.anu.edu.au X-j-chkmail-Score: MSGID : 4338A86B.000 on concorde : j-chkmail score : X : 0/20 1 X-j-chkmail-Score: MSGID : 4338A867.000 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at concorde with ID 4338A86B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4338A867.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; anu:01 re-use:01 dynlink:01 byte-code:01 dynlink:01 anu:01 cmo:01 endline:01 endline:01 usr:01 ocaml-tools:01 cmi:01 cmo:01 cmi:01 -dnative:01 X-Attachments: name="c4ex.ml" name="ex1.ml" name="ex2.ml" name="Makefile" X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi all, I'm trying to use ocmalmake + camlp4 to re-use the same code with dynlink in byte-code or without dynlink in native code. Do to this I'm using pa_macro to remove dynlink part of the code. Now I'm trying to glue everything together with ocamlmake. Attached there is a small example. Basically the problem is that if I use the SUBPROJS pragma, the PRE_TARGETS are ignored. How can I do this ? :) p -- ++ Blog: http://blog.rsise.anu.edu.au/?q=pietro ++ ++ "All great truths begin as blasphemies." -George Bernard Shaw ++ Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="c4ex.ml" (*pp camlp4o pa_macro.cmo *) IFNDEF NATIVE THEN open Dynlink ENDIF --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ex1.ml" print_endline "ex1!!!" --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ex2.ml" print_endline "ex2!!!" --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=Makefile # Set OCamlMakefile to use export OCAMLMAKEFILE = /usr/share/ocaml-tools/OCamlMakefile # Define project "ex1" # this project should be compiled in bc define PROJ_ex1 USE_CAMLP4 := yes PRE_TARGETS := c4ex.cmi c4ex.cmo SOURCES = ex1.ml RESULT = ex1 PACKS := dynlink unix endef export PROJ_ex1 # Define project "ex2" # this subprojet should use NATIVE and remove # dynlink functions define PROJ_ex2 USE_CAMLP4 := yes PRE_TARGETS := c4ex.cmi c4ex.cmo SOURCES = ex2.ml RESULT = ex2 PACKS := unix PPFLAGS := -DNATIVE endef export PROJ_ex2 # by default I want to compile the bc ifndef SUBPROJS export SUBPROJS = ex1 endif # Default target to use all: bc # Catch-all target will be applied to all subprojects automatically %: @$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=$@ --UugvWAfsgieZRqgk--