--- PamVMC/Makefile 2007/06/28 07:16:44 1.1 +++ PamVMC/Makefile 2009/06/12 18:38:51 1.5 @@ -2,72 +2,112 @@ ############################### geant4vmc Makefile ########################### +PACKAGE = PamVMC_fc -PACKAGE = Pam_VMC ifeq ($(PLATFORM),) PLATFORM = $(shell root-config --arch) endif -TOPDIR = $(G4VMC_DIR) -BINDIR = $(G4WORKDIR)/tmp/tgt_$(PLATFORM)/$(PACKAGE) -LIBDIR = $(G4WORKDIR)/lib/tgt_$(PLATFORM) +TOPDIR = $(PWD) +BINDIR = $(TOPDIR)/tmp/tgt_$(PLATFORM)/$(PACKAGE) +LIBDIR = $(TOPDIR)/lib/tgt_$(PLATFORM) +#BINDIR = $(G4WORKDIR)/tmp/tgt_$(PLATFORM)/$(PACKAGE) +#LIBDIR = $(G4WORKDIR)/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 -include $(TOPDIR)/config/Makefile.$(PLATFORM) +include $(ROOT_ETCDIR)/Makefile.$(PLATFORM) ############################### Sources ####################################### # Rules # -include $(TOPDIR)/config/MakeRules +include $(ROOT_ETCDIR)/MakeRules # Dictionary # GDICT := $(BINDIR)/$(PACKAGE)Cint.cxx GDICTH := $(GDICT:.cxx=.h) -GDICTO := $(patsubst %.cxx,$(BINDIR)/%.o,$(GDICT)) +GDICTO := $(patsubst %.cxx,%.o,$(GDICT)) # Sources # -CXXSRC := $(wildcard src/*.cxx) -SRCS := $(CXXSRC) +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) + # C++ Headers # -HDRS := $(wildcard inc/*.h) -HDRS := $(filter-out inc/$(PACKAGE)LinkDef.h,$(HDRS)) -HDRS += inc/$(PACKAGE)LinkDef.h +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,$(CXXSRC)) -OBJS := $(CXXOBJ) $(GDICTO) +CXXOBJ := $(patsubst %.cxx,$(BINDIR)/%.o,$(SRCS)) +FOBJ := $(patsubst %.F,$(BINDIR)/%.o,$(FSRCS)) +OBJS := $(CXXOBJ) $(GDICTO) $(FOBJ) # PAMELA LIBS # -PAMLIBS := -L${PAM_LIB} -lTrkLevel2 +PAMLIBS := -L${PAM_LIB} -lTrkLevel2 SHLIBS := ${PAMLIBS} # Make include list # -PAMINC := -I${PAM_INC} -I${PAM_INC}/yoda -INCDIR := -Iinc ${PAMINC} +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 \ + -I$(CLHEP_BASE_DIR)/include \ + -Iinclude -I$(G4INCLUDE) +FINCDIR := -Itrk/include/f77 # C++ compilation flags # -CXXFLAGS := $(CXXOPTS) -I. $(INCDIR) -I$(ROOT_INCDIR) ${PAMOPTS} +CXXFLAGS := $(CXXOPTS) -I. $(INCDIR) $(PAMINC) -I$(ROOT_INCDIR) ${PAMOPTS} +FFLAGS := $(FINCDIR) -fvxt -fno-automatic -Wno-globals 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 ${LIBDIR}/) SLIBRARY = $(LIBDIR)/lib$(PACKAGE).$(SL) ALIBRARY = $(LIBDIR)/lib$(PACKAGE).a @@ -75,19 +115,21 @@ default: depend $(SLIBRARY) -$(LIBDIR)/lib$(PACKAGE).$(SL): $(OBJS) -$(LIBDIR)/lib$(PACKAGE).a: $(OBJS) +$(LIBDIR)/lib$(PACKAGE).$(SL):$(CP_FILE) $(OBJS) $(FOBS) + +$(LIBDIR)/lib$(PACKAGE).a: $(CP_FILE) $(OBJS) $(FOBS) DICT:= $(GDICT) $(DICT): $(HDRS) -depend: $(SRCS) +depend: $(SRCS) $(FSRCS) + +TOCLEAN = $(BINDIR) $(RM_FILE) +TOCLEANALL = $(BINDIR) $(LIBDIR) $(RM_FILE) -TOCLEAN = $(BINDIR) -TOCLEANALL = $(BINDIR) $(LIBDIR) +include $(ROOT_ETCDIR)/MakeMacros -include $(TOPDIR)/config/MakeMacros ############################### Dependencies ##################################