English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] [ANNOUNCE] Development versions: ocamlconf, ASPCC
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-03-11 (11:09)
From: Markus Mottl <markus@o...>
Subject: Re: [Caml-list] [ANNOUNCE] Development versions: ocamlconf, ASPCC
On Tue, 02 Mar 2004, Kenneth Knowles wrote:
> *	OcamlMakefile is awkward with multiple targets (such as suites
>	of utilities) and I'd rather write (or depend on) a simple ocaml
>	script than a complex Makefile

I have taken this criticism as motivation to make OCamlMakefile more
useful with subprojects (i.e. multiple targets).  The newest release is
now available and should make this task much simpler.

Here is an example from the distribution on how to specify two

# Set OCamlMakefile to use
export OCAMLMAKEFILE = ../OCamlMakefile

# Export some common variable settings
export THREADS = yes

# Define project "ex1"
export PROJ_ex1 = \
  SOURCES=ex1.ml \

# Define project "ex2"
export PROJ_ex2 = \
  SOURCES=ex2.ml \

# If the environment does not define subprojects to handle,
# then use "ex1 ex2" as default
ifndef SUBPRJS
  export SUBPRJS = ex1 ex2

# Default target to use
all:    bc

# Catch-all target will be applied to all subprojects automatically
        @make -f $(OCAMLMAKEFILE) subprjs SUBTARGET=$@

You can use the usual shortcuts like "make nc" (= build native code),
etc., for compiling several subprojects at once.  Setting/exporting
variable "SUBPRJS" in the shell environment or passing it to "make"
on the command line allows you to refer to any subset of your projects
that should be affected by the next command.  I think this is as easy
as things can get - but feel free to send me suggestions for improvement!


Markus Mottl          http://www.oefai.at/~markus          markus@oefai.at

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