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 B8D85BB81 for ; Wed, 28 Sep 2005 03:03:29 +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 j8S13SlF027668 for ; Wed, 28 Sep 2005 03:03:28 +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 DAA06871 for ; Wed, 28 Sep 2005 03:03:27 +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 j8S13Nd2019008 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 28 Sep 2005 03:03:26 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id 3A4C920C29 for ; Wed, 28 Sep 2005 11: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 23171-08 for ; Wed, 28 Sep 2005 11:03:16 +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 1427420C1D for ; Wed, 28 Sep 2005 11:03:15 +1000 (EST) Received: by pulp.rsise.anu.edu.au (Postfix, from userid 1560) id 13D9925B792; Wed, 28 Sep 2005 11:03:10 +1000 (EST) Date: Wed, 28 Sep 2005 11:03:10 +1000 From: Pietro Abate To: ocaml ml Subject: Re: [Caml-list] ocamlmake problem Message-ID: <20050928010310.GA25159@pulp.anu.edu.au> Mail-Followup-To: Pietro Abate , ocaml ml References: <20050927020308.GA9665@pulp.anu.edu.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Qxx1br4bt0+wmkIi" Content-Disposition: inline In-Reply-To: <20050927020308.GA9665@pulp.anu.edu.au> 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 : 4339EBE0.000 on concorde : j-chkmail score : X : 0/20 1 X-j-chkmail-Score: MSGID : 4339EBDB.000 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at concorde with ID 4339EBE0.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4339EBDB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; anu:01 caml-list: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 X-Attachments: 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 --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I know, I know... tried harder, try in the morning... attached the answer to my question... I suppose there is a better way of doing it... :) pp On Tue, Sep 27, 2005 at 12:03:08PM +1000, Pietro Abate wrote: > 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 > (*pp camlp4o pa_macro.cmo *) > > IFNDEF NATIVE THEN open Dynlink ENDIF > > > print_endline "ex1!!!" > > print_endline "ex2!!!" > # 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=$@ > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs -- ++ 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 --Qxx1br4bt0+wmkIi 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 SOURCES = ex1.ml c4ex.ml RESULT = ex1 export 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 PPFLAGS = -DNATIVE SOURCES = ex2.ml c4ex.ml RESULT = ex2 export PACKS = unix endef export PROJ_ex2 #ifndef SUBPROJS #export SUBPROJS = ex2 clean ex1 #endif # Default target to use #all: bc ex1: @$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=bc SUBPROJS=ex1 ex2: @$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=nc SUBPROJS=ex2 clean: @$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=clean SUBPROJS="ex1 ex2" # Catch-all target will be applied to all subprojects automatically #%: # @$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=$@ --Qxx1br4bt0+wmkIi--