https://github.com/root-project/root
Raw File
Tip revision: 7a4ac3d57f3376255e863041b903c5ebc3e336ce authored by Unknown Author on 06 February 2002, 11:51:09 UTC
This commit was manufactured by cvs2svn to create tag 'v3-01-06'.
Tip revision: 7a4ac3d
BUILDSYSTEM
THE ROOT BUILD SYSTEM
=====================

The new ROOT development system is based on Open Source tools like
CVS, configure and make.


The Makefile
------------

The ROOT Makefile has been structured as described in the paper:
"Recursive Make Considered Harmful" [1]. The main philosophy is that
it is better to have a single large Makefile describing the entire
project than many small Makefiles, one for each sub-project, that are
recursively called from the main Makefile. By cleverly using the include
mechanism the single Makefile solution is as modular as the recursive
approach without the problems of incomplete dependency graphs.

The main Makefile includes for each sub-project a Module.mk file
that provides definitions, rules and dependencies for the specific module.
Adding a new module to the ROOT system involves creating a directory in
the main ROOT directory for the module. The module directory, in turn,
should have inc and src directories and a Module.mk file. To include the
new module in the main Makefile you only have to add the line:
   MODULES += <new mod dir>

The build configuration (controlling which optional modules will be
build) is managed via the config/Makefile.config file, which is generated
by the configure script. The platform specifics are described in the
config/Makefile.<arch> file (the architecture is specified once via the
configure script). Both these files are included by the main Makefile.

The user can customize and override make definitions by providing his
own MyConfig.mk file and add custom or modified rules via a MyRules.mk
file. Some options in the config/Makefile.<arch> can be controled via
the ROOTBUILD environment variable. Typically they all support the debug
option:
   ROOTBUILD=debug
Some others support additional options. For more see the makefiles.


Targets
-------

The Makefile supports the following main targets:

all:                             build complete system (default)

fast:                            build complete system without creating
                                 the .d dependency files (good for just
                                 building the system with no further
                                 development)

rootcint:                        build all CINT related components

rootlibs:                        build all ROOT libraries (includes rootcint)

rootexecs:                       build all ROOT executables (includes rootlibs)

dist:                            make binary distribution .tar.gz file

distsrc:                         make source distribution .tar.gz file

clean:                           deletes all .o files

distclean:                       deletes all files produced in the build
                                 (cleans and in addition removes all
                                 dictionaries, dependency files, etc.),
                                 leaves the files produced by configure

maintainer-clean:                distclean + remove files produced by configure

version:                         after manual update of the file 
                                 build/version_number this will recreate the
                                 file base/inc/RVersion.h and recompile only
                                 base/src/TROOT.cxx

importcint:                      import a new version of CINT into the cint
                                 directory. The new CINT tar file must be
                                 available as $HOME/cint. Any new or removed
                                 files are listed. Use this information to
                                 manually update the CVS repository

cintdlls:                        build all CINT add-on shared libs (dll's)

html:                            generate the complete html documentation of
                                 the full ROOT system. Also hyperizes the
                                 README/ChangeLog file

changelog:                       generate the README/ChangeLog file from
                                 information obtained by the "cvs log" command

install:                         install the root binary distribution to the
                                 locations specified via configure. Does
                                 nothing if $ROOTSYS is set to the build
                                 directory

showbuild:                       show all macro definitions used during the
                                 build: compilers, compiler flags, optional
                                 modules, libraries, etc.

redhat:                          build binary RedHat (rpm) packages

debian:                          build binary Debian (pkg) packages


In addition each module has the following module specific targets:

all-<module>                     builds all components specified in the
                                 Module.mk (library, executable, etc.)

clean-<module>                   deletes all .o files produced in the module

distclean-<module>               deletes all in addition to the .o files also
                                 all dictionary and dependency files


Porting to a new platform
-------------------------

- add <platform> option to config/ARCHS
- make a new config/Makefile.<platform>
- add platform case to the file config/root-config.in
- add platform case to the file test/Makefile.in


Adding a new module
-------------------

- make a new module directory containing an inc and src directory
- make a new Module.mk (use one of the existing Module.mk's as template)
- add module name to the MODULES macro in the main Makefile
- if optional module add option to configure script (with test for possible
  third party libraries)










[1] http://www.tip.net.au/~millerp/rmch/recu-make-cons-harm.html
back to top