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