
make
has proven to be the best program :
Makefiles. It makes possible the encapsulation of
machine dependencies in an elegant way.-I,
makes the Gnu Make very powerful. The common part of the
Makefiles can be gathered in a single file to be
included. This functionnality makes the maintenance much easier.The complete documentation about the Gnu Make is available in the online manual..
make is to define an
alias like : alias make='make.gnu -I$APPLI/include
-I$COROOT/include DEBUG:=yes'
APPLI being an environment variable pointing to the root
of your current application (ex : export
APPLI=/home/madmax/soft/Ariane) and COROOT a
variable pointing to the directory where the files of your
departement are kept (ex : export COROOT=/usr/local).
The variable DEBUG is set to yes to allow
compilation with the option -g. With this sort of
definitions, you will have only to type make to run the
command.
makefiles
which have to be included by every applications, it is very
straightforward to built the specific Makefiles for a
given application.
Makefile containing
the statements specific to the application. The convention is to
called this file make.my_appli, as an example, for the
Ariane library, this file is make.ariane. At the mininum, the file must
provide the name of the archive in the variable
LIBNAME.Makefile like this example. The variable SRC.c
should contain the list of files written in C to be compiled, the
variable SRC.cc is set to the list of C++ files. Such a
Makefile has to be created and updated in each
subdirectories of the src directory : it is used to
manage separately each package of an application. To take into
account the dependencies, run make .MKDEP : it will call
the perl script mkdepend which will generate
the file .dependencies. This file is a piece of
makefile included by make.lib.Makefile in
the top directory of the application. It will allow the management of
all packages by calling the Makefiles in the individual
subdirectories. As far as the Ariane library is concerned, this file
is the following. Obviously, the
variable MODULES has to be updated : it must be set to
the list of subdirectories in src. The available targets
are defined in make.lib.Makefiles located in the users directories are the
following :
make.lib should be used instead.Makefiles of an application. It defines the standard
targets needed in most of the applications such as compile,
clean, ..../usr/local/bin.make.def to override some definitions of
make.def (instead of editing it) at a particular site if
necessary.