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
5 # First implementation: July 7th 1995
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!
13 # List of the supported architectures/compilers and related flavors for
14 # the environment variable G4SYSTEM:
16 # SUN-CC SunOS 5.6, CC 4.2 compiler (default)
18 # HP-aCC HP-UX 10.20, aCC A.01.23 compiler
20 # DEC-cxx DEC-OSF/1 4.0, DEC C++ 6.1
22 # Linux-g++ Linux (Red Hat 6.1), egcs 1.1.2
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
28 # -------------------------------------------------------------------------
30 # FLUGG has adopted Geant4 makefiles:
32 # G4INSTALL - Geant4 installation
33 # FLUGGINSTALL - Flugg installation
36 # !!! G4XXX - correspond to Flugg installation !!!
37 # !!! G4XXX_G4 - correspond to Geant4 installation !!!
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/.
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)
50 MAKEFLAGS= --no-print-directory
52 # If not specified, the default platform for G4SYSTEM is SUN-CC ...
57 ifeq ($(G4SYSTEM),WIN32-VC-NICE)
61 # If not specified, the default path for Flugg installation FLUGGINSTALL is
62 # set to $HOME/flugg ...
65 FLUGGINSTALL := $(HOME)/flugg
68 # If not specified, the default path for G4 installation G4INSTALL is
69 # set to $HOME/geant4 ...
72 G4INSTALL := $(HOME)/geant4
75 # If not specified, the default path for Flugg source G4BASE is
76 # set to $FLUGGINSTALL/source ...
79 G4BASE := $(FLUGGINSTALL)/source
82 # If not specified, the default path for G4 source G4BASE is
83 # set to $G4INSTALL/source ...
86 G4BASE_G4 := $(G4INSTALL)/source
89 # If not specified, the default path for the user's workdir is the same
93 G4WORKDIR := $(FLUGGINSTALL)
96 # If not specified, the default path for temporary files G4TMP is
97 # set to $G4WORKDIR/tmp/$G4SYSTEM ...
100 G4TMP := $(G4WORKDIR)/tmp
102 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TMP) ] && mkdir -p $(G4TMP) )
104 # If not specified, the default path for FLUGG libraries G4LIB is
105 # set to $FLUGGINSTALL/lib/$G4SYSTEM ...
108 G4LIB := $(FLUGGINSTALL)/lib
111 # If not specified, the default path for G4 libraries G4LIB_G4 is
112 # set to $G4INSTALL/lib/$G4SYSTEM ...
115 G4LIB_G4 := $(G4INSTALL)/lib
117 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4LIB) ] && mkdir -p $(G4LIB) )
118 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4LIB)/$(G4SYSTEM) ] && mkdir -p $(G4LIB)/$(G4SYSTEM) )
120 # If not specified, the default path to install G4 include files is G4INCLUDE
121 # set to $FLUGGINSTALL/include ...
124 G4INCLUDE := $(FLUGGINSTALL)/include
126 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4INCLUDE) ] && mkdir -p $(G4INCLUDE) )
128 # backwards compatiblity
129 ifneq ($(G4MAKESHLIB),)
130 G4LIB_BUILD_SHARED = 1
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
142 # If not specified, the default path for G4 binaries G4BIN is
143 # set to $G4WORKDIR/bin/$G4SYSTEM ...
146 G4BIN := $(G4WORKDIR)/bin
148 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4BIN) ] && mkdir -p $(G4BIN) )
150 #################### schema directories & setup for G4ODBMS ###################
153 # If not specified, the default path for G4 schema G4SCHEMA_DIR is
154 # set to $G4LIB/$G4SYSTEM/schema ...
157 G4SCHEMA_DIR := $(G4LIB)/$(G4SYSTEM)/schema
158 G4SCHEMA_INCLUDE := $(G4SCHEMA_DIR)/include
164 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4SCHEMA_DIR) ] && mkdir -p $(G4SCHEMA_DIR) )
165 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4SCHEMA_INCLUDE) ] && mkdir -p $(G4SCHEMA_INCLUDE) )
167 # If not specified, the default path for G4 temporary schema G4TMPSCHEMA_DIR is
168 # set to $G4TMP/$G4SYSTEM/schema (for building persistency library)...
170 ifndef G4TMPSCHEMA_DIR
171 G4TMPSCHEMA_DIR := $(G4TMP)/$(G4SYSTEM)/schema
172 G4TMPSCHEMA_BOOT := $(G4TMPSCHEMA_DIR)/G4SCHEMA
175 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TMPSCHEMA_DIR) ] && mkdir -p $(G4TMPSCHEMA_DIR) )
177 # If not specified, the default path for G4 example schema G4EXAMPLE_BOOT_DIR is
178 # set to $G4WORKDIR/exampleSchema (for persistency examples)...
180 ifndef G4EXAMPLE_BOOT_DIR
181 G4EXAMPLE_BOOT_DIR := $(G4WORKDIR)/exampleSchema/$(G4SYSTEM)
184 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4EXAMPLE_BOOT_DIR) ] && mkdir -p $(G4EXAMPLE_BOOT_DIR) )
186 ifndef G4EXAMPLE_BOOT
187 G4EXAMPLE_BOOT = $(G4EXAMPLE_BOOT_DIR)/$(name)
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)...
194 ifndef G4EXAMPLE_FD_DIR
195 G4EXAMPLE_FD_DIR := $(G4WORKDIR)/exampleFD/$(G4SYSTEM)
198 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4EXAMPLE_FD_DIR) ] && mkdir -p $(G4EXAMPLE_FD_DIR) )
199 G4OODDLX_FLAGS := -DTEMPLATEP_HIDES_FNCD
202 G4EXAMPLE_FD = $(G4EXAMPLE_FD_DIR)/$(name)
207 ########################### end setup for G4ODBMS #############################
209 # If G4DEBUG or G4NO_OPTIMISE are not specified,
210 # the default compilation is optimised ...
213 CPPFLAGS += -DG4DEBUG
217 CPPFLAGS += -DG4OPTIMISE
222 ifdef G4GEOMETRY_DEBUG
223 CPPFLAGS += -DG4GEOMETRY_DEBUG
228 ifndef CLHEP_BASE_DIR
229 CLHEP_BASE_DIR := /afs/cern.ch/sw/geant4/dev/CLHEP/$(G4SYSTEM)/pro
231 ifndef CLHEP_INCLUDE_DIR
232 CLHEP_INCLUDE_DIR := $(CLHEP_BASE_DIR)/include
235 CLHEP_LIB_DIR := $(CLHEP_BASE_DIR)/lib
238 ifeq ($(G4SYSTEM),WIN32-VC)
239 CLHEP_LIB := CLHEP.lib
245 # Native STL is the default
247 CPPFLAGS += -DG4USE_STL
248 G4STLINC := $(G4BASE)/global/STLInterface
250 # Path to ObjectSpace STL (or STLport <- only test for Win/NT)
254 # ObjectSpace STL implementation
256 ifndef OSPACE_BASE_DIR
257 OSPACE_BASE_DIR := /afs/cern.ch/sw/geant4/dev/ObjectSpace/$(G4SYSTEM)/pro/ToolKit
259 OSPACEINC := -I$(OSPACE_BASE_DIR)/ospace/std -I$(OSPACE_BASE_DIR)/ospace/stl
260 OSPACELIBS := -L$(OSPACE_BASE_DIR)/lib -lospace
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)
273 # STLport STL implementation
274 # (derived from SGI implementation) - TEST on WIN32
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
290 G4DATA := $(FLUGGINSTALL)/data
293 # Photon evaporation data
295 ifndef G4LEVELGAMMADATA
296 G4LEVELGAMMADATA := $(G4DATA)/PhotonEvaporation
299 # Toggle variables (positional qualifiers) between WIN32-VC and UNIX...
301 ifeq ($(G4SYSTEM),WIN32-VC)
306 LIB_PATH := '-libpath:'
307 CERNLIB_PATH := "z:\p32\cern\new\df\lib"
310 # pattern for next substitution
312 LIB_PATT := lib(LibName).a
313 FLIB_PATT := (LibName).lib
320 CERNLIB_PATH := /cern/pro/lib
323 # pattern for next substitution
325 LIB_PATT := -l(LibName)
326 FLIB_PATT := $(LIB_PATT)
329 # Variables for implicit rules, etc., as suggested in GNU Make manual...
331 CPPFLAGS += -Iinclude -I$(G4STLINC)
332 CPPFLAGS += -I$(CLHEP_INCLUDE_DIR)
334 # Positional qualifiers in action...
336 ifeq ($(G4SYSTEM),WIN32-VC)
337 LDFLAGS := -link $(LIB_PATH)$(CLHEP_LIB_DIR)
338 LOADLIBS := $(CLHEP_LIB)
340 LDFLAGS := -L$(CLHEP_LIB_DIR)
342 LOADLIBS := -l$(CLHEP_LIB)
343 # LOADLIBS := $(CLHEP_LIB_DIR)/lib$(CLHEP_LIB).a
347 # Graphic variables...
352 # ------------------ X11 ---------------------
354 X11LIBS := -lXmu -lXt -lXext -lX11
355 # ----------------- Motif --------------------
358 # ---------------- Athena --------------------
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
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 -----------------
374 HEPVISINC := $(HEPVISDIR)/include
377 HEPVISLIB := $(HEPVISDIR)/source
380 OIVFLAGS := -I${HEPVISINC}
383 OIVLIBS := -L${HEPVISLIB} -lHEPVis -lInventorXt -lInventor -lGLU -lGL
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
395 G4_OPACS_WIDGET_SET := Xm
399 # For cfront compilers the repository location is set to
400 # $G4TMP/$G4SYSTEM/g4.ptrepository.
402 G4TEMPLATE_REPOSITORY := $(G4SYSTEM)/g4.ptrepository
403 G4TEMPEXEC_REPOSITORY := $(G4TEMPLATE_REPOSITORY)/exec
404 G4TREP := $(G4TMP)/$(G4TEMPLATE_REPOSITORY)
406 # Default archive call. Changed for: SUN-CC.
410 # Default echo used with makedepend. Changed for SUN-CC, Linux-g++.
414 # Default grep used with source/GNUmakfile. Changed for SUN-CC.
418 # Include architecture dependent setups...
420 include $(FLUGGINSTALL)/config/sys/$(G4SYSTEM).gmk
422 # If compiler recognises implicit C++ type bool...
425 CPPFLAGS += -DG4_HAVE_BOOL
428 # If there is no cbrt() function...
431 CPPFLAGS += -DG4_NO_CBRT
434 # Verbosity code can be left out (for better performance)
435 # by defining G4_NO_VERBOSE.
438 CPPFLAGS += -DG4VERBOSE
441 # Trajectory related classes can be left out (for better performance)
442 # by defining G4_NO_STORE_TRAJECTORY.
444 ifndef G4_NO_STORE_TRAJECTORY
445 CPPFLAGS += -DG4_STORE_TRAJECTORY
448 # Template setup - repositories, special options etc
450 ifdef CFRONT_G4TEMPLATE_REPOSITORY
451 ifeq ($(findstring DEC,$(G4SYSTEM)),DEC)
453 CXXTEMPLATE_FLAGS := -ptr $(G4TREP)/exec -ptr $(G4TREP)
455 CXXTEMPLATE_FLAGS := -ptr $(G4TREP)
459 CXXTEMPLATE_FLAGS := -ptr$(G4TREP)/exec -ptr$(G4TREP)
461 CXXTEMPLATE_FLAGS := -ptr$(G4TREP)
464 CXXFLAGS += $(CXXTEMPLATE_FLAGS)
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 )