# $Id: Makefile,v 1.0 2007/06/01 ############################### geant4vmc Makefile ########################### PACKAGE = PamVMC_fc EXECUTABLE = bin/PamVMC.exe CXXVERBOSE = 1 ifeq ($(PLATFORM),) PLATFORM = $(shell root-config --arch) endif TOPDIR = $(PWD) BINDIR = $(TOPDIR)/tmp/tgt_$(PLATFORM)/$(PACKAGE) LIBDIR = $(TOPDIR)/lib/tgt_$(PLATFORM) ifeq ($(ROOTSYS),) ROOT_INCDIR = $(shell root-config --incdir) ROOT_BINDIR = $(shell root-config --prefix)/bin ROOT_ETCDIR = $(shell root-config --prefix)/etc/vmc else ROOT_INCDIR = $(ROOTSYS)/include ROOT_BINDIR = $(ROOTSYS)/bin ROOT_ETCDIR = $(ROOTSYS)/etc/vmc endif ROOT_LIBDIR = $(shell root-config --libs) -lVMC -lGeom -lEG -lTMVA -lMinuit -lXMLIO -lXMLParser -lMLP -lTreePlayer CLHEP_LIB = $(shell clheplib) G4_LIBS_PATH = $(wildcard $(G4LIB)/$(G4SYSTEM)/*.so) G4_LIBS = -L$(G4LIB)/$(G4SYSTEM) $(patsubst $(G4LIB)/$(G4SYSTEM)/lib%.so,-l%,$(G4_LIBS_PATH)) G4VMC_LIBDIR = -L$(G4VMC_DIR)/lib/tgt_$(PLATFORM) -lgeant4vmc -lg4root VGM_LIBS_PATH = $(wildcard $(VGM_INSTALL)/lib/$(G4SYSTEM)/*.so) VGM_LIBS = -L$(VGM_INSTALL)/lib/$(G4SYSTEM) $(patsubst $(VGM_INSTALL)/lib/$(G4SYSTEM)/lib%.so,-l%,$(VGM_LIBS_PATH)) G4_RUN_LIB=$(LIBDIR)/libPamG4RunConfiguration.so include $(ROOT_ETCDIR)/Makefile.$(PLATFORM) ############################### Sources ####################################### # Rules # include $(ROOT_ETCDIR)/MakeRules # Dictionary # GDICT := $(BINDIR)/$(PACKAGE)Cint.cxx GDICTH := $(GDICT:.cxx=.h) GDICTO := $(patsubst %.cxx,%.o,$(GDICT)) # Sources # CXXSRC := $(wildcard src/*.cxx) CALSRC := $(wildcard cal/src/*.cxx) TRKSRC := $(wildcard trk/src/*.cxx) TRKFSRCS :=$(wildcard trk/src/f77/*.F) TOFSRC := $(wildcard tof/src/*.cxx) ACSRC := $(wildcard ac/src/*.cxx) S4SRC := $(wildcard s4/src/*.cxx) NDSRC := $(wildcard nd/src/*.cxx) SRCS := $(CXXSRC) $(CALSRC) $(TRKSRC) $(TOFSRC) $(ACSRC) $(S4SRC) $(NDSRC) FSRCS := $(TRKFSRCS) #executable objects EXECO = G4main/PamVMCmain.o EXECS = G4main/PamVMCmain.cxx EXECSO = $(TOPDIR)/lib/tgt_$(PLATFORM)/lib$(PACKAGE).so # C++ Headers # HDRS := $(wildcard include/*.h) HDRS += $(wildcard cal/include/*.h) HDRS += $(wildcard trk/include/*.h) HDRS += $(wildcard tof/include/*.h) HDRS += $(wildcard ac/include/*.h) HDRS += $(wildcard s4/include/*.h) HDRS += $(wildcard nd/include/*.h) HDRS := $(filter-out include/$(PACKAGE)LinkDef.h,$(HDRS)) HDRS += include/$(PACKAGE)LinkDef.h # Objects # CXXOBJ := $(patsubst %.cxx,$(BINDIR)/%.o,$(SRCS)) FOBJ := $(patsubst %.F,$(BINDIR)/%.o,$(FSRCS)) OBJS := $(CXXOBJ) $(GDICTO) $(FOBJ) # PAMELA LIBS # PAM_LIBS_PATH = $(wildcard $(PAM_LIB)/*.so) PAM_LIBS = -L$(PAM_LIB) $(patsubst $(PAM_LIB)/lib%.so,-l%,$(PAM_LIBS_PATH)) SHLIBS := ${PAM_LIBS} # Make include list # PAMINC := -I$(PAM_INC) -I$(PAM_INC)/yoda INCDIR := -Iinclude -I$(TOPDIR) \ -Ical/include \ -Itrk/include \ -Itof/include \ -Iac/include \ -Is4/include \ -Ind/include \ -I$(G4VMC_DIR)/include/geant4vmc \ -I$(CLHEP_BASE_DIR)/include \ -Iinclude -I$(G4INCLUDE) FINCDIR := -Itrk/include/f77 # C++ compilation flags # CXXFLAGS := -m32 $(CXXOPTS) -I. $(INCDIR) $(PAMINC) -I$(ROOT_INCDIR) ${PAMOPTS} FFLAGS := $(FINCDIR) -m32 -fPIC -std=legacy DEPINC += -I. -I$(ROOT_INCDIR) $(INCDIR) ############################### Targets ####################################### RM_FILE=$(shell rm -f $(LIBDIR)/resxy_new.root)\ $(shell rm -f $(LIBDIR)/CalibTrk_00110_000_000.root) AUXDIR='aux' CP_FILE=$(shell mkdir -p ${LIBDIR})\ $(shell cp -rf ${AUXDIR}/resxy_new.root ${AUXDIR}/CalibTrk_00110_000_000.root ${AUXDIR}/parameters_l* ${LIBDIR}/) SLIBRARY = $(LIBDIR)/lib$(PACKAGE).$(SL) ALIBRARY = $(LIBDIR)/lib$(PACKAGE).a default: depend $(SLIBRARY) $(EXECUTABLE) $(LIBDIR)/lib$(PACKAGE).$(SL):$(CP_FILE) $(OBJS) $(FOBS) $(LIBDIR)/lib$(PACKAGE).a: $(CP_FILE) $(OBJS) $(FOBS) DICT:= $(GDICT) $(DICT): $(HDRS) depend: $(SRCS) $(FSRCS) TOCLEAN = $(BINDIR) $(RM_FILE) TOCLEANALL = $(BINDIR) $(LIBDIR) $(RM_FILE) $(EXECO): $(CXX) $(CXXFLAGS) -c $(EXECS) -o $(EXECO) $(EXECUTABLE): $(shell rm -f $(EXECO))\ $(shell rm -f $(EXECUTABLE))\ $(EXECSO) $(EXECO) @echo "Generating executable $@ ..." $(LD) $(LDFLAGS) $(EXECO) $(CXXFLAGS) $(CLHEP_LIB) $(G4VMC_LIBDIR) $(G4_LIBS) $(VGM_LIBS) $(LIBDIR)/lib$(PACKAGE).$(SL) $(PAM_LIBS) $(G4_RUN_LIB) $(ROOT_LIBDIR) -o $@ include $(ROOT_ETCDIR)/MakeMacros ############################### Dependencies ################################## -include $(BINDIR)/Make-depend