325 lines
8.3 KiB
Plaintext
325 lines
8.3 KiB
Plaintext
# $Id: architecture.gmk,v 1.84 2002/12/04 14:44:23 gcosmo Exp $
|
|
# ------------------------------------------------------------------------
|
|
# GEANT 4 - Architecture configuration script for GNU Make
|
|
#
|
|
# First implementation: July 7th 1995
|
|
#
|
|
# Description
|
|
# -----------
|
|
# to override variables defined in this script, use "gmake -e", this will
|
|
# cause environment variables to take precedence. In this case watch for
|
|
# inadvertant overrides!
|
|
#
|
|
# List of the supported architectures/compilers and related flavors for
|
|
# the environment variable G4SYSTEM:
|
|
#
|
|
# Linux-g++ Linux (Red Hat 7.3), gcc-2.95.2 or gcc-3.2 (default)
|
|
#
|
|
# SUN-CC SunOS 5.8, CC 5.3 or 5.4
|
|
#
|
|
# WIN32-VC Windows/2000/XP and Microsoft Visual C++ 6.0 - SP5
|
|
# Adding CYGWIN32 tools
|
|
# -------------------------------------------------------------------------
|
|
|
|
MAKEFLAGS= --no-print-directory
|
|
|
|
# If not specified, the default path for G4 installation G4INSTALL is
|
|
# set to $HOME/geant4 ...
|
|
#
|
|
ifndef G4INSTALL
|
|
G4INSTALL := $(HOME)/geant4
|
|
endif
|
|
|
|
# If not specified, the default path for G4 source G4BASE is
|
|
# set to $G4INSTALL/source ...
|
|
#
|
|
ifndef G4BASE
|
|
G4BASE := $(G4INSTALL)/source
|
|
endif
|
|
|
|
# If not specified, the default path for the user's workdir is the same
|
|
# as G4INSTALL ...
|
|
#
|
|
ifndef G4WORKDIR
|
|
G4WORKDIR := $(G4INSTALL)
|
|
endif
|
|
|
|
# If not specified, the default path for temporary files G4TMP is
|
|
# set to $G4WORKDIR/tmp/$G4SYSTEM ...
|
|
#
|
|
ifndef G4TMP
|
|
G4TMP := $(G4WORKDIR)/tmp
|
|
endif
|
|
G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TMP) ] && mkdir -p $(G4TMP) )
|
|
|
|
# If not specified, the default path for G4 libraries G4LIB is
|
|
# set to $G4INSTALL/lib/$G4SYSTEM ...
|
|
#
|
|
ifndef G4LIB
|
|
G4LIB := $(G4INSTALL)/lib
|
|
endif
|
|
G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4LIB) ] && mkdir -p $(G4LIB) )
|
|
G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4LIB)/$(G4SYSTEM) ] && mkdir -p $(G4LIB)/$(G4SYSTEM) )
|
|
|
|
# If not specified, the default path to install G4 include files is G4INCLUDE
|
|
# set to $G4INSTALL/include ...
|
|
#
|
|
ifndef G4INCLUDE
|
|
G4INCLUDE := $(G4INSTALL)/include
|
|
endif
|
|
G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4INCLUDE) ] && mkdir -p $(G4INCLUDE) )
|
|
|
|
# Backwards compatibility
|
|
#
|
|
ifneq ($(G4MAKESHLIB),)
|
|
G4LIB_BUILD_SHARED = 1
|
|
endif
|
|
|
|
# Defaults for library BUILD. No default for USE, ie. take what is found.
|
|
# Default is building static libraries.
|
|
#
|
|
ifeq ($(G4LIB_BUILD_SHARED),)
|
|
ifeq ($(G4LIB_BUILD_STATIC),)
|
|
G4LIB_BUILD_STATIC = 1
|
|
endif
|
|
endif
|
|
|
|
# Specify if to build the G3TOG4 module or not. Default is NO.
|
|
#
|
|
ifneq ($(G4LIB_BUILD_G3TOG4),)
|
|
G4LIB_BUILD_G3TOG4 = 1
|
|
G4USE_G3TOG4 = 1
|
|
endif
|
|
|
|
# If not specified, the default path for G4 binaries G4BIN is
|
|
# set to $G4WORKDIR/bin/$G4SYSTEM ...
|
|
#
|
|
ifndef G4BIN
|
|
G4BIN := $(G4WORKDIR)/bin
|
|
endif
|
|
G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4BIN) ] && mkdir -p $(G4BIN) )
|
|
|
|
# If G4DEBUG or G4NO_OPTIMISE are not specified,
|
|
# the default compilation is optimised ...
|
|
#
|
|
ifdef G4DEBUG
|
|
CPPFLAGS += -DG4DEBUG
|
|
G4DEBUG := 1
|
|
else
|
|
ifndef G4NO_OPTIMISE
|
|
CPPFLAGS += -DG4OPTIMISE
|
|
G4OPTIMISE := 1
|
|
endif
|
|
endif
|
|
|
|
# CLHEP path, etc.
|
|
#
|
|
ifndef CLHEP_BASE_DIR
|
|
CLHEP_BASE_DIR := /afs/cern.ch/sw/geant4/dev/CLHEP/$(G4SYSTEM)/pro
|
|
endif
|
|
ifndef CLHEP_INCLUDE_DIR
|
|
CLHEP_INCLUDE_DIR := $(CLHEP_BASE_DIR)/include
|
|
endif
|
|
ifndef CLHEP_LIB_DIR
|
|
CLHEP_LIB_DIR := $(CLHEP_BASE_DIR)/lib
|
|
endif
|
|
ifndef CLHEP_LIB
|
|
ifeq ($(G4SYSTEM),WIN32-VC)
|
|
CLHEP_LIB := CLHEP.lib
|
|
else
|
|
CLHEP_LIB := CLHEP
|
|
endif
|
|
endif
|
|
|
|
# Paths for G4 data
|
|
#
|
|
ifndef G4DATA
|
|
G4DATA := $(G4INSTALL)/data
|
|
endif
|
|
|
|
# Photon evaporation data
|
|
#
|
|
ifndef G4LEVELGAMMADATA
|
|
G4LEVELGAMMADATA := $(G4DATA)/PhotonEvaporation
|
|
endif
|
|
|
|
# Toggle variables (positional qualifiers) between WIN32-VC and UNIX...
|
|
#
|
|
ifeq ($(G4SYSTEM),WIN32-VC)
|
|
OUT_OBJ := -TP '-Fo'
|
|
FOR_OBJ := '-Fo'
|
|
OUT_LIB := '-out:'
|
|
OUT_EXE := '-Fe'
|
|
LIB_PATH := '-libpath:'
|
|
CERNLIB_PATH := "z:\p32\cern\new\df\lib"
|
|
PATH_DEL := \\
|
|
#
|
|
# pattern for next substitution
|
|
#
|
|
LIB_PATT := lib(LibName).a
|
|
FLIB_PATT := (LibName).lib
|
|
else
|
|
OUT_OBJ := -o
|
|
FOR_OBJ := -o
|
|
OUT_LIB :=
|
|
OUT_EXE := -o
|
|
LIB_PATH := -L
|
|
CERNLIB_PATH := /cern/pro/lib
|
|
PATH_DEL := /
|
|
#
|
|
# pattern for next substitution
|
|
#
|
|
LIB_PATT := -l(LibName)
|
|
FLIB_PATT := $(LIB_PATT)
|
|
endif
|
|
|
|
# Variables for implicit rules, etc., as suggested in GNU Make manual...
|
|
#
|
|
CPPFLAGS += -Iinclude
|
|
CPPFLAGS += -I$(CLHEP_INCLUDE_DIR)
|
|
|
|
# Positional qualifiers in action...
|
|
#
|
|
ifeq ($(G4SYSTEM),WIN32-VC)
|
|
LDFLAGS := -link $(LIB_PATH)$(CLHEP_LIB_DIR)
|
|
LOADLIBS := $(CLHEP_LIB)
|
|
else
|
|
LDFLAGS := -L$(CLHEP_LIB_DIR)
|
|
LOADLIBS := -l$(CLHEP_LIB)
|
|
LOADLIBS += -lm
|
|
endif
|
|
|
|
# Graphic variables...
|
|
#
|
|
ifndef VISLIBS
|
|
VISLIBS :=
|
|
endif
|
|
# ------------------ X11 ---------------------
|
|
X11FLAGS :=
|
|
X11LIBS := -lXmu -lXt -lXext -lX11
|
|
# ----------------- Motif --------------------
|
|
XMFLAGS :=
|
|
XMLIBS := -lXm
|
|
# ---------------- Athena --------------------
|
|
XAWFLAGS :=
|
|
XAWLIBS := -lXaw
|
|
# ---------------- OpenGL --------------------
|
|
# The user can define his own values of OGLFLAGS and OGLLIBS.
|
|
# OGLFLAGS gives the directory containing include files.
|
|
# E.g.: OGLFLAGS := -I$(OGLHOME)/include
|
|
# OGLLIBS gives the libraries.
|
|
# E.g.: OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL
|
|
# Or : OGLLIBS := -L$(OGLHOME)/lib -lMesaGLU -lMesaGL
|
|
# OGLHOME is often /usr or /usr/local. Or it can point to a special
|
|
# installation.
|
|
# If the user does not set his/her own values, system-dependent values
|
|
# are set below. Most system-dependent code assumes OGLHOME is set.
|
|
# ------------- OpenInventor -----------------
|
|
ifndef HEPVISINC
|
|
HEPVISINC := $(HEPVISDIR)/include
|
|
endif
|
|
ifndef HEPVISLIB
|
|
HEPVISLIB := $(HEPVISDIR)/source
|
|
endif
|
|
ifndef OIVFLAGS
|
|
OIVFLAGS := -I${HEPVISINC}
|
|
endif
|
|
ifndef OIVLIBS
|
|
OIVLIBS := -L${HEPVISLIB} -lHEPVis -lInventorXt -lInventor -lGLU -lGL
|
|
endif
|
|
# ----------------- OPACS --------------------
|
|
# lesstiff is bugged for popups ; then OPACS/Xo uses
|
|
# the Xaw widgets for handling popups. The OPACS distrib
|
|
# for Linux assumes that lesstif is used by default. To be
|
|
# coherent we set in Geant4 the default toolkit to lesstif
|
|
# on Linux in order to link with -lXaw, etc...
|
|
ifndef G4_OPACS_WIDGET_SET
|
|
ifeq ($(findstring Linux,$(G4SYSTEM)),Linux)
|
|
G4_OPACS_WIDGET_SET := lesstif
|
|
else
|
|
G4_OPACS_WIDGET_SET := Xm
|
|
endif
|
|
endif
|
|
|
|
# For cfront compilers the repository location is set to
|
|
# $G4TMP/$G4SYSTEM/g4.ptrepository.
|
|
#
|
|
G4TEMPLATE_REPOSITORY := $(G4SYSTEM)/g4.ptrepository
|
|
G4TEMPEXEC_REPOSITORY := $(G4TEMPLATE_REPOSITORY)/exec
|
|
G4TREP := $(G4TMP)/$(G4TEMPLATE_REPOSITORY)
|
|
|
|
# Default archive call. Changed for: SUN-CC.
|
|
#
|
|
AR := ar r
|
|
|
|
# Default echo used with makedepend. Changed for SUN-CC, Linux-g++.
|
|
#
|
|
ECHO:= echo
|
|
|
|
# Default grep used with source/GNUmakfile. Changed for SUN-CC.
|
|
#
|
|
GREP := grep
|
|
|
|
# Include architecture dependent setups...
|
|
#
|
|
include $(G4INSTALL)/config/sys/$(G4SYSTEM).gmk
|
|
|
|
# If compiler recognises implicit C++ type bool...
|
|
#
|
|
ifdef G4_HAVE_BOOL
|
|
CPPFLAGS += -DG4_HAVE_BOOL
|
|
endif
|
|
|
|
# If there is no cbrt() function...
|
|
#
|
|
ifdef G4_NO_CBRT
|
|
CPPFLAGS += -DG4_NO_CBRT
|
|
endif
|
|
|
|
# Verbosity code can be left out (for better performance)
|
|
# by defining G4_NO_VERBOSE.
|
|
#
|
|
ifndef G4_NO_VERBOSE
|
|
CPPFLAGS += -DG4VERBOSE
|
|
endif
|
|
|
|
# Trajectory related classes can be left out (for better performance)
|
|
# by defining G4_NO_STORE_TRAJECTORY.
|
|
#
|
|
ifndef G4_NO_STORE_TRAJECTORY
|
|
CPPFLAGS += -DG4_STORE_TRAJECTORY
|
|
endif
|
|
|
|
# Template setup - repositories, special options etc
|
|
#
|
|
ifdef CFRONT_G4TEMPLATE_REPOSITORY
|
|
ifeq ($(findstring DEC,$(G4SYSTEM)),DEC)
|
|
ifdef G4EXEC_BUILD
|
|
CXXTEMPLATE_FLAGS := -ptr $(G4TREP)/exec -ptr $(G4TREP)
|
|
else
|
|
CXXTEMPLATE_FLAGS := -ptr $(G4TREP)
|
|
endif
|
|
else
|
|
ifdef G4EXEC_BUILD
|
|
CXXTEMPLATE_FLAGS := -ptr$(G4TREP)/exec -ptr$(G4TREP)
|
|
else
|
|
CXXTEMPLATE_FLAGS := -ptr$(G4TREP)
|
|
endif
|
|
endif
|
|
CXXFLAGS += $(CXXTEMPLATE_FLAGS)
|
|
CFRONT := true
|
|
endif
|
|
ifdef CFRONT
|
|
G4TEMPLATE_REPOSITORY_PARENT := $(shell echo $(G4TREP) | sed 's!/[^/][^/]*/*$$!!' )
|
|
G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TEMPLATE_REPOSITORY_PARENT) ] && mkdir -p $(G4TEMPLATE_REPOSITORY_PARENT) )
|
|
G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TREP) ] && mkdir -p $(G4TREP) )
|
|
G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4TREP)/exec ] &&mkdir -p $(G4TREP)/exec )
|
|
endif
|
|
|
|
# If G4SYSTEM is not specified or not valid, issue an ERROR !
|
|
#
|
|
#$(G4INSTALL)/config/sys/$(G4SYSTEM).gmk:
|
|
# @echo "ERROR - G4SYSTEM is not defined in the environment"
|
|
# @echo " or $(G4SYSTEM) architecture is not a valid one !"
|
|
# exit 1
|