corrected -Wall filtering for Linux system;
[u/mrichter/AliRoot.git] / conf / Geant4.gmk
1 # $Id$
2  
3 ################### Geant4 specific definitions ################################
4
5 # include $(G4INSTALL)/config/architecture.gmk
6
7 # Alice options flags
8 ifdef AG4_VISUALIZE
9   CPPFLAGS  += -DALICE_VISUALIZE
10 endif
11
12 ifdef AG4_STACKING
13   CPPFLAGS  += -DALICE_STACKING
14 endif
15
16 ifdef AG4_NOPHYSICS
17   CPPFLAGS  += -DALICE_EMPTY_PHYSICS_LIST
18 endif  
19
20 #
21 # C++ compilation flags
22 #
23
24 ifeq ($(ALICE_TARGET),Linux)
25
26 # Redefinition of -Wall option 
27 # in order to exclude warnings from G4 
28 # excluded for Geant4: -Wswitch -Wunused
29
30   CXXOPTS := $(filter-out -Wall,$(CXXOPTS))
31   CXXOPTS += -Wimplicit-int -Wimplicit-function-declaration\
32              -Wimplicit -Wmain -Wreturn-type -Wcomment \
33              -Wtrigraphs -Wformat -Wchar-subscripts \
34              -Wparentheses              
35   CXXOPTS := $(patsubst -O%,-O% -Wuninitialized,$(CXXOPTS))
36 endif
37
38 ifeq ($(ALICE_TARGET),HP-UX.aCC)
39
40 # Adding options: 
41 # +Onolimit - excludes warnings from G4 
42 # +DAportable - necessary (if not set, run time error from object space)                         
43
44   CXXOPTS := $(patsubst -O%,-O% +Onolimit,$(CXXOPTS))
45   CXXOPTS := $(patsubst +O%,+O% +Onolimit,$(CXXOPTS))
46   CXXOPTS += +DAportable
47 endif  
48  
49 #
50 # Geant4 include paths
51 #
52
53 include $(G4INSTALL)/config/G4UI_USE.gmk
54 include $(G4INSTALL)/config/G4VIS_USE.gmk
55 include $(G4INSTALL)/config/interactivity.gmk
56 ifndef INCFLAGS
57   INCFLAGS := \
58               -I$(G4BASE)/global/management/include \
59               -I$(G4BASE)/global/HEPRandom/include \
60               -I$(G4BASE)/global/HEPGeometry/include \
61               -I$(G4BASE)/global/HEPNumerics/include \
62               -I$(G4BASE)/run/include \
63               -I$(G4BASE)/materials/include \
64               -I$(G4BASE)/particles/management/include \
65               -I$(G4BASE)/particles/bosons/include \
66               -I$(G4BASE)/particles/leptons/include \
67               -I$(G4BASE)/particles/hadrons/barions/include \
68               -I$(G4BASE)/particles/hadrons/ions/include \
69               -I$(G4BASE)/particles/hadrons/mesons/include \
70               -I$(G4BASE)/particles/shortlived/include \
71               -I$(G4BASE)/processes/management/include \
72               -I$(G4BASE)/processes/general/include \
73               -I$(G4BASE)/processes/decay/include \
74               -I$(G4BASE)/processes/optical/include \
75               -I$(G4BASE)/processes/transportation/include \
76               -I$(G4BASE)/processes/parameterisation/include \
77               -I$(G4BASE)/processes/electromagnetic/standard/include \
78               -I$(G4BASE)/processes/electromagnetic/muons/include \
79               -I$(G4BASE)/processes/electromagnetic/utils/include \
80               -I$(G4BASE)/processes/electromagnetic/xrays/include \
81               -I$(G4BASE)/processes/electromagnetic/lowenergy/include \
82               -I$(G4BASE)/processes/hadronic/management/include \
83               -I$(G4BASE)/processes/hadronic/processes/include \
84               -I$(G4BASE)/processes/hadronic/util/include \
85               -I$(G4BASE)/processes/hadronic/cross_sections/include \
86               -I$(G4BASE)/processes/hadronic/models/generator/de_excitation/include \
87               -I$(G4BASE)/processes/hadronic/models/generator/diffractive_string/include \
88               -I$(G4BASE)/processes/hadronic/models/generator/high_energy/include \
89               -I$(G4BASE)/processes/hadronic/models/generator/kinetic_model/include \
90               -I$(G4BASE)/processes/hadronic/models/generator/management/include \
91               -I$(G4BASE)/processes/hadronic/models/generator/pre_equilibrium/include \
92               -I$(G4BASE)/processes/hadronic/models/generator/quark_gluon_string/include \
93               -I$(G4BASE)/processes/hadronic/models/generator/string_common/include \
94               -I$(G4BASE)/processes/hadronic/models/generator/string_fragmentation/include \
95               -I$(G4BASE)/processes/hadronic/models/generator/util/include \
96               -I$(G4BASE)/processes/hadronic/models/high_energy/include \
97               -I$(G4BASE)/processes/hadronic/models/low_energy/include \
98               -I$(G4BASE)/processes/hadronic/models/neutron_hp/include \
99               -I$(G4BASE)/processes/hadronic/models/isotope_production/include \
100               -I$(G4BASE)/processes/hadronic/stopping/include \
101               -I$(G4BASE)/geometry/management/include \
102               -I$(G4BASE)/geometry/solids/CSG/include \
103               -I$(G4BASE)/geometry/solids/specific/include \
104               -I$(G4BASE)/geometry/solids/BREPS/include \
105               -I$(G4BASE)/geometry/solids/Boolean/include \
106               -I$(G4BASE)/geometry/solids/STEP/include \
107               -I$(G4BASE)/geometry/solids/STEPinterface/include \
108               -I$(G4BASE)/geometry/volumes/include \
109               -I$(G4BASE)/geometry/magneticfield/include \
110               -I$(G4BASE)/track/include \
111               -I$(G4BASE)/tracking/include \
112               -I$(G4BASE)/digits+hits/detector/include \
113               -I$(G4BASE)/digits+hits/hits/include \
114               -I$(G4BASE)/digits+hits/digits/include \
115               -I$(G4BASE)/readout/include \
116               -I$(G4BASE)/event/include \
117               -I$(G4BASE)/graphics_reps/include \
118               -I$(G4BASE)/intercoms/include \
119               -I$(G4BASE)/g3tog4/include
120
121 endif
122 CPPFLAGS += $(INCFLAGS)
123
124 #
125 # Geant4 libraries
126 #
127
128 ifdef NEED_G4_LIBS
129
130 G4TMPDIR := $(G4TMP)/$(G4SYSTEM)/$(G4TARGET)
131 G4LIBDIR := $(G4LIB)/$(G4SYSTEM)
132 LDFLAGS += -L$(G4LIBDIR)
133
134 ifdef LDLIBS
135   USER_DEFINED_LDLIBS := 1
136 endif
137
138 # Because of the script for granular libraries which replaces part of LDLIBS
139 # and because of the way user defined LDLIBS was augmented historically I
140 # have split LDLIBS into 4 parts...
141 #
142
143 ifndef USER_DEFINED_LDLIBS
144
145 # LDLIBS1 contains the very high level libraries...
146 #
147 ifdef G4EXLIB
148   LDLIBS1 := -l$(G4TARGET)
149 endif
150   LDLIBS1 += $(EXTRALIBS)
151   LDLIBS1 += $(VISLIBS) $(UILIBS)
152
153 # test if global libraries are present
154 GLOBALLIBS := $(shell test -f $(G4LIBDIR)/libG4global.$(SL) && echo yes)
155
156 ifdef GLOBALLIBS
157   LDLIBS2 := \
158         -lG4readout \
159         -lG4run \
160         -lG4event \
161         -lG4tracking \
162         -lG4processes \
163         -lG4particles \
164         -lG4digits+hits \
165         -lG4track \
166         -lG4materials \
167         -lG4geometry \
168         -lG4geometry \
169         -lG4graphics_reps \
170         -lG4intercoms \
171         -lG4global 
172 else
173   DUMMY := $(shell \
174         if [ ! \( -f $(G4INSTALL)/lib/$(G4SYSTEM)/list \) ]; then \
175         $(G4INSTALL)/lib/$(G4SYSTEM)/liblist  \
176         -d $(G4INSTALL)/tmp/$(G4SYSTEM) \
177         < $(G4INSTALL)/lib/$(G4SYSTEM)/libname.map \
178         > $(G4INSTALL)/lib/$(G4SYSTEM)/list; fi )
179 # Extra libraries to resolve remaining circular dependencies...    
180   LDLIBS2 := $(shell cat $(G4INSTALL)/lib/$(G4SYSTEM)/list)     
181 #  LDLIBS2 += -lG4xrays -lG4optical -lG4muons
182 endif   
183
184 # Warning: do not add to LDLIBS2 with += becuase this causes it to be
185 # expanded too soon.  Hence extra libraries must have a different name...
186 # Extra libraries to resolve remaining circular dependencies...
187 #  LDLIBS2EXTRA = 
188
189 # LDLIBS3 contains the first set of low level libraries...
190 #
191   LDLIBS3 += $(INTYLIBS)
192
193 endif # ifndef USER_DEFINED_LDLIBS
194
195 # LDLIBS4 contains the next set of low level libraries which historically
196 # (why?) the user is not supposed to be able to define...
197 #
198 ifdef G4USE_OSPACE
199   LDLIBS4 += $(OSPACELIBS)
200 endif
201
202   LDLIBS4 += $(LOADLIBS)
203
204 # Finally assemble libraries...
205 #
206 ifdef USER_DEFINED_LDLIBS
207   LDLIBS_PREFINAL := $(LDLIBS)
208 else
209   LDLIBS_PREFINAL = $(LDLIBS1) -lG3toG4 $(LDLIBS2) $(LDLIBS2EXTRA) $(LDLIBS3)
210 endif
211   LDLIBS_PREFINAL += $(LDLIBS4)
212
213 LDLIBS = $(LDLIBS_PREFINAL)
214
215 G4LDLIBS = $(LDLIBS)
216
217 endif #ifdef NEED_G4_LIBS
218