https://github.com/root-project/root
Raw File
Tip revision: 4556bb636d4052a6b6825a926419a63809e1f6dd authored by anerokhi on 01 May 2019, 21:21:19 UTC
Fix handling of ':' character in a TDirectory name
Tip revision: 4556bb6
BUILDSYSTEM
THE ROOT BUILD SYSTEM
=====================

The new ROOT development system is based on Open Source tools like
Subversion, 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 their
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)

rootcling:                       build all cling related components

rootlibs:                        build all ROOT libraries (includes rootcling)

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

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 "svn 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


For developers only:

skip <obj or dictionary>:        skip all dependency checking and just
                                 generate the specified obj or dictionary file


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
- add platform case to base/inc/RConfig.h
- add platform case to utils/src/rootcling.cxx


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://miller.emu.id.au/pmiller/books/rmch/
back to top