How to use the FoCaLiZe Makefile
Cleaning
One target clean.
- clean: applied from the
"toplevel" directory focalize,
cleans the tools, i.e. zenon,
zvtov, focalizeXXX executables, libraries
and contributions.
When applied from a subdirectory (focalize/zenon,
focalize/zvtov, focalize/focalizec, focalize/focalizec/src/stdlib
...), cleans the corresponding source files tree.
Making
From the the "toplevel" directory focalize, one targets "all"
(got via make
). The Makefile
is in charge of running the configuration script, build and install for
all the components of the FoCaLiZe package, i.e. zenon, zvtov and focalizec, including
documentation.
The internals of configuration
Before the building phase can really start, each component of the
FoCaLiZe package are configured, in addition to a "toplevel", general
configuration. Configurations are performed by invocation of a configure
in each relevant directory (i.e. focalize
then zenon then zvtov and finally focalizec).
Two builtin and hand-written configuration files exist: Makefile.rules and Makefile.utils that are
included in the Makefile.common
file. This latter also includes the "toplevel" .config_var and is the common
primitive configuration to include in further Makefiles. The file Makefile.rules contains the
default rules make must
apply to build targets from prerequisites. The file Makefile.utils contains the basic commands (cd, make, latex
...) used during the building phase. This latter should not be often
modified since these commands are either available and have a
well-established name, or simply not available.
The configure
shell scripts perform various validity
checks, commands searches then record all the configuration variables
into files nammed .config_var
.
- From the "toplevel" directory focalize, variables defining
the various OCaml and Coq commands are set. Generated file: focalize/.config_var.
- From the zenon
directory, variables defining here to install zenon binaries and libraries
are set. Since zenon
requires a hash-like command, a variable SUM is set according to what is
available on the system (sum,
md5, md5sum ...). Generated file: zenon/.config_var.
- From the zvtov
directory, variables defining here to install zvtov binaries and man pages are set. Generated
file: zvtov/.config_var.
- From the focalizec
directory, variables are set to state:
- where to find the OCaml,
Coq, zenon, zvtov that will be invoked by focalizec, i.e. by the built compiler.
- where to install focalizec and its accompanying commands.
- wether the installed Coq
version is < 8.3pl2, in which case the building phase must invoke focalizec with the -coq_older option (idem
later for the user when he will compile its own developments).
- => Generated files: focalizec/.config_var
and focalizec/.install_var.
Configure options
Each configure behaves by
default (i.e. if invoked without option) without asking questions,
guessing and setting things according what it finds and assumes
(commands present in the paths, default installation directories).
To control the configure
scripts if you have a non-standard installation of OCaml or Coq, if you
want to use a special version of zenon
or zvtov or if you want
to install FoCaLiZe in another directory, you must invoke the configure
scripts with some
of the following options:
- focalize/configure:
- [-]-interactive: run interactively, asking questions.
- [-]-tools_prefix <directory>: set
<directory> as the directory prefix where tools required to build
FoCaLiZe are installed. The currently required non-common tools are
OCaml and Coq.
- focalize/zenon/configure:
- [-]-interactive: run interactively, asking questions.
- [-]-install_prefix <directory>: set <directory>
as the directory prefix for installation of the FoCaLize commands.
(Default value for <directory> is /usr/local).
- focalize/zvtov/configure:
Same than for focalize/zenon/configure.
- focalize/focalizec/configure:
- [-]-interactive: run interactively, asking questions.
- [-]-install_prefix <directory>: set <directory>
as the directory prefix for installation of the FoCaLize commands.
(Default value for <directory> is /usr/local).
- [-]-tools_prefix <directory>: set <directory> as
the directory prefix where tools required to build FoCaLiZe are
installed. The currently required tools (other than OCaml and Coq
already configured) are zenon, zvtov.
Warnings and error: by default,
the "toplevel" configure
generates a variable WARN_ERROR
set to a.
This variable controls the amount if warnings considered as errors when
compiling OCaml code. It is set by default to "no warnings are error" (i.e. a)
to ensure that when building by default, as a user, the FoCaLiZe stuff,
compilation won't fail due to errors. As a developper, if you're
interesting in cleaning your code, you may manually edit the "toplevel"
focalizec/.config_var and
change the value of this variable to A.
This way, all warnings will be considered as errors. On the long term,
warnings should disapear by code cleaning (at least really harmful
warnings).
The building phase
The building phase must compile the FoCaLiZe compiler
(focalizec
) and its associated dependency compiler
(focalizedep
). To achieve this goal, we MUST have the
suitable zenon and
zvtov
in order to compile and certify the FoCaLiZe
libraries.
So, the necessary building sequence is as follows:
- compile and install zenon
that searches automatically for proofs from explicit clues given in the
proof language:
- ./configure:
configuration.
- make depend: compute
dependencies for zenon sources.
- make all: build
binaries and libraries.
- make doc: build the doc.
- make install: install everything.
- compile and install zvtov
that generates the proofs for the preceding Coq compiler:
- ./configure:
configuration
- make depend: compute
dependencies for zvtov sources.
- make all: build
binaries and libraries.
- make doc: build the
doc.
- make install:
install everything.
- compile and install focalizec
that will call all the tools when needed (both at run-time and at build
time):
- ./configure:
configuration.
- make depend: compute
dependencies for the compiler sources.
- make world: build
build binaries and libraries. More detailled:
- make byt bin:
really build the binaries (bytecode and native versions).
- make lib-depend:
now that focalizedep is built by the previous stage, compute
dependencies in the FoCaLize
and OCaml sources of the
library.
- make lib: now
that the dependencies are computed, build the stdlib, extlib and the
contribs.
- make doc: build the
doc (reference manual and tutorial).
- make install:
install everything.
How to get the current branch for FoCaLiZe
# Go to the FoCaLiZe sources directory
cd ~/src/focalize
# Create a distribution sub directory to check out the distribution branch.
mkdir distribution
cd distribution
# Checkout a fresh distribution branch.
# (Change the name "myname" by your own login name on our CVS server
# modulogic.inria.fr)
cvs -d myname@modulogic.inria.fr:/home/cvs \
co focalize
# Configure the FoCaLiZe, compile and install it
cd focalize
make
How to add a new directory to the FoCaLiZe hierarchy
Compilation from the focalize/focalizec
directory is automatic in FoCaLiZe. The Makefile in this directory
contains lists of
sub-directories that are visited to perform the necessary tasks.
COMPILER_DIRS describes
directories involved in the compiler itself.
LIB_DIRS describes
directories involved the libraries.
DOC_DIRS describes
directories involved the documentation.
ALL_DIRS is the union of
all the previous.
#!/bin/sh
#**********************************************************************#
# #
# FoCaLiZe compiler #
...
ROOT_DIR=..
include $(ROOT_DIR)/Makefile.common
COMPILER_DIRS=\
src/basement src/parser src/typing\
src/docgen src/commoncodegen src/mlcodegen src/coqcodegen\
src/testing src/relation_extraction\
src/toplevel src/focalizedep src/focalizetest src/focalizeig
LIB_DIRS=\
src/stdlib src/extlib src/contribs
DOC_DIRS=\
doc_src
ALL_DIRS=\
$(COMPILER_DIRS) $(LIB_DIRS) $(DOC_DIRS)
...
You must add the new directory in the list(s) at its
proper place in the list. Note also, that you must also add all the sub
directories of the new directory if any.
You also must add the files names (full path from the root,
including the $ROOT_DIR/
directory -- usually focalize/) to the list of files to include in a distribution if you
intend to have your files belonging to the standard distribution of
FoCaLize. Add files names to the file $ROOT_DIR/files-for-distrib.lst.
How to release
When a release is to be completed, and
preferably before branching, you must
consolidate the version number of every component of FoCaLiZe.
For the entire FoCaLiZe system, it means to
edit and verify the following
files:
$ROOT_DIR
/focalizec/src/basement/configuration.ml
(the version for FoCaLiZe is in this file).
$ROOT_DIR/
zenon/versionnum.ml
(the
version for zenon is in this file
).
$
ROOT_DIR/
zvtov/version.ml
(the version for zvtov is in this file
).
The Release documentation has to be recompiled
with the new version
numbers. You need to:
- edit the version files:
$ROOT_DIR/focalizec/doc_src/man/*.1
(change the
version).
$ROOT_DIR/focalizec/doc_src/tex/refman/macros.tex
(change the definitions \def\month{mm}
\def\year{yy}
\def\focalversion{\sf vv}
).
$ROOT_DIR/focalizec/doc_src/tex/refman/macros.hva
(change the definitions \def\month{mm}
\def\year{yy}
\def\focalversion{\sf vv}
).
$ROOT_DIR/focalizec/doc_src/tex/tutorial/macros.tex
(change the definitions \def\month{mm}
\def\year{yy}
\def\focalversion{\sf vv}
).
$ROOT_DIR/doc_src/Includes/project.env
(change the definition version_number_full).
Finally, the Makefile creating the distribution must be updated with the version number: focalize/Makefile. In the Makefile entry distrib:
- Change everywhere focalize-old.version.number.tgz by focalize-new.version.number.tgz.
The list of all the files to include in the distribution is $ROOT_DIR/files-for-distrib.lst.
Then, from $ROOT_DIR
, invoke make distrib. The resulting archive will be located in $ROOT_DIR/focalize-current.version.number.tgz
.