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

Last change on this file since 610 was 606, checked in by garnier, 18 years ago

r647@mac-90108: laurentgarnier | 2007-11-15 11:32:46 +0100
Ok en Qt 4.3.0

File size: 9.3 KB
Line 
1# $Id: architecture.gmk,v 1.112 2007/11/02 16:29:06 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# Linux-g++ Linux (Red Hat Enterprise/SCL4), gcc-3.4.6 (default)
17#
18# SUN-CC SunOS 5.8, CC 5.5
19#
20# WIN32-VC Windows/XP and Microsoft Visual C++ 8.0
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# If not specified, the default path for G4 binaries G4BIN is
116# set to $G4WORKDIR/bin/$G4SYSTEM ...
117#
118ifndef G4BIN
119 G4BIN := $(G4WORKDIR)/bin
120endif
121G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4BIN) ] && mkdir -p $(G4BIN) )
122
123# If G4DEBUG or G4NO_OPTIMISE are not specified,
124# the default compilation is optimised ...
125#
126ifdef G4DEBUG
127 CPPFLAGS += -DG4DEBUG
128 G4DEBUG := 1
129else
130 ifndef G4NO_OPTIMISE
131 CPPFLAGS += -DG4OPTIMISE
132 G4OPTIMISE := 1
133 endif
134endif
135
136# CLHEP path, etc.
137#
138ifndef CLHEP_BASE_DIR
139 CLHEP_BASE_DIR := $(shell ls CLHEP_BASE_DIR--UNDEFINED)
140endif
141ifndef CLHEP_INCLUDE_DIR
142 CLHEP_INCLUDE_DIR := $(CLHEP_BASE_DIR)/include
143endif
144ifndef CLHEP_LIB_DIR
145 CLHEP_LIB_DIR := $(CLHEP_BASE_DIR)/lib
146endif
147ifndef CLHEP_LIB
148 ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
149 CLHEP_LIB := CLHEP.lib
150 else
151 CLHEP_LIB := CLHEP
152#
153# If using the "granular" libraries of CLHEP, uncomment below
154#
155# CLHEP_LIB := CLHEP-HepMC -l CLHEP-Geometry -l CLHEP-Random -l CLHEP-Vector
156 endif
157endif
158
159# Paths for G4 data
160#
161ifndef G4DATA
162 G4DATA := $(G4INSTALL)/data
163endif
164
165# Photon evaporation data
166#
167ifndef G4LEVELGAMMADATA
168 G4LEVELGAMMADATA := $(G4DATA)/PhotonEvaporation
169endif
170
171# Toggle variables (positional qualifiers) between WIN32-VC and UNIX...
172#
173ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
174 OUT_OBJ := -TP '-Fo'
175 FOR_OBJ := '-Fo'
176 OUT_LIB := '-out:'
177 OUT_EXE := '-Fe'
178 LIB_PATH := '-libpath:'
179 CERNLIB_PATH := "c:\cern\pro\lib"
180 PATH_DEL := \\
181 #
182 # pattern for next substitution
183 #
184 LIB_PATT := lib(LibName).a
185 FLIB_PATT := (LibName).lib
186else
187 OUT_OBJ := -o
188 FOR_OBJ := -o
189 OUT_LIB :=
190 OUT_EXE := -o
191 LIB_PATH := -L
192 CERNLIB_PATH := /cern/pro/lib
193 PATH_DEL := /
194 #
195 # pattern for next substitution
196 #
197 LIB_PATT := -l(LibName)
198 FLIB_PATT := $(LIB_PATT)
199endif
200
201# Variables for implicit rules, etc., as suggested in GNU Make manual...
202#
203CPPFLAGS += -Iinclude
204CPPFLAGS += -I$(CLHEP_INCLUDE_DIR)
205
206# Positional qualifiers in action...
207#
208ifndef LDFLAGS
209 LDFLAGS :=
210endif
211ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
212 LDFLAGS += -link $(LIB_PATH)$(CLHEP_LIB_DIR)
213 LOADLIBS := $(CLHEP_LIB)
214else
215 LDFLAGS += -L$(CLHEP_LIB_DIR)
216 LOADLIBS := -l$(CLHEP_LIB)
217 LOADLIBS += -lm
218 ifdef G4LIB_USE_ZLIB
219 ifndef G4LIB_BUILD_ZLIB
220 LOADLIBS += -lz
221 endif
222 endif
223endif
224
225# Graphic variables...
226#
227ifndef VISLIBS
228 VISLIBS :=
229endif
230#
231# ---------------- OpenGL --------------------
232# The user can define his own values of OGLFLAGS and OGLLIBS.
233# OGLFLAGS gives the directory containing include files.
234# E.g.: OGLFLAGS := -I$(OGLHOME)/include
235# OGLLIBS gives the libraries.
236# E.g.: OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL
237# Or : OGLLIBS := -L$(OGLHOME)/lib -lMesaGLU -lMesaGL
238# OGLHOME is often /usr or /usr/local. In such case, it is not necessary
239# to specify the path in OGLFLAGS, since added already by default by the
240# compiler. OGLHOME can also point to a special installation.
241# If the user does not set his/her own values, system-dependent values
242# are set below. Most system-dependent code assumes OGLHOME is set.
243
244# ------------- OpenInventor -----------------
245# The path to the installation of OpenInventor must be specified
246# if the package is installed in a location different
247# than default system directories (like... /usr or /usr/local).
248#
249ifndef OIVHOME
250 OIVHOME := /usr/local/Inventor
251endif
252ifndef OIVFLAGS
253 OIVFLAGS := -I$(OIVHOME)/include
254endif
255ifndef OIVLIBS
256 OIVLIBS := -L$(OIVHOME)/lib -lInventorXt -lInventor
257endif
258
259# ----------------- GDML ---------------------
260# Setup path to XERCESC library if GDML plugin build is specified
261#
262ifneq ($(G4LIB_BUILD_GDML),)
263 G4LIB_USE_GDML = 1
264 ifndef XERCESCROOT
265 XERCESCROOT := /usr/local/xercesc
266 endif
267 ifndef GDMLFLAGS
268 GDMLFLAGS := -DG4LIB_USE_GDML -I$(XERCESCROOT)/include
269 endif
270 ifndef GDMLLIBS
271 GDMLLIBS := -L$(XERCESCROOT)/lib -lxerces-depdom -lxerces-c
272 endif
273 CPPFLAGS += $(GDMLFLAGS)
274endif
275
276# For cfront compilers the repository location is set to
277# $G4TMP/$G4SYSTEM/g4.ptrepository.
278#
279G4TEMPLATE_REPOSITORY := $(G4SYSTEM)/g4.ptrepository
280G4TEMPEXEC_REPOSITORY := $(G4TEMPLATE_REPOSITORY)/exec
281G4TREP := $(G4TMP)/$(G4TEMPLATE_REPOSITORY)
282
283# Default archive call. Changed for: SUN-CC.
284#
285AR := ar r
286
287# Default echo used with makedepend. Changed for SUN-CC, Linux-g++, WIN32.
288#
289ECHO:= echo
290
291# Default grep used with source/GNUmakefile. Changed for SUN-CC.
292#
293GREP := grep
294
295# Default cut used with source/GNUmakefile. Changed for WIN32.
296#
297CUT := cut
298
299# Default cat used with source/GNUmakefile. Changed for WIN32.
300#
301CAT := cat
302
303# Default sed used with source/GNUmakefile. Changed for WIN32.
304#
305SED := sed
306
307# Include architecture dependent setups...
308#
309include $(G4INSTALL)/config/sys/$(G4SYSTEM).gmk
310
311# make certain that OGLFLAGS does NOT contain -I/usr/include
312# caused by OGLHOME being /usr, as e.g. on Linux
313#
314ifdef OGLFLAGS
315 OGLFLAGS:= $(filter-out -I/usr/include,$(OGLFLAGS))
316 OGLFLAGS:= $(filter-out -I/usr//include,$(OGLFLAGS))
317endif
318
319# If there is no cbrt() function...
320#
321ifdef G4_NO_CBRT
322 CPPFLAGS += -DG4_NO_CBRT
323endif
324
325# Verbosity code can be left out (for better performance)
326# by defining G4_NO_VERBOSE.
327#
328ifndef G4_NO_VERBOSE
329 CPPFLAGS += -DG4VERBOSE
330endif
331
332# Trajectory related classes can be left out (for better performance)
333# by defining G4_NO_STORE_TRAJECTORY.
334#
335ifndef G4_NO_STORE_TRAJECTORY
336 CPPFLAGS += -DG4_STORE_TRAJECTORY
337endif
338
339# Template setup - repositories, special options etc
340#
341ifdef CFRONT_G4TEMPLATE_REPOSITORY
342 ifeq ($(findstring DEC,$(G4SYSTEM)),DEC)
343 ifdef G4EXEC_BUILD
344 CXXTEMPLATE_FLAGS := -ptr $(G4TREP)/exec -ptr $(G4TREP)
345 else
346 CXXTEMPLATE_FLAGS := -ptr $(G4TREP)
347 endif
348 else
349 ifdef G4EXEC_BUILD
350 CXXTEMPLATE_FLAGS := -ptr$(G4TREP)/exec -ptr$(G4TREP)
351 else
352 CXXTEMPLATE_FLAGS := -ptr$(G4TREP)
353 endif
354 endif
355 CXXFLAGS += $(CXXTEMPLATE_FLAGS)
356 CFRONT := true
357endif
358ifdef CFRONT
359 G4TEMPLATE_REPOSITORY_PARENT := $(shell echo $(G4TREP) | sed 's!/[^/][^/]*/*$$!!' )
360 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TEMPLATE_REPOSITORY_PARENT) ] && mkdir -p $(G4TEMPLATE_REPOSITORY_PARENT) )
361 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TREP) ] && mkdir -p $(G4TREP) )
362 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TREP)/exec ] &&mkdir -p $(G4TREP)/exec )
363endif
364
365# If G4SYSTEM is not specified or not valid, issue an ERROR !
366#
367#$(G4INSTALL)/config/sys/$(G4SYSTEM).gmk:
368# @echo "ERROR - G4SYSTEM is not defined in the environment"
369# @echo " or $(G4SYSTEM) architecture is not a valid one !"
370# exit 1
Note: See TracBrowser for help on using the repository browser.