source: trunk/config/architecture.gmk@ 1224

Last change on this file since 1224 was 1045, checked in by garnier, 17 years ago

maj en aussi sur CVS

File size: 9.7 KB
Line 
1# $Id: architecture.gmk,v 1.120 2009/01/26 11:08:02 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# Darwin-g++ MacOSX 10.5, gcc-4.0.1
19#
20# WIN32-VC Windows/XP and Microsoft Visual C++ 9.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 ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
272 GDMLLIBS := $(LIB_PATH)$(XERCESCROOT)/lib xerces-c.lib
273 else
274 GDMLLIBS := -L$(XERCESCROOT)/lib -lxerces-c
275 endif
276 endif
277 CPPFLAGS += $(GDMLFLAGS)
278endif
279
280# For cfront compilers the repository location is set to
281# $G4TMP/$G4SYSTEM/g4.ptrepository.
282#
283G4TEMPLATE_REPOSITORY := $(G4SYSTEM)/g4.ptrepository
284G4TEMPEXEC_REPOSITORY := $(G4TEMPLATE_REPOSITORY)/exec
285G4TREP := $(G4TMP)/$(G4TEMPLATE_REPOSITORY)
286
287# Default archive call. Changed for: SUN-CC.
288#
289AR := ar r
290
291# Default echo used with makedepend. Changed for SUN-CC, Linux-g++, WIN32.
292#
293ECHO:= echo
294
295# Default grep used with source/GNUmakefile. Changed for SUN-CC.
296#
297GREP := grep
298
299# Default cut used with source/GNUmakefile. Changed for WIN32.
300#
301CUT := cut
302
303# Default cat used with source/GNUmakefile. Changed for WIN32.
304#
305CAT := cat
306
307# Default sed used with source/GNUmakefile. Changed for WIN32.
308#
309SED := sed
310
311# Default find used with source/GNUmakefile. Changed for WIN32.
312#
313FIND := find
314
315# Default sort used with source/GNUmakefile. Changed for WIN32.
316#
317SORT := sort
318
319# Default touch used with source/GNUmakefile. Changed for WIN32.
320#
321TOUCH := touch
322
323# Include architecture dependent setups...
324#
325include $(G4INSTALL)/config/sys/$(G4SYSTEM).gmk
326
327# make certain that OGLFLAGS does NOT contain -I/usr/include
328# caused by OGLHOME being /usr, as e.g. on Linux
329#
330ifdef OGLFLAGS
331 OGLFLAGS:= $(filter-out -I/usr/include,$(OGLFLAGS))
332 OGLFLAGS:= $(filter-out -I/usr//include,$(OGLFLAGS))
333endif
334
335# If there is no cbrt() function...
336#
337ifdef G4_NO_CBRT
338 CPPFLAGS += -DG4_NO_CBRT
339endif
340
341# Verbosity code can be left out (for better performance)
342# by defining G4_NO_VERBOSE.
343#
344ifndef G4_NO_VERBOSE
345 CPPFLAGS += -DG4VERBOSE
346endif
347
348# Trajectory related classes can be left out (for better performance)
349# by defining G4_NO_STORE_TRAJECTORY.
350#
351ifndef G4_NO_STORE_TRAJECTORY
352 CPPFLAGS += -DG4_STORE_TRAJECTORY
353endif
354
355# Template setup - repositories, special options etc
356#
357ifdef CFRONT_G4TEMPLATE_REPOSITORY
358 ifeq ($(findstring DEC,$(G4SYSTEM)),DEC)
359 ifdef G4EXEC_BUILD
360 CXXTEMPLATE_FLAGS := -ptr $(G4TREP)/exec -ptr $(G4TREP)
361 else
362 CXXTEMPLATE_FLAGS := -ptr $(G4TREP)
363 endif
364 else
365 ifdef G4EXEC_BUILD
366 CXXTEMPLATE_FLAGS := -ptr$(G4TREP)/exec -ptr$(G4TREP)
367 else
368 CXXTEMPLATE_FLAGS := -ptr$(G4TREP)
369 endif
370 endif
371 CXXFLAGS += $(CXXTEMPLATE_FLAGS)
372 CFRONT := true
373endif
374ifdef CFRONT
375 G4TEMPLATE_REPOSITORY_PARENT := $(shell echo $(G4TREP) | sed 's!/[^/][^/]*/*$$!!' )
376 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TEMPLATE_REPOSITORY_PARENT) ] && mkdir -p $(G4TEMPLATE_REPOSITORY_PARENT) )
377 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TREP) ] && mkdir -p $(G4TREP) )
378 G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TREP)/exec ] &&mkdir -p $(G4TREP)/exec )
379endif
380
381# If G4SYSTEM is not specified or not valid, issue an ERROR !
382#
383#$(G4INSTALL)/config/sys/$(G4SYSTEM).gmk:
384# @echo "ERROR - G4SYSTEM is not defined in the environment"
385# @echo " or $(G4SYSTEM) architecture is not a valid one !"
386# exit 1
Note: See TracBrowser for help on using the repository browser.