source: trunk/geant4/config/architecture.gmk @ 493

Last change on this file since 493 was 483, checked in by garnier, 17 years ago

r569@mac-90108: laurentgarnier | 2007-06-05 15:53:34 +0200
version contre geant4.8.2.p01

File size: 9.1 KB
Line 
1# $Id: architecture.gmk,v 1.107 2006/10/31 11:35:43 gunter 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#          Linux-g++   Linux (Red Hat Enterprise/SCL3), gcc-3.2.3 (default)
17#
18#          SUN-CC      SunOS 5.8, CC 5.4
19#
20#          WIN32-VC    Windows/XP and Microsoft Visual C++ 7.1 .NET
21#                      Adding CYGWIN32 tools
22# -------------------------------------------------------------------------
23
24MAKEFLAGS= --no-print-directory
25
26# If not specified, the default path for G4 installation G4INSTALL is
27# set to $HOME/geant4 ...
28#
29ifndef G4INSTALL
30  G4INSTALL := $(HOME)/geant4
31endif
32
33# If not specified, the default path for G4 source G4BASE is
34# set to $G4INSTALL/source ...
35#
36ifndef G4BASE
37  G4BASE := $(G4INSTALL)/source
38endif
39
40# If not specified, the default path for the user's workdir is the same
41# as G4INSTALL ...
42#
43ifndef G4WORKDIR
44  G4WORKDIR := $(G4INSTALL)
45endif
46
47# If not specified, the default path for temporary files G4TMP is
48# set to $G4WORKDIR/tmp/$G4SYSTEM ...
49#
50ifndef G4TMP
51  G4TMP := $(G4WORKDIR)/tmp
52endif
53G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TMP) ] && mkdir -p $(G4TMP) )
54       
55# If not specified, the default path for G4 libraries G4LIB is
56# set to $G4INSTALL/lib/$G4SYSTEM ...
57#
58ifndef G4LIB
59  G4LIB := $(G4INSTALL)/lib
60endif
61G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4LIB) ] && mkdir -p $(G4LIB) )
62G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4LIB)/$(G4SYSTEM) ] && mkdir -p $(G4LIB)/$(G4SYSTEM) )
63
64# If not specified, the default path to install G4 include files is G4INCLUDE
65# set to $G4INSTALL/include ...
66#
67ifndef G4INCLUDE
68  G4INCLUDE := $(G4INSTALL)/include
69endif
70G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4INCLUDE) ] && mkdir -p $(G4INCLUDE) )
71
72# Backwards compatibility
73#
74ifneq ($(G4MAKESHLIB),)
75  ifeq ($(G4LIB_NO_SHARED),)
76    G4LIB_BUILD_SHARED = 1
77  endif
78endif
79
80# Defaults for library BUILD. No default for USE, ie. take what is found.
81# Default is building static libraries.
82#
83ifeq ($(G4LIB_BUILD_SHARED),)
84  ifeq ($(G4LIB_BUILD_STATIC),)
85    G4LIB_BUILD_STATIC = 1
86  endif 
87endif
88
89# Specify if to build the DLL libraries on Windows. Default is NO.
90#
91ifneq ($(G4LIB_USE_DLL),)
92  G4LIB_BUILD_DLL = 1
93  CPPFLAGS += -DG4LIB_BUILD_DLL
94endif
95ifneq ($(G4LIB_BUILD_DLL),)
96  G4LIB_BUILD_DLL = 1
97  CPPFLAGS += -DG4LIB_BUILD_DLL
98  G4LIB_USE_DLL = 1
99endif
100
101# Specify if to build the G3TOG4 module or not. Default is NO.
102#
103ifneq ($(G4LIB_BUILD_G3TOG4),)
104  G4LIB_BUILD_G3TOG4 = 1
105  G4LIB_USE_G3TOG4 = 1
106endif
107
108# Specify if to build the ZLIB module or not. Default is NO.
109#
110ifneq ($(G4LIB_BUILD_ZLIB),)
111  G4LIB_BUILD_ZLIB = 1
112  G4LIB_USE_ZLIB = 1
113endif
114
115# Allow to disable building of physics_lists module. Default is to build these
116#
117ifneq ($(G4LIB_BUILD_LISTS),NO)
118  G4LIB_BUILD_LISTS = 1
119endif
120
121# If not specified, the default path for G4 binaries G4BIN is
122# set to $G4WORKDIR/bin/$G4SYSTEM ...
123#
124ifndef G4BIN
125  G4BIN := $(G4WORKDIR)/bin
126endif
127G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4BIN) ] && mkdir -p $(G4BIN) )
128
129# If G4DEBUG or G4NO_OPTIMISE are not specified,
130# the default compilation is optimised ...
131#
132ifdef G4DEBUG
133  CPPFLAGS += -DG4DEBUG
134  G4DEBUG := 1
135else
136  ifndef G4NO_OPTIMISE
137    CPPFLAGS += -DG4OPTIMISE
138    G4OPTIMISE := 1
139  endif
140endif
141
142# CLHEP path, etc.
143#
144ifndef CLHEP_BASE_DIR
145  CLHEP_BASE_DIR    := $(shell ls CLHEP_BASE_DIR--UNDEFINED)
146endif
147ifndef CLHEP_INCLUDE_DIR
148  CLHEP_INCLUDE_DIR := $(CLHEP_BASE_DIR)/include
149endif
150ifndef CLHEP_LIB_DIR
151  CLHEP_LIB_DIR     := $(CLHEP_BASE_DIR)/lib
152endif
153ifndef CLHEP_LIB
154  ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
155    CLHEP_LIB := CLHEP.lib
156  else
157    CLHEP_LIB := CLHEP
158#
159# If using the "granular" libraries of CLHEP, uncomment below
160#
161#   CLHEP_LIB := CLHEP-HepMC -l CLHEP-Geometry -l CLHEP-Random -l CLHEP-Vector
162  endif
163endif
164
165# Paths for G4 data
166#
167ifndef G4DATA
168  G4DATA := $(G4INSTALL)/data
169endif
170
171# Photon evaporation data
172#
173ifndef G4LEVELGAMMADATA
174  G4LEVELGAMMADATA := $(G4DATA)/PhotonEvaporation
175endif
176
177# Toggle variables (positional qualifiers) between WIN32-VC and UNIX...
178#
179ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
180  OUT_OBJ := -TP '-Fo'
181  FOR_OBJ := '-Fo'
182  OUT_LIB := '-out:'
183  OUT_EXE := '-Fe'
184  LIB_PATH := '-libpath:'
185  CERNLIB_PATH := "c:\cern\pro\lib"
186  PATH_DEL := \\
187  #
188  # pattern for next substitution
189  #
190  LIB_PATT  := lib(LibName).a
191  FLIB_PATT := (LibName).lib
192else
193  OUT_OBJ := -o
194  FOR_OBJ := -o
195  OUT_LIB :=
196  OUT_EXE := -o
197  LIB_PATH := -L
198  CERNLIB_PATH := /cern/pro/lib
199  PATH_DEL := /
200  #
201  # pattern for next substitution
202  #
203  LIB_PATT  := -l(LibName)
204  FLIB_PATT := $(LIB_PATT)
205endif
206
207# Variables for implicit rules, etc., as suggested in GNU Make manual...
208#
209CPPFLAGS  += -Iinclude
210CPPFLAGS  += -I$(CLHEP_INCLUDE_DIR)
211
212# Positional qualifiers in action...
213#
214ifndef LDFLAGS
215  LDFLAGS :=
216endif
217ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
218  LDFLAGS   += -link $(LIB_PATH)$(CLHEP_LIB_DIR)
219  LOADLIBS  := $(CLHEP_LIB)
220else
221  LDFLAGS   += -L$(CLHEP_LIB_DIR)
222  LOADLIBS  := -l$(CLHEP_LIB)
223  LOADLIBS  += -lm
224  ifdef G4LIB_USE_ZLIB
225    ifndef G4LIB_BUILD_ZLIB
226      LOADLIBS += -lz
227    endif
228  endif
229endif
230
231# Graphic variables...
232#
233ifndef VISLIBS
234  VISLIBS :=
235endif
236#
237# ---------------- OpenGL --------------------
238# The user can define his own values of OGLFLAGS and OGLLIBS.
239# OGLFLAGS gives the directory containing include files.
240#   E.g.: OGLFLAGS  := -I$(OGLHOME)/include
241# OGLLIBS gives the libraries.
242#   E.g.: OGLLIBS   := -L$(OGLHOME)/lib -lGLU -lGL
243#   Or  : OGLLIBS   := -L$(OGLHOME)/lib -lMesaGLU -lMesaGL
244# OGLHOME is often /usr or /usr/local.  In such case, it is not necessary
245# to specify the path in OGLFLAGS, since added already by default by the
246# compiler.  OGLHOME can also point to a special installation.
247# If the user does not set his/her own values, system-dependent values
248# are set below.  Most system-dependent code assumes OGLHOME is set.
249#
250# ------------- OpenInventor -----------------
251# The path to the installation of OpenInventor must be specified
252# if the package is installed in a location different
253# than default system directories (like... /usr or /usr/local).
254#
255ifndef OIVHOME
256  OIVHOME  := /usr/local/Inventor
257endif
258ifndef OIVFLAGS
259  OIVFLAGS  := -I$(OIVHOME)/include
260endif
261ifndef OIVLIBS
262  OIVLIBS   := -L$(OIVHOME)/lib -lInventorXt -lInventor
263endif
264
265# For cfront compilers the repository location is set to
266# $G4TMP/$G4SYSTEM/g4.ptrepository.
267#
268G4TEMPLATE_REPOSITORY := $(G4SYSTEM)/g4.ptrepository
269G4TEMPEXEC_REPOSITORY := $(G4TEMPLATE_REPOSITORY)/exec
270G4TREP := $(G4TMP)/$(G4TEMPLATE_REPOSITORY)
271
272# Default archive call. Changed for: SUN-CC.
273#
274AR := ar r
275
276# Default echo used with makedepend. Changed for SUN-CC, Linux-g++, WIN32.
277#
278ECHO:= echo
279
280# Default grep used with source/GNUmakefile.  Changed for SUN-CC.
281#
282GREP := grep
283
284# Default cut used with source/GNUmakefile.  Changed for WIN32.
285#
286CUT := cut
287
288# Default cat used with source/GNUmakefile.  Changed for WIN32.
289#
290CAT := cat
291
292# Default sed used with source/GNUmakefile.  Changed for WIN32.
293#
294SED := sed
295
296# Include architecture dependent setups...
297#
298include $(G4INSTALL)/config/sys/$(G4SYSTEM).gmk
299
300#  make certain that OGLFLAGS does NOT contain -I/usr/include
301#   caused by OGLHOME being /usr, as e.g. on Linux
302#
303ifdef OGLFLAGS
304  OGLFLAGS:= $(filter-out -I/usr/include,$(OGLFLAGS))
305  OGLFLAGS:= $(filter-out -I/usr//include,$(OGLFLAGS))
306endif
307       
308       
309# If there is no cbrt() function...
310#
311ifdef G4_NO_CBRT
312  CPPFLAGS += -DG4_NO_CBRT
313endif
314
315# Verbosity code can be left out (for better performance)
316# by defining G4_NO_VERBOSE.
317#
318ifndef G4_NO_VERBOSE
319  CPPFLAGS += -DG4VERBOSE
320endif
321
322# Trajectory related classes can be left out (for better performance)
323# by defining G4_NO_STORE_TRAJECTORY.
324#
325ifndef G4_NO_STORE_TRAJECTORY
326  CPPFLAGS += -DG4_STORE_TRAJECTORY
327endif
328
329# Template setup - repositories, special options etc
330#
331ifdef CFRONT_G4TEMPLATE_REPOSITORY
332  ifeq ($(findstring DEC,$(G4SYSTEM)),DEC)
333      ifdef G4EXEC_BUILD
334        CXXTEMPLATE_FLAGS := -ptr $(G4TREP)/exec -ptr $(G4TREP)
335      else
336        CXXTEMPLATE_FLAGS := -ptr $(G4TREP)
337      endif
338  else
339      ifdef G4EXEC_BUILD
340        CXXTEMPLATE_FLAGS := -ptr$(G4TREP)/exec -ptr$(G4TREP)
341      else
342        CXXTEMPLATE_FLAGS := -ptr$(G4TREP)
343      endif
344  endif
345  CXXFLAGS += $(CXXTEMPLATE_FLAGS)
346  CFRONT := true
347endif
348ifdef CFRONT
349  G4TEMPLATE_REPOSITORY_PARENT := $(shell echo $(G4TREP) | sed 's!/[^/][^/]*/*$$!!' )
350  G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TEMPLATE_REPOSITORY_PARENT) ] && mkdir -p $(G4TEMPLATE_REPOSITORY_PARENT) )
351  G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TREP) ] && mkdir -p $(G4TREP) )
352  G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TREP)/exec ] &&mkdir -p $(G4TREP)/exec )
353endif
354
355# If G4SYSTEM is not specified or not valid, issue an ERROR !
356#
357#$(G4INSTALL)/config/sys/$(G4SYSTEM).gmk:
358#       @echo "ERROR - G4SYSTEM is not defined in the environment"
359#       @echo "        or $(G4SYSTEM) architecture is not a valid one !"
360#       exit 1
Note: See TracBrowser for help on using the repository browser.