ozmake is now in beta-release - feedback is extremely welcome
see CHANGES for a list of changes between
successive versions of
ozmake OPTIONS TARGETS
ozmake is a tool for building Mozart-based projects and for creating and installing Mozart packages. It was inspired by the Unix tools make and rpm, but is much, much simpler, is specialized for Mozart-based software development and deployment, and transparently supports all platforms on which Mozart has been ported. ozmake must currently be invoked from a shell, but it will eventually acquire additionally an optional, user-friendly graphical interface.
ozmake [--build] [TARGETS...]
ozmake --install [TARGETS...]
ozmake --install [--package=PKG]
ozmake --uninstall [--package=PKG]
ozmake --create [--package=FILE]
ozmake --extract [--package=PKG]
ozmake --list [--package=MOGUL]
ozmake --config=(put|delete|list) ...
ozmake --mogul=(put|delete|list|export) ...
In the following, we write meta variables between angle brackets, e.g. <PREFIX> or <URI as cache path>
What you should remember here, is that
-vn is your friend. Add
-vn at the end of any ozmake invocation, and it will
tell you in great detail what the command would do, without actually doing
bintargets are placed
libtargets are installed
<LIBROOT>/<URI as cache path>
libtargets are installed
doctargets are installed
<DOCROOT>/<MOGUL as filename>
doctargets are installed
--extractis given a MOGUL id and downloads the corresponding package from the MOGUL archive, it will look precisely for the given <VERSION> of the package.
--installwill simply check that the package to be installed really has this <VERSION>.
ozmake [--build] FILES...
--optlevel=( none | debug | optimize )
-O3rather than just
-Oto the compiler
DIRfor include files
--nosysincludedirs) the Mozart-specific include directories located in the global installation directory and in the user's private
--nosyslibrarydirs) the Mozart-specific library directories located in the global installation directory and in the user's private
ozmake --install FILES...
ozmake --install --package=PKG
--grade=( none | same | up | down | any | freshen )
--install --grade=any --replacefiles
--install --grade=any --extendpackage
--exe=( default | yes | no | both | multi )
.exe, while on Unix they have no extension. The
--exeoption allows you to control the conventions used by ozmake when installing executables.
.exeextension and without
ozmake --uninstall --package=PKG
*~ *.ozf *.o *.so-* *.exe
ozmake --create [--package=<FILE>]
--package=<FILE>is not supplied, a default is computed using the mogul id (and possibly version number) found in the makefile.
ozmake --extract --package=<PKG>
ozmake --list --package=<MOGUL>
ozmake --config=put <OPTIONS>
ozmake --config=put --prefix=/usr/local/ozsaves
/usr/local/ozas the default value for option
ozmake --config=delete <OPT1> ... <OPTn>
ozmake --config=delete prefixremoves the default for
--prefixfrom the configuration database
the argument to
--config can be abbreviated to any non-ambiguous
If you choose to contribute packages to the MOGUL archive,
ozmake --mogul=<ACTION> simplifies your task.
It makes it easy for you to maintain a database of your contributions
and to export them so that the MOGUL librarian may automatically
find them. In fact, the simplest way is to use
ozmake --publish which will take take care of all
defails for you.
ozmake --mogul=put --package=<PKG>
ozmake --mogul=delete <MOG1> ... <MOGn>
ozmake --mogul=list <MOG1> ... <MOGn>
The data for your contributions need to be made available to the MOGUL librarian
on the WEB. You want to just update a local directory with your contributions, but,
in order for the MOGUL librarian to find them, these directories must also be available
through URLs on the WEB. Here are some options that allow you to control this
correspondance, and for which you should set default using
For those who really enjoy pain, ozmake has of course many options to shoot yourself in the foot. In the options below <ID> stands for the filename version of the package's mogul id (basically replace slashes by dashes). You can control where packages, their documentation and mogul database entries and stored and made available using the options below:
Your contributions should all have mogul ids which are below the mogul id which you where granted for your section of the mogul database. For convenience, ozmake will attempt to guess the root mogul id of your section as soon as there are entries in your database of your own contributions. However, it is much preferable to tell ozmake about it using:
and to set it using
ozmake --config=put --mogulrootid=<ROOTID>
The makefile contains a single Oz record which describes the project
and should normally be placed in a file called
makefile typically looks like this:
makefile( lib : ['Foo.ozf'] uri : 'x-ozlib://mylib' mogul : 'mogul:/denys/lib-foo')
stating explicitly that there is one library target, namely the
Foo.ozf, and that it should installed at URI:
and implicitly that it should be compiled from the Oz source file
Foo.oz. When you invoke
ozmake --install, the
mogul feature serves to uniquely identify this package and
the files it contributes in the ozmake database of
There are many more features which can occur in the makefile and
they are all optional. If you omit all the features, you only get the
defaults and you don't even need a makefile. All values, suchs as
files, should be given as virtual string; atoms are
recommended except for features
info_html, where strings are recommended.
makefile( bin : [ FILES... ] lib : [ FILES... ] doc : [ FILES... ] src : [ FILES... ] depends : o( FILE : [ FILES... ] ... ) rules : o( FILE : TOOL(FILE) ... ) clean : [ GLOB... ] veryclean : [ GLOB... ] uri : URI mogul : MOGUL author : [ AUTHORS... ] released : DATE blurb : TEXT info_text : TEXT info_html : TEXT subdirs : [ DIRS... ] requires : [ MOGUL... ] categories: [ CATEGORY... ] version : VERSION provides : [ FILES... ] )
Features bin, lib and doc list targets to be installed in
<BINDIR>, <LIBDIR> and <DOCDIR>
bin targets should be executable functors,
i.e. they should end with extension
targets are typically compiled functors i.e. ending with extension
.ozf, but could also be native functors, i.e. ending with
.so, or simply data files.
targets are documentation files.
ozmake knows how to build targets by looking at the target's extension:
Note that these are abstract targets. In particular,
Foo.so really denotes the file
Foo.so-<PLATFORM> where <PLATFORM>
identifies the architecture and operating system where the package is
built; for example:
linux-i486. Also, when a bin target
Foo.exe is installed, it is installed both as
<BINDIR>/Foo so that it can be invoked as
Foo on both Windows and Unix platforms.
It is imperative that you respect the conventional use of extensions described here: ozmake permits no variation and supports no other extensions.
ozmake has built-in rules for building files. Occasionally, you may
want to override the default rule for one or more targets. This is
done with feature
rule which contains a record mapping target to
TARGET_FILE : TOOL(SOURCE_FILE)
the rule may also have a list of options:
TARGET_FILE : TOOL(SOURCE_FILE OPTIONS)
The tools supported by ozmake are ozc (Oz compiler), ozl (Oz linker), cc (C++ compiler), ld (C++ linker). The default rules are:
'Foo.exe' : ozl('Foo.ozf' [executable]) 'Foo.ozf' : ozc('Foo.oz') 'Foo.o' : cc('Foo.cc') 'Foo.so' : ld('Foo.o')
The tools support the following options:
S. Same as -D
Son the command line
DIRis a virtual string
MACis a virtual string
DIRis a virtual string
You might want to specify a rule to create a pre-linked library:
'Utils.ozf' : ozl('Foo.ozf')
or to create a non-prelinked executable:
'Foo.exe' : ozc('Foo.oz' [executable])
ozmake automatically determines whether targets needed
to be rebuilt, e.g. because they are missing or if some source file
needed to create them has been modified. The rules are used to
determine dependencies between files. Sometimes this is insufficient
e.g. because you use tool ozl (dependencies on imports),
\insert in an Oz file, or #include in a C++
file. In this case you can specify additional dependencies using
depends which is a record mapping targets to list of
TARGET : [ FILES... ]
'Foo.o' : [ 'Foo.hh' 'Baz.hh' ]
'Foo.exe' : [ 'Lib1.ozf' 'Lib2.ozf' ]
During development, it is often convenient to be able to easily remove
all junk and compiled files to obtain again a clean project directory.
This is supported by
ozmake --clean and
ozmake --veryclean; the latter
also implies the former. Files to be removed are specified by
? matches any 1 character and
matches a sequence of 0 or more characters. All files in
BUILDDIR matching one such pattern is removed. There
are built-in patterns, but ou can override them with features
veryclean which should be lists of
glob patterns. For example the default clean glob patterns are:
clean : [ "*~" "*.ozf" "*.o" "*.so-*" "*.exe" ]
uri indicates the URI where to install lib
targets. For example:
uri : 'x-ozlib://mylib/XML'
states that all
lib targets (e.g.
be installed under this URI so that they can also be imported from it,
import MyFoo at 'x-ozlib://mylib/XML/Foo.ozf'
mogul is the mogul id uniquely identifying this
package. It is used to identify the package in the database of
installed packages, to create/publish the package, and to install its
author is a virtual string or list of virtual string
resp. identifying the author or authors of the package. It is
recommended to identify authors by their mogul id, however is is also
possible to simply give their names. For example, the recommended way
author : 'mogul:/duchier'
but the following is also possible:
author : 'Denys Duchier'
released is a virtual string specifying the date
and time of release in the following format:
released : "YYYY-MM-DD-HH:MM:SS"
time is optional. An appropriate release date using the currentdate
and time is automatically inserted when invoking
ozmake --create or
blurb contains a very short piece of text describing the
package. This text should be just one line and is intended to be used
as a title when the package is published in the mogul archive.
info_text contains a plain text description of the package.
This is intended to be used as an abstract on the presentation page
for the package in the mogul archive. It should be brief and
informative, but should not attempt to document the package.
info_html is similar to
contains HTML rather than plain text.
src indicates which targets should be considered
source, i.e. in particular non-buildable. All targets mentioned in
src should be mentioned in
doc too. The point of
src is to support
distributing packages with pre-built targets and without giving out
the corresponding sources. You should not do this with native
functors since they are platform dependent and not portable, but it
can be a convenient means of distributing prebuilt Oz libraries. For
makefile( lib : [ 'Foo.ozf' ] src : [ 'Foo.ozf' ] uri : 'x-ozlib://mylib' mogul : 'mogul:/myname/foolib')
is a makefile for a package that distribute the precompiled
Foo.ozf, but does not also distribute its source
Foo.oz. Normally, when you build a package it simply
checks that the
src files are present but will not attempt to
build them. If you have the sources, you can force building the
src targets if necessary using
subdirs is a list of bare filenames representing
subdirectories of the project. By default, when necessary,
ozmake will recurse into these subdirectories. It is
expected that each subdirectory should provide its own makefile. The
mogul id is automatically inherited to subdirectories and the uri is
automatically extended by appending the name of the subdirectory: thus
submakefiles can be simpler since they don't need to be concerned with
requires is a list of module URIs or package MOGUL ids.
These represent the external dependencies of the package. They are
not yet used, but eventually ozmake will be able to use them to
automate the recursive installation of other packages required by the one
you are interested in.
categories is a list of MOGUL categories to help
categorize this package in the MOGUL archive.
version is used to provide a version string. This
is a string that consist of integers separated by single dots, e.g.
provides is used to override the default
information about what the package provides, normally automatically
computed from the
lib targets: it should be
a list which contains a subset of these targets. The
provides feature of a makefile does not override or otherwise
affect its submakefiles: each makefile should separately override if
it so desires. To state that a makefile does not officially provide
any functors or executable application, you would add:
provides : nilYou should use the
providesfeature when your package contains both official public functors as well as purely implementational functors that are not part of the official public interface and should not be mentioned as provided by the package.
Authors should really be referred to by mogul ids denoting mogul entries
that describe them. In order to make this easier, a
may also contain a
contact feature which is either a record
describing a person, or a list of such records.
You should not have a
contact feature in every makefile. Rather,
contact feature is usually intended for makefiles that only have a
contact feature, i.e. whose only purpose is to create mogul entries
for the corresponding persons. Here is an example of such a makefile:
makefile( contact : o( mogul : 'mogul:/duchier/denys' name : 'Denys Duchier' email : 'firstname.lastname@example.org' www : 'http://www.ps.uni-sb.de/~duchier/'))
You can invoke
ozmake --publish on such a makefile to contribute
the corresponding mogul database entries