]> git.uio.no Git - u/mrichter/AliRoot.git/blob - doc/README.FlatMakefile
Updated version of the calibration data (A.Colla)
[u/mrichter/AliRoot.git] / doc / README.FlatMakefile
1 ****************************************************
2 *                                                   *
3 *         Flat makefile for AliRoot                 *
4 *                                                   *
5 *   This README describes how to use the             *
6 *   Makefile.flat for AliRoot                       *
7 *                                                   *
8 *   Author: Jan-Erik Revsbech <revsbech@fys.ku.dk>  *
9 *****************************************************
10
11
12 ** DESCRIPTION **
13
14 As the name suggests this is a flat makefile structure for
15 Aliroot. That means that there is only one makefile for aliroot and
16 not as before on makefile for every package. This way the
17 Makefile.flat knows about all dependencies and does not have to
18 recursively go through all directories several time.
19
20 Instead of having a makefile for each package, all the packages have
21 one module.mk file. This file contains information about the package.
22 Each package can contain several libraries
23 and binaries to be made. The module.mk file is automatically created
24 by a script, by using a template. The script must know about what
25 files each desired library or binary consists of. This is specified
26 in .pkg files. For example a module in directory STEER could make two
27 libraries libSTEER and libSTEERDummy.so and one binary called
28 STEERTest. In this example the directory STEER would contain three
29 files: libSTEER.pkg, libSTEERDummy.pkg and binSTEERTest.pkg. These
30 files will contain information about which source and header files the
31 library or binary consists of and specific options. See the section package file for
32 further information about what the pkg files contains.
33 The libraries are put in the directory LIBPATH, set in Makefile.flat
34 and binaries in BINPATH. These directories are set to
35 bin/tgt_$ALICE_TARGET and lib/tgt_$ALICE_TARGET respectively.
36
37 The module.mk files will be automatically generated by Makefile.flat
38 if they do not exist. Also the build/moudle.dep contains a list of
39 dependencies for the module.mk files. This means that for the above
40 example the build/module.dep would contain a line like this:
41
42 STEER/module.mk:   libSTEER.pkg libSTEERDummy.pkg binSTEERTest.pkg
43
44 In this way if a change is made to one of the package-files (a
45 source-file is added or something), the module.mk file will be re-generated.
46
47 The Makefile.flat has in the start a variable called MODULES, this
48 variables lists all the subdirectories to look for module.mk files.
49
50 ** PACKAGE FILES **
51
52 The .pkg files uses make syntax, so be careful with tabs!!!
53
54 As a minimum all package files must specify which source-code files and
55 headers it consist of. This is done with the variables
56 HDRS,SRCS,FSRCS,CSRCS which is Heades, C++ sources, Fortran sources
57 and C-source-files.
58
59 For example the Package libSTEERDummy.pkg could consist of 
60
61 SRCS:= AliSTEERDummy.cxx
62
63 FSRCS:= AliSTEERFortranRoutines.f
64
65 HDRS:= AliSTEERDummy.cxx
66
67 Since the pkg files use make syntax HDRS can also be specified as
68
69 HDRS:=$(SRCS:.cxx=.h)
70
71 which is useful if there is a lot of files.
72
73 If the library (or binary) uses include files in other directories
74 than itself it should be specified in the variable EHDRS (for External
75 headers). By default the Makefile.flat will look in $ALICE_ROOT,
76 $ALICE_ROOT/MODULE (in this case $ALICE_ROOT/STEER), $ROOTSYS/inlude
77 and in $ALICE_ROOT/include. If more include directories is needed it
78 can be specified with the variable EINCLUDE. *DO NOT* put the -I flag
79 it will be put automatically, just write the name of the directory.
80
81 If a root dictionary file is used it can be specified with
82
83 DHDR:= STEERLinkdef.h
84
85 This will be processed with rootcint with all the header-files
86 (specified in HDRS), and default cint includedir (set in CINTFLAGS)
87 plus the directories specified in EINCLUDE
88
89 By default all libraries are linked against libraries specified in
90 SHLIB and binaries against LIBS. If desired extra libraries can be
91 specified with the ELIBS variable. *DO NOT* specify the -l flag, just
92 write the library like
93
94 ELIBS:= CONTAINERS
95
96 this will be translated into -lCONTAINERS
97
98 Extra library directories can be specified with ELIBSDIR
99
100 If very special compilation flags is needed it can be specified with
101 the three variables:
102
103 PACKFFLAGS:=
104 PACKCXXFLAGS:=
105 PACKCFLAGS:=
106
107 *WARNING* if these flags are set, the default FFLAGS,CXXFLAGS and CFLAGS
108  will be overwritten. Normally they  will be used like this:
109
110 PACKCXXFLAGS:= $(filter-out -O%,CXXFLAGS) 
111
112 This will set the C++ compiler-flags to the default ones, but without
113 optimisation.
114
115 ** LIST OF Variables in .pkg files **
116
117 SRCS:=
118 HDRS:=
119 FSRCS:=
120 DHDR:=
121 CSRCS:=
122 CHDRS:=
123 EINCLUDE:=
124 ELIBS:=
125 ELIBSDIR:=
126 PACKFFLAGS:=
127 PACKCXXFLAGS:=
128 PACKCFLAGS:=
129 EXPORT:=
130 EHDRS:=
131
132
133
134
135
136
137
138
139
140
141