]> git.uio.no Git - u/mrichter/AliRoot.git/blob - Flugg/config/architecture.gmk
Merging the VirtualMC branch to the main development branch (HEAD)
[u/mrichter/AliRoot.git] / Flugg / config / architecture.gmk
1 # $ Id: architecture.gmk,v 1.70 2000/12/08 09:41:26 gcosmo Exp $
2 # ------------------------------------------------------------------------
3 #       GEANT 4 - Architecture configuration script for GNU Make
4 #
5 #       First implementation: July 7th 1995
6 #
7 # Description
8 # -----------
9 # to override variables defined in this script, use "gmake -e", this will
10 # cause environment variables to take precedence. In this case watch for
11 # inadvertant overrides!
12 #
13 # List of the supported architectures/compilers and related flavors for
14 # the environment variable G4SYSTEM:
15 #
16 #          SUN-CC      SunOS 5.6, CC 4.2 compiler (default)
17 #
18 #          HP-aCC      HP-UX 10.20, aCC A.01.23 compiler
19 #
20 #          DEC-cxx     DEC-OSF/1 4.0, DEC C++ 6.1
21 #
22 #          Linux-g++   Linux (Red Hat 6.1), egcs 1.1.2
23 #
24 #          WIN32-VC    Windows/NT and Microsoft Visual C++ 6.0
25 #                      Adding CYGWIN32 tools (make, g++ as "makedepend", sh...)
26 #                      Note: you will need to set your environment, see the
27 #                            installation guide.
28 # -------------------------------------------------------------------------
29
30 # FLUGG has adopted Geant4 makefiles:
31 #
32 # G4INSTALL    - Geant4 installation
33 # FLUGGINSTALL - Flugg installation
34 #
35 # But:
36 # !!! G4XXX    - correspond to Flugg installation  !!!
37 # !!! G4XXX_G4 - correspond to Geant4 installation !!!
38 #
39
40 # Definition of HEP_ODBMS_LIBS, OBJY_LIBS and OSPACE_LIBS by HepODBMS.
41 # Note: If G4ODBMS is defined, it calls for HEP_ODBMS setup files in
42 #       $(HEP_ODBMS_DIR)/etc/.
43 #
44 ifdef G4ODBMS
45   # variables LHCXXTOP and PLATF are used in HepODBMS setup
46   include $(HEP_ODBMS_DIR)/etc/$(OS).mk
47   G4ODBMS_LIBS := $(HEP_ODBMS_LIBS) $(OBJY_LIBS) $(OSPACE_LIBS)
48 endif
49
50 MAKEFLAGS= --no-print-directory
51
52 # If not specified, the default platform for G4SYSTEM is SUN-CC ...
53 #
54 ifndef G4SYSTEM
55   G4SYSTEM := SUN-CC
56 endif
57 ifeq ($(G4SYSTEM),WIN32-VC-NICE)
58   G4SYSTEM := WIN32-VC
59 endif
60
61 # If not specified, the default path for Flugg installation FLUGGINSTALL is
62 # set to $HOME/flugg ...
63 #
64 ifndef FLUGGINSTALL
65   FLUGGINSTALL := $(HOME)/flugg
66 endif
67
68 # If not specified, the default path for G4 installation G4INSTALL is
69 # set to $HOME/geant4 ...
70 #
71 ifndef G4INSTALL
72   G4INSTALL := $(HOME)/geant4
73 endif
74
75 # If not specified, the default path for Flugg source G4BASE is
76 # set to $FLUGGINSTALL/source ...
77 #
78 ifndef G4BASE
79   G4BASE := $(FLUGGINSTALL)/source
80 endif
81
82 # If not specified, the default path for G4 source G4BASE is
83 # set to $G4INSTALL/source ...
84 #
85 ifndef G4BASE_G4
86   G4BASE_G4 := $(G4INSTALL)/source
87 endif
88
89 # If not specified, the default path for the user's workdir is the same
90 # as FLUGGINSTALL ...
91 #
92 ifndef G4WORKDIR
93   G4WORKDIR := $(FLUGGINSTALL)
94 endif
95
96 # If not specified, the default path for temporary files G4TMP is
97 # set to $G4WORKDIR/tmp/$G4SYSTEM ...
98 #
99 ifndef G4TMP
100   G4TMP := $(G4WORKDIR)/tmp
101 endif
102 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TMP) ] && mkdir -p $(G4TMP) )
103         
104 # If not specified, the default path for FLUGG libraries G4LIB is
105 # set to $FLUGGINSTALL/lib/$G4SYSTEM ...
106 #
107 ifndef G4LIB
108   G4LIB := $(FLUGGINSTALL)/lib
109 endif
110
111 # If not specified, the default path for G4 libraries G4LIB_G4 is
112 # set to $G4INSTALL/lib/$G4SYSTEM ...
113 #
114 ifndef G4LIB_G4
115   G4LIB_G4 := $(G4INSTALL)/lib
116 endif
117 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4LIB) ] && mkdir -p $(G4LIB) )
118 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4LIB)/$(G4SYSTEM) ] && mkdir -p $(G4LIB)/$(G4SYSTEM) )
119
120 # If not specified, the default path to install G4 include files is G4INCLUDE 
121 # set to $FLUGGINSTALL/include ...
122 #
123 ifndef G4INCLUDE
124   G4INCLUDE := $(FLUGGINSTALL)/include
125 endif
126 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4INCLUDE) ] && mkdir -p $(G4INCLUDE) )
127
128 # backwards compatiblity
129 ifneq ($(G4MAKESHLIB),)
130   G4LIB_BUILD_SHARED = 1
131 endif
132
133 # defaults for library BUILD. No default for USE, ie. take what is found.
134 ifeq ($(G4LIB_BUILD_SHARED),)
135   ifeq ($(G4LIB_BUILD_STATIC),)
136 #    default is building static libs
137     G4LIB_BUILD_STATIC = 1
138   endif  
139 endif
140
141
142 # If not specified, the default path for G4 binaries G4BIN is
143 # set to $G4WORKDIR/bin/$G4SYSTEM ...
144 #
145 ifndef G4BIN
146   G4BIN := $(G4WORKDIR)/bin
147 endif
148 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4BIN) ] && mkdir -p $(G4BIN) )
149
150 #################### schema directories & setup for G4ODBMS ###################
151 #
152 ifdef G4ODBMS
153 # If not specified, the default path for G4 schema G4SCHEMA_DIR is
154 # set to $G4LIB/$G4SYSTEM/schema ...
155 #
156 ifndef G4SCHEMA_DIR
157   G4SCHEMA_DIR := $(G4LIB)/$(G4SYSTEM)/schema
158   G4SCHEMA_INCLUDE := $(G4SCHEMA_DIR)/include
159 endif
160 ifndef G4SCHEMA_FDID
161   G4SCHEMA_FDID := 207
162 endif
163
164 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4SCHEMA_DIR) ] && mkdir -p $(G4SCHEMA_DIR) )
165 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4SCHEMA_INCLUDE) ] && mkdir -p $(G4SCHEMA_INCLUDE) )
166
167 # If not specified, the default path for G4 temporary schema G4TMPSCHEMA_DIR is
168 # set to $G4TMP/$G4SYSTEM/schema (for building persistency library)...
169 #
170 ifndef G4TMPSCHEMA_DIR
171   G4TMPSCHEMA_DIR := $(G4TMP)/$(G4SYSTEM)/schema
172   G4TMPSCHEMA_BOOT := $(G4TMPSCHEMA_DIR)/G4SCHEMA
173 endif
174
175 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TMPSCHEMA_DIR) ] && mkdir -p $(G4TMPSCHEMA_DIR) )
176
177 # If not specified, the default path for G4 example schema G4EXAMPLE_BOOT_DIR is
178 # set to $G4WORKDIR/exampleSchema (for persistency examples)...
179 #
180 ifndef G4EXAMPLE_BOOT_DIR
181   G4EXAMPLE_BOOT_DIR := $(G4WORKDIR)/exampleSchema/$(G4SYSTEM)
182 endif
183
184 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4EXAMPLE_BOOT_DIR) ] && mkdir -p $(G4EXAMPLE_BOOT_DIR) )
185
186 ifndef G4EXAMPLE_BOOT
187   G4EXAMPLE_BOOT = $(G4EXAMPLE_BOOT_DIR)/$(name)
188 endif
189
190 # If not specified, the default path for G4 example runtime federated
191 # database directory G4EXAMPLE_FD_DIR is set to $G4WORKDIR/exampleFD
192 # (for persistency examples)...
193 #
194 ifndef G4EXAMPLE_FD_DIR
195   G4EXAMPLE_FD_DIR := $(G4WORKDIR)/exampleFD/$(G4SYSTEM)
196 endif
197
198 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4EXAMPLE_FD_DIR) ] && mkdir -p $(G4EXAMPLE_FD_DIR) )
199 G4OODDLX_FLAGS := -DTEMPLATEP_HIDES_FNCD
200
201 ifndef G4EXAMPLE_FD
202   G4EXAMPLE_FD = $(G4EXAMPLE_FD_DIR)/$(name)
203 endif
204
205 endif
206 #
207 ########################### end setup for G4ODBMS #############################
208
209 # If G4DEBUG or G4NO_OPTIMISE are not specified,
210 # the default compilation is optimised ...
211 #
212 ifdef G4DEBUG
213   CPPFLAGS += -DG4DEBUG
214   G4DEBUG := 1
215 else
216   ifndef G4NO_OPTIMISE
217     CPPFLAGS += -DG4OPTIMISE
218     G4OPTIMISE := 1
219   endif
220 endif
221
222 ifdef G4GEOMETRY_DEBUG
223   CPPFLAGS += -DG4GEOMETRY_DEBUG
224 endif
225
226 # CLHEP path, etc.
227 #
228 ifndef CLHEP_BASE_DIR
229   CLHEP_BASE_DIR    := /afs/cern.ch/sw/geant4/dev/CLHEP/$(G4SYSTEM)/pro
230 endif
231 ifndef CLHEP_INCLUDE_DIR
232   CLHEP_INCLUDE_DIR := $(CLHEP_BASE_DIR)/include
233 endif
234 ifndef CLHEP_LIB_DIR
235   CLHEP_LIB_DIR     := $(CLHEP_BASE_DIR)/lib
236 endif
237 ifndef CLHEP_LIB
238   ifeq ($(G4SYSTEM),WIN32-VC)
239     CLHEP_LIB         := CLHEP.lib
240   else
241     CLHEP_LIB         := CLHEP
242   endif
243 endif
244
245 # Native STL is the default
246 #
247 CPPFLAGS += -DG4USE_STL
248 G4STLINC := $(G4BASE)/global/STLInterface
249
250 # Path to ObjectSpace STL (or STLport <- only test for Win/NT)
251 #
252 ifdef G4USE_OSPACE
253
254   # ObjectSpace STL implementation
255   #
256   ifndef OSPACE_BASE_DIR
257     OSPACE_BASE_DIR := /afs/cern.ch/sw/geant4/dev/ObjectSpace/$(G4SYSTEM)/pro/ToolKit
258   endif
259   OSPACEINC       := -I$(OSPACE_BASE_DIR)/ospace/std -I$(OSPACE_BASE_DIR)/ospace/stl
260   OSPACELIBS      := -L$(OSPACE_BASE_DIR)/lib -lospace
261
262   ifeq ($(G4SYSTEM),WIN32-VC)
263     OSPACE_BASE_DIR := $(OBJECT_SPACE_BASE)
264     OSPACEINC  := -I$(OSPACE_BASE_DIR)/ospace/std -I$(OSPACE_BASE_DIR)/ospace/stl -I$(OSPACE_BASE_DIR)
265     OSPACELIBS := '-libpath':$(OSPACE_BASE_DIR)/lib std-2.1-vc5.0-mt.lib
266     CPPFLAGS   += -DG4USE_OLDSTL 
267     CPPFLAGS   += -DOS_WIN_NT_4_0 -DOS_MULTI_THREADED -D_WIN32_WINNT $(OSPACEINC)
268   endif
269
270 else 
271 ifdef G4USE_STLPORT
272
273   # STLport STL implementation
274   # (derived from SGI implementation) - TEST on WIN32
275   #
276   ifeq ($(G4SYSTEM),WIN32-VC)
277     STLPORT_BASE_DIR := $(STLPORT_BASE)
278     OSPACEINC  := -I$(STLPORT_BASE_DIR)/stl
279     CPPFLAGS   += -DG4USE_OLDSTL
280     CPPFLAGS   += -D_NOTHREADS -D__STL_NO_NEW_IOSTREAMS -D__STL_NO_NAMESPACES
281     CPPFLAGS   += -D__STL_NO_NEW_STYLE_HEADERS
282   endif
283
284 endif   #STLport
285 endif   #OPSPACE
286
287 # Paths for G4 data
288 #
289 ifndef G4DATA
290   G4DATA := $(FLUGGINSTALL)/data
291 endif
292
293 # Photon evaporation data
294 #
295 ifndef G4LEVELGAMMADATA
296   G4LEVELGAMMADATA := $(G4DATA)/PhotonEvaporation
297 endif
298
299 # Toggle variables (positional qualifiers) between WIN32-VC and UNIX...
300 #
301 ifeq ($(G4SYSTEM),WIN32-VC)
302   OUT_OBJ := -TP '-Fo'
303   FOR_OBJ := '-Fo'
304   OUT_LIB := '-out:'
305   OUT_EXE := '-Fe'
306   LIB_PATH := '-libpath:'
307   CERNLIB_PATH := "z:\p32\cern\new\df\lib"
308   PATH_DEL := \\
309   #
310   # pattern for next substitution
311   #
312   LIB_PATT  := lib(LibName).a
313   FLIB_PATT := (LibName).lib
314 else
315   OUT_OBJ := -o 
316   FOR_OBJ := -o 
317   OUT_LIB := 
318   OUT_EXE := -o 
319   LIB_PATH := -L
320   CERNLIB_PATH := /cern/pro/lib
321   PATH_DEL := /
322   #
323   # pattern for next substitution
324   #
325   LIB_PATT  := -l(LibName)
326   FLIB_PATT := $(LIB_PATT)
327 endif
328
329 # Variables for implicit rules, etc., as suggested in GNU Make manual...
330 #
331 CPPFLAGS  += -Iinclude -I$(G4STLINC)
332 CPPFLAGS  += -I$(CLHEP_INCLUDE_DIR)
333
334 # Positional qualifiers in action...
335 #
336 ifeq ($(G4SYSTEM),WIN32-VC)
337   LDFLAGS   := -link $(LIB_PATH)$(CLHEP_LIB_DIR)
338   LOADLIBS  := $(CLHEP_LIB)
339 else
340   LDFLAGS   := -L$(CLHEP_LIB_DIR)
341 #  LDFLAGS   := 
342   LOADLIBS  := -l$(CLHEP_LIB)
343 #  LOADLIBS  := $(CLHEP_LIB_DIR)/lib$(CLHEP_LIB).a
344   LOADLIBS  += -lm
345 endif
346
347 # Graphic variables...
348 #
349 ifndef VISLIBS
350   VISLIBS :=
351 endif
352 # ------------------ X11 ---------------------
353 X11FLAGS  :=
354 X11LIBS   := -lXmu -lXt -lXext -lX11
355 # ----------------- Motif --------------------
356 XMFLAGS   :=
357 XMLIBS    := -lXm
358 # ---------------- Athena --------------------
359 XAWFLAGS   :=
360 XAWLIBS    := -lXaw
361 # ---------------- OpenGL --------------------
362 # The user can define his own values of OGLFLAGS and OGLLIBS.
363 # OGLFLAGS gives the directory containing include files.
364 #   E.g.: OGLFLAGS  := -I$(OGLHOME)/include
365 # OGLLIBS gives the libraries.
366 #   E.g.: OGLLIBS   := -L$(OGLHOME)/lib -lGLU -lGL
367 #   Or  : OGLLIBS   := -L$(OGLHOME)/lib -lMesaGLU -lMesaGL
368 # OGLHOME is often /usr or /usr/local.  Or it can point to a special
369 # installation.
370 # If the user does not set his/her own values, system-dependent values
371 # are set below.  Most system-dependent code assumes OGLHOME is set.
372 # ------------- OpenInventor -----------------
373 ifndef HEPVISINC
374   HEPVISINC := $(HEPVISDIR)/include
375 endif
376 ifndef HEPVISLIB
377   HEPVISLIB := $(HEPVISDIR)/source
378 endif
379 ifndef OIVFLAGS
380   OIVFLAGS  := -I${HEPVISINC}
381 endif
382 ifndef OIVLIBS
383   OIVLIBS   := -L${HEPVISLIB} -lHEPVis -lInventorXt -lInventor -lGLU -lGL
384 endif
385 # ----------------- OPACS --------------------
386 # lesstiff is bugged for popups ; then OPACS/Xo uses 
387 # the Xaw widgets for handling popups. The OPACS distrib
388 # for Linux assumes that lesstif is used by default. To be
389 # coherent we set in Geant4 the default toolkit to lesstif 
390 # on Linux in order to link with -lXaw, etc...
391 ifndef G4_OPACS_WIDGET_SET
392   ifeq ($(G4SYSTEM),Linux-g++)
393     G4_OPACS_WIDGET_SET := lesstif
394   else
395     G4_OPACS_WIDGET_SET := Xm
396   endif
397 endif
398
399 # For cfront compilers the repository location is set to
400 # $G4TMP/$G4SYSTEM/g4.ptrepository.
401 #
402 G4TEMPLATE_REPOSITORY := $(G4SYSTEM)/g4.ptrepository
403 G4TEMPEXEC_REPOSITORY := $(G4TEMPLATE_REPOSITORY)/exec
404 G4TREP := $(G4TMP)/$(G4TEMPLATE_REPOSITORY)
405
406 # Default archive call. Changed for: SUN-CC.
407 #
408 AR := ar r
409
410 # Default echo used with makedepend. Changed for SUN-CC, Linux-g++.
411 #
412 ECHO:= echo
413
414 # Default grep used with source/GNUmakfile.  Changed for SUN-CC.
415 #
416 GREP := grep
417
418 # Include architecture dependent setups...
419 #
420 include $(FLUGGINSTALL)/config/sys/$(G4SYSTEM).gmk
421
422 # If compiler recognises implicit C++ type bool...
423 #
424 ifdef G4_HAVE_BOOL
425   CPPFLAGS += -DG4_HAVE_BOOL
426 endif
427
428 # If there is no cbrt() function...
429 #
430 ifdef G4_NO_CBRT
431   CPPFLAGS += -DG4_NO_CBRT
432 endif
433
434 # Verbosity code can be left out (for better performance)
435 # by defining G4_NO_VERBOSE.
436 #
437 ifndef G4_NO_VERBOSE
438   CPPFLAGS += -DG4VERBOSE
439 endif
440
441 # Trajectory related classes can be left out (for better performance)
442 # by defining G4_NO_STORE_TRAJECTORY.
443 #
444 ifndef G4_NO_STORE_TRAJECTORY
445   CPPFLAGS += -DG4_STORE_TRAJECTORY
446 endif
447
448 # Template setup - repositories, special options etc
449 #
450 ifdef CFRONT_G4TEMPLATE_REPOSITORY
451   ifeq ($(findstring DEC,$(G4SYSTEM)),DEC)
452       ifdef G4EXEC_BUILD
453         CXXTEMPLATE_FLAGS := -ptr $(G4TREP)/exec -ptr $(G4TREP)
454       else
455         CXXTEMPLATE_FLAGS := -ptr $(G4TREP)
456       endif
457   else
458       ifdef G4EXEC_BUILD
459         CXXTEMPLATE_FLAGS := -ptr$(G4TREP)/exec -ptr$(G4TREP)
460       else
461         CXXTEMPLATE_FLAGS := -ptr$(G4TREP)
462       endif
463   endif
464   CXXFLAGS += $(CXXTEMPLATE_FLAGS)
465   CFRONT := true
466 endif
467 ifdef CFRONT
468   G4TEMPLATE_REPOSITORY_PARENT := $(shell echo $(G4TREP) | sed 's!/[^/][^/]*/*$$!!' )
469   G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TEMPLATE_REPOSITORY_PARENT) ] && mkdir -p $(G4TEMPLATE_REPOSITORY_PARENT) )
470   G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TREP) ] && mkdir -p $(G4TREP) )
471   G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TREP)/exec ] &&mkdir -p $(G4TREP)/exec )
472 endif
473