# $Id$ #------------------------------------------------ # The Geant4 Virtual Monte Carlo package # Copyright (C) 2007, 2008 Ivana Hrivnacova # All rights reserved. # # For the licensing terms see geant4_vmc/LICENSE. # Contact: vmc@pcroot.cern.ch #------------------------------------------------- # The makefile adopted from the old ALICE Makefiles system, # developped by ALICE Offline project (http://aliceinfo.cern.ch/Offline) ############################### geant4_vmc Makefile ########################### PACKAGE = geant4vmc ifeq ($(PLATFORM),) PLATFORM = $(shell root-config --arch) endif TOPDIR = $(shell pwd)/.. BINDIR = $(TOPDIR)/tmp/tgt_$(PLATFORM) LIBDIR = $(TOPDIR)/lib/tgt_$(PLATFORM) ROOT_INCDIR := $(shell root-config --incdir) ROOT_BINDIR := $(shell root-config --bindir) ROOT_ETCDIR := $(shell root-config --etcdir)/vmc include $(ROOT_ETCDIR)/Makefile.$(PLATFORM) ifneq ($(findstring gcc,$(CC)),) GCC_MAJOR := $(shell $(CC) -dumpversion 2>&1 | cut -d'.' -f1) GCC_MINOR := $(shell $(CC) -dumpversion 2>&1 | cut -d'.' -f2) GCC_VERS := gcc-$(GCC_MAJOR).$(GCC_MINOR) endif ############################### Sources ####################################### # Source directories # GDIRS:= global geometry digits+hits physics physics_list event run visualization # Rules # include $(ROOT_ETCDIR)/MakeRules # Dictionary # GDICT := $(BINDIR)/geant4Cint.cxx GDICTH := $(GDICT:.cxx=.h) GDICTO := $(patsubst %.cxx,%.o,$(GDICT)) # Sources # CXXSRC := $(wildcard $(patsubst %,%/src/*.cxx,$(GDIRS))) SRCS := $(CXXSRC) # C++ Headers processed by CINT # HDRS := run/include/TG4RunConfiguration.h \ run/include/TGeant4.h \ $(wildcard interfaces/include/*.h) \ geant4vmcLinkDef.h # C++ Headers copied to include # HEADERS := $(wildcard $(patsubst %,%/include/*.h,$(GDIRS))) HEADERS += $(wildcard $(patsubst %,%/include/*.icc,$(GDIRS))) # Objects # CXXOBJ := $(patsubst %.cxx,$(BINDIR)/%.o,$(CXXSRC)) OBJS := $(CXXOBJ) $(GDICTO) # Make include list # ifndef G4INCLUDE G4INCLUDE := $(G4INSTALL)/include endif INCDIR := $(patsubst %,-I%/include,$(GDIRS)) \ -I$(G4INCLUDE) \ -I$(CLHEP_BASE_DIR)/include \ -I$(G4INSTALL)/source/interfaces/common/include ifneq ($(USE_VGM),) INCDIR += -I$(VGM_INSTALL)/packages/VGM/include \ -I$(VGM_INSTALL)/packages/ClhepVGM/include \ -I$(VGM_INSTALL)/packages/BaseVGM/include \ -I$(VGM_INSTALL)/packages/Geant4GM/include \ -I$(VGM_INSTALL)/packages/RootGM/include \ -I$(VGM_INSTALL)/packages/XmlVGM/include endif # C++ compilation flags # CXXFLAGS := $(CXXOPTS) $(G4MCDEFS) -I. $(INCDIR) -I$(ROOT_INCDIR) # Debug option # ifdef G4DEBUG CXXFLAGS += -DMCDEBUG endif # Use VGM flag # ifneq ($(USE_VGM),) CXXFLAGS += -DUSE_VGM endif ######################## Supported Geant4 VIS, UI ############################# # # Supported Geant4 VIS, UI setting: # OPENGLX, OPENGLXM, XM, TCSH # ifndef G4VIS_NONE CPPFLAGS += -DG4VIS_USE ifdef G4VIS_USE_OPENGLX G4VIS_USE_OPENGL = 1 CPPFLAGS += -DG4VIS_USE_OPENGLX INC_X11 = 1 endif ifdef G4VIS_USE_OPENGLXM G4VIS_USE_OPENGL = 1 CPPFLAGS += -DG4VIS_USE_OPENGLXM INC_XM = 1 endif ifdef G4VIS_USE_OPENGL CPPFLAGS += -DG4VIS_USE_OPENGL CPPFLAGS += -I$(G4INSTALL)/source/visualization/OpenGL/include INC_GL = 1 endif CPPFLAGS += -I$(G4INSTALL)/source/visualization/management/include CPPFLAGS += -I$(G4INSTALL)/source/visualization/modeling/include endif #G4VIS_NONE ifndef G4UI_NONE CPPFLAGS += -I$(G4INSTALL)/source/interfaces/basic/include CPPFLAGS += -I$(G4INSTALL)/source/interfaces/common/include CPPFLAGS += -I$(G4INSTALL)/source/interfaces/GAG/include CPPFLAGS += -DG4UI_USE_TERMINAL ifdef G4UI_USE_TCSH G4UI_USE = 1 CPPFLAGS += -DG4UI_USE_TCSH endif endif #G4UI_NONE ifdef INC_GL CPPFLAGS += $(OGLFLAGS) endif ifdef INC_XM INC_X11 = 1 CPPFLAGS += $(XMFLAGS) endif ifdef INC_X11 CPPFLAGS += $(X11FLAGS) endif ######################## Full Geant4 VIS, UI ################################## # # Full Geant4 UI, VIS, interactivity setting. # It enables to use all Geant4 graphics drivers and UIs, # however not all these options were tested with Geant4 VMC # and even though a correct behaviour is expected, # it is not guaranteed. # #include $(G4INSTALL)/config/G4UI_USE.gmk #include $(G4INSTALL)/config/G4VIS_USE.gmk #include $(G4INSTALL)/config/interactivity.gmk CXXFLAGS += $(CPPFLAGS) DEPINC += -I. -I$(ROOT_INCDIR) $(INCDIR) ############################### Targets ####################################### SLIBRARY = $(LIBDIR)/lib$(PACKAGE).$(SL) ALIBRARY = $(LIBDIR)/lib$(PACKAGE).a default: depend $(SLIBRARY) includes includes: clean_includes make_includes static: $(ALIBRARY) ifneq ($(USE_VGM),) vgm: @for dir in $(VGM_INSTALL/packages); do (cd $$dir && $(MAKE)); done; endif $(LIBDIR)/lib$(PACKAGE).$(SL): $(OBJS) $(LIBDIR)/lib$(PACKAGE).a: $(OBJS) DICT:= $(GDICT) $(DICT): $(HDRS) depend: $(SRCS) TOCLEAN = $(BINDIR) $(TOPDIR)/include TOCLEANALL = $(BINDIR) $(TOPDIR)/include $(LIBDIR) MAKEDIST = $(ROOT_ETCDIR)/g4_makedist.sh $(GCC_VERS) lib MAKEDISTSRC = $(ROOT_ETCDIR)/g4_makedist.sh include $(ROOT_ETCDIR)/MakeMacros ############################### Dependencies ################################## -include $(BINDIR)/Make-depend