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