| 3 |
############################### geant4vmc Makefile ########################### |
############################### geant4vmc Makefile ########################### |
| 4 |
|
|
| 5 |
|
|
| 6 |
PACKAGE = Pam_VMC |
PACKAGE = PamVMC_fc |
| 7 |
|
|
| 8 |
ifeq ($(PLATFORM),) |
ifeq ($(PLATFORM),) |
| 9 |
PLATFORM = $(shell root-config --arch) |
PLATFORM = $(shell root-config --arch) |
| 10 |
endif |
endif |
| 11 |
|
|
| 12 |
TOPDIR = $(G4VMC_DIR) |
TOPDIR = $(PWD) |
| 13 |
BINDIR = $(G4WORKDIR)/tmp/tgt_$(PLATFORM)/$(PACKAGE) |
BINDIR = $(TOPDIR)/tmp/tgt_$(PLATFORM)/$(PACKAGE) |
| 14 |
LIBDIR = $(G4WORKDIR)/lib/tgt_$(PLATFORM) |
LIBDIR = $(TOPDIR)/lib/tgt_$(PLATFORM) |
| 15 |
|
#BINDIR = $(G4WORKDIR)/tmp/tgt_$(PLATFORM)/$(PACKAGE) |
| 16 |
|
#LIBDIR = $(G4WORKDIR)/lib/tgt_$(PLATFORM) |
| 17 |
|
|
| 18 |
ifeq ($(ROOTSYS),) |
ifeq ($(ROOTSYS),) |
| 19 |
ROOT_INCDIR = $(shell root-config --incdir) |
ROOT_INCDIR = $(shell root-config --incdir) |
| 20 |
ROOT_BINDIR = $(shell root-config --prefix)/bin |
ROOT_BINDIR = $(shell root-config --prefix)/bin |
| 21 |
|
ROOT_ETCDIR = $(shell root-config --prefix)/etc/vmc |
| 22 |
else |
else |
| 23 |
ROOT_INCDIR = $(ROOTSYS)/include |
ROOT_INCDIR = $(ROOTSYS)/include |
| 24 |
ROOT_BINDIR = $(ROOTSYS)/bin |
ROOT_BINDIR = $(ROOTSYS)/bin |
| 25 |
|
ROOT_ETCDIR = $(ROOTSYS)/etc/vmc |
| 26 |
endif |
endif |
| 27 |
|
|
| 28 |
include $(TOPDIR)/config/Makefile.$(PLATFORM) |
include $(ROOT_ETCDIR)/Makefile.$(PLATFORM) |
| 29 |
|
|
| 30 |
############################### Sources ####################################### |
############################### Sources ####################################### |
| 31 |
|
|
| 32 |
# Rules |
# Rules |
| 33 |
# |
# |
| 34 |
include $(TOPDIR)/config/MakeRules |
include $(ROOT_ETCDIR)/MakeRules |
| 35 |
|
|
| 36 |
# Dictionary |
# Dictionary |
| 37 |
# |
# |
| 38 |
GDICT := $(BINDIR)/$(PACKAGE)Cint.cxx |
GDICT := $(BINDIR)/$(PACKAGE)Cint.cxx |
| 39 |
GDICTH := $(GDICT:.cxx=.h) |
GDICTH := $(GDICT:.cxx=.h) |
| 40 |
GDICTO := $(patsubst %.cxx,$(BINDIR)/%.o,$(GDICT)) |
GDICTO := $(patsubst %.cxx,%.o,$(GDICT)) |
| 41 |
|
|
| 42 |
# Sources |
# Sources |
| 43 |
# |
# |
| 44 |
CXXSRC := $(wildcard src/*.cxx) |
CXXSRC := $(wildcard src/*.cxx) |
| 45 |
SRCS := $(CXXSRC) |
CALSRC := $(wildcard cal/src/*.cxx) |
| 46 |
|
TRKSRC := $(wildcard trk/src/*.cxx) |
| 47 |
|
TRKFSRCS :=$(wildcard trk/src/f77/*.F) |
| 48 |
|
TOFSRC := $(wildcard tof/src/*.cxx) |
| 49 |
|
ACSRC := $(wildcard ac/src/*.cxx) |
| 50 |
|
S4SRC := $(wildcard s4/src/*.cxx) |
| 51 |
|
NDSRC := $(wildcard nd/src/*.cxx) |
| 52 |
|
|
| 53 |
|
|
| 54 |
|
SRCS := $(CXXSRC) $(CALSRC) $(TRKSRC) $(TOFSRC) $(ACSRC) $(S4SRC) $(NDSRC) |
| 55 |
|
FSRCS := $(TRKFSRCS) |
| 56 |
|
|
| 57 |
|
|
| 58 |
# C++ Headers |
# C++ Headers |
| 59 |
# |
# |
| 60 |
HDRS := $(wildcard inc/*.h) |
HDRS := $(wildcard include/*.h) |
| 61 |
HDRS := $(filter-out inc/$(PACKAGE)LinkDef.h,$(HDRS)) |
HDRS += $(wildcard cal/include/*.h) |
| 62 |
HDRS += inc/$(PACKAGE)LinkDef.h |
HDRS += $(wildcard trk/include/*.h) |
| 63 |
|
HDRS += $(wildcard tof/include/*.h) |
| 64 |
|
HDRS += $(wildcard ac/include/*.h) |
| 65 |
|
HDRS += $(wildcard s4/include/*.h) |
| 66 |
|
HDRS += $(wildcard nd/include/*.h) |
| 67 |
|
|
| 68 |
|
HDRS := $(filter-out include/$(PACKAGE)LinkDef.h,$(HDRS)) |
| 69 |
|
HDRS += include/$(PACKAGE)LinkDef.h |
| 70 |
|
|
| 71 |
# Objects |
# Objects |
| 72 |
# |
# |
| 73 |
CXXOBJ := $(patsubst %.cxx,$(BINDIR)/%.o,$(CXXSRC)) |
CXXOBJ := $(patsubst %.cxx,$(BINDIR)/%.o,$(SRCS)) |
| 74 |
OBJS := $(CXXOBJ) $(GDICTO) |
FOBJ := $(patsubst %.F,$(BINDIR)/%.o,$(FSRCS)) |
| 75 |
|
OBJS := $(CXXOBJ) $(GDICTO) $(FOBJ) |
| 76 |
|
|
| 77 |
# PAMELA LIBS |
# PAMELA LIBS |
| 78 |
# |
# |
| 79 |
PAMLIBS := -L${PAM_LIB} -lTrkLevel2 |
PAMLIBS := -L${PAM_LIB} -lTrkLevel2 |
| 80 |
SHLIBS := ${PAMLIBS} |
SHLIBS := ${PAMLIBS} |
| 81 |
# Make include list |
# Make include list |
| 82 |
# |
# |
| 83 |
PAMINC := -I${PAM_INC} -I${PAM_INC}/yoda |
PAMINC := -I$(PAMELA_SOFTWARE)/include/yoda -I$(PAMELA_SOFTWARE)/inc -I${ALIROOT}/source |
| 84 |
INCDIR := -Iinc ${PAMINC} |
INCDIR := -Iinclude $(PAMINC) \ |
| 85 |
|
-Ical/include \ |
| 86 |
|
-Itrk/include \ |
| 87 |
|
-Itof/include \ |
| 88 |
|
-Iac/include \ |
| 89 |
|
-Is4/include \ |
| 90 |
|
-Ind/include \ |
| 91 |
|
-I$(G4VMC_DIR)/include \ |
| 92 |
|
-I$(CLHEP_BASE_DIR)/include \ |
| 93 |
|
-Iinclude -I$(G4INCLUDE) |
| 94 |
|
|
| 95 |
|
FINCDIR := -Itrk/include/f77 |
| 96 |
# C++ compilation flags |
# C++ compilation flags |
| 97 |
# |
# |
| 98 |
CXXFLAGS := $(CXXOPTS) -I. $(INCDIR) -I$(ROOT_INCDIR) ${PAMOPTS} |
CXXFLAGS := $(CXXOPTS) -I. $(INCDIR) -I$(ROOT_INCDIR) ${PAMOPTS} |
| 99 |
|
FFLAGS := $(FINCDIR) -fvxt -fno-automatic -Wno-globals |
| 100 |
|
|
| 101 |
DEPINC += -I. -I$(ROOT_INCDIR) $(INCDIR) |
DEPINC += -I. -I$(ROOT_INCDIR) $(INCDIR) |
| 102 |
|
|
| 103 |
############################### Targets ####################################### |
############################### Targets ####################################### |
| 104 |
|
|
| 105 |
|
RM_FILE=$(shell rm -f $(LIBDIR)/resxy_new.root)\ |
| 106 |
|
$(shell rm -f $(LIBDIR)/CalibTrk_00110_000_000.root) |
| 107 |
|
|
| 108 |
|
AUXDIR='aux' |
| 109 |
|
CP_FILE=$(shell mkdir -p ${LIBDIR})\ |
| 110 |
|
$(shell cp -rf ${AUXDIR}/resxy_new.root ${AUXDIR}/CalibTrk_00110_000_000.root ${LIBDIR}/) |
| 111 |
|
|
| 112 |
SLIBRARY = $(LIBDIR)/lib$(PACKAGE).$(SL) |
SLIBRARY = $(LIBDIR)/lib$(PACKAGE).$(SL) |
| 113 |
ALIBRARY = $(LIBDIR)/lib$(PACKAGE).a |
ALIBRARY = $(LIBDIR)/lib$(PACKAGE).a |
| 115 |
default: depend $(SLIBRARY) |
default: depend $(SLIBRARY) |
| 116 |
|
|
| 117 |
|
|
| 118 |
$(LIBDIR)/lib$(PACKAGE).$(SL): $(OBJS) |
$(LIBDIR)/lib$(PACKAGE).$(SL):$(CP_FILE) $(OBJS) $(FOBS) |
| 119 |
$(LIBDIR)/lib$(PACKAGE).a: $(OBJS) |
|
| 120 |
|
$(LIBDIR)/lib$(PACKAGE).a: $(CP_FILE) $(OBJS) $(FOBS) |
| 121 |
|
|
| 122 |
DICT:= $(GDICT) |
DICT:= $(GDICT) |
| 123 |
|
|
| 124 |
$(DICT): $(HDRS) |
$(DICT): $(HDRS) |
| 125 |
|
|
| 126 |
depend: $(SRCS) |
depend: $(SRCS) $(FSRCS) |
| 127 |
|
|
| 128 |
|
TOCLEAN = $(BINDIR) $(RM_FILE) |
| 129 |
|
TOCLEANALL = $(BINDIR) $(LIBDIR) $(RM_FILE) |
| 130 |
|
|
| 131 |
TOCLEAN = $(BINDIR) |
include $(ROOT_ETCDIR)/MakeMacros |
|
TOCLEANALL = $(BINDIR) $(LIBDIR) |
|
| 132 |
|
|
|
include $(TOPDIR)/config/MakeMacros |
|
| 133 |
|
|
| 134 |
############################### Dependencies ################################## |
############################### Dependencies ################################## |
| 135 |
|
|