#======================================== # Makefile for MpdRoot Analysis team # by V. Kireyeu and A. Mudrokh # v2017-04-18 # # This Makefile uses for analysis script # compilation via the system compiler. # Please do not forget to run config.sh # script from MpdRoot build directory!!! # ======================================= # Used compiler CC=g++ ROOTCINT := rootcint ROOTCONFIG := root-config # Path to the MpdRoot installation #MPDROOTDIR := /lustre/nyx/hades/user/parfenov/Soft/MPDROOT/mpdroot_dev_240718 #MPDROOTDIR := ${VMCWORKDIR} MPDROOTDIR := /lustre/nyx/hades/user/parfenov/Soft/MPDROOT/mpdroot_dev_260719/ FAIRINCDIR := $(shell $(ROOTCONFIG) --prefix)/include/ FAIRROOTDIR := /lustre/nyx/hades/user/parfenov/Soft/FAIRROOT/fairroot_18_04 #FAIRROOTDIR := /lustre/nyx/hades/user/parfenov/Soft/FAIRSOFT/fairroot_v17_10b CFLAGS := $(shell $(ROOTCONFIG) --cflags) CFLAGS += --std=c++11 -O2 CFLAGS += -I${FAIRROOTDIR}/install/include INCL := -I$(FAIRROOTDIR)/base/event INCL += -I$(FAIRROOTDIR)/base/source INCL += -I$(FAIRROOTDIR)/base/steer INCL += -I$(FAIRROOTDIR)/base/field INCL += -I$(FAIRROOTDIR)/base/sim INCL += -I$(FAIRROOTDIR)/geobase INCL += -I$(MPDROOTDIR)/tpc INCL += -I$(MPDROOTDIR)/kalman INCL += -I$(MPDROOTDIR)/lhetrack INCL += -I$(MPDROOTDIR)/mcstack INCL += -I$(MPDROOTDIR)/strawendcap INCL += -I$(MPDROOTDIR)/etof INCL += -I$(MPDROOTDIR)/tof INCL += -I$(MPDROOTDIR)/sft INCL += -I$(MPDROOTDIR)/sts INCL += -I$(FAIRROOTDIR)/parbase INCL += -I$(MPDROOTDIR)/mpddst INCL += -I$(MPDROOTDIR)/mpdbase INCL += -I$(FAIRROOTDIR)/fairtools INCL += -I$(MPDROOTDIR)/clustering INCL += -I$(MPDROOTDIR)/geometry INCL += -I$(MPDROOTDIR)/mpdpid INCL += -I$(MPDROOTDIR)/passive INCL += -I$(MPDROOTDIR)/cpc INCL += -I$(MPDROOTDIR)/generators INCL += -I$(MPDROOTDIR)/mpdfield INCL += -I$(FAIRROOTDIR)/geane INCL += -I$(MPDROOTDIR)/zdc INCL += -I$(FAIRINCDIR) LDFLAGS := $(shell $(ROOTCONFIG) --ldflags) LDFLAGS += $(shell $(ROOTCONFIG) --glibs) LDFLAGS += -L$(MPDROOTDIR)/build/lib LDFLAGS += -L$(FAIRROOTDIR)/build/lib LDFLAGS += -lMpdField -lFairTools -lGeoBase -lBase -lMCStack -lPassive -lTrkBase LDFLAGS += -lMpdBase -lMpdDst -lMpdGeneralGenerator -lKalman -lGeane -lCluster LDFLAGS += -ltpc -lTof -lEtof -lStrawendcap -lZdc -lFfd -lCpc -lStrawECT LDFLAGS += -lLHETrack -lSts -lMpdPid # Makefile will proceed all files with .cc suffix # SOURCES=$(wildcard src/*.cc) # Output executable has the same name without suffix # OBJECTS=$(patsubst src/%.cc,%, $(SOURCES)) BIN_SOURCES = reducedTreeCreator.C BIN_OBJECTS = $(patsubst %.C,%, $(BIN_SOURCES)) # Library LIB_SOURCES = reducedTreeCreator.C LIB_OBJECTS = $(patsubst %.C,%.so, $(LIB_SOURCES)) # Dict DICT_SOURCES = $(patsubst %.C,%.h, $(LIB_SOURCES)) DICT_SOURCES += $(patsubst %.C,%.LinkDef.h, $(LIB_SOURCES)) DICT_OBJECTS = $(patsubst %.C,%.Dict.cxx, $(LIB_SOURCES)) DICT_HEADER = $(patsubst %.C,%.Dict.h, $(LIB_SOURCES)) all: $(DICT_OBJECTS) $(LIB_OBJECTS) $(BIN_OBJECTS) $(DICT_OBJECTS): @echo "Generating dictionary..." $(ROOTCINT) -f $@ -c -inlineInputHeader $(INCL) $(DICT_SOURCES) $(LIB_OBJECTS): @echo "Generating library..." $(CC) -shared -o $@ -fPIC $(CFLAGS) $(INCL) $(LDFLAGS) $(DICT_OBJECTS) $(BIN_OBJECTS): $(BIN_SOURCES) @echo "Generating executable..." $(CC) $(CFLAGS) $(INCL) $(LDFLAGS) -Wl,-rpath=. $(LIB_OBJECTS) $< -o $@ clean: if [ -f $(DICT_HEADER) ]; then rm -vf $(DICT_OBJECTS) $(DICT_HEADER) ; fi if [ -f $(DICT_OBJECTS) ]; then rm -vf $(DICT_OBJECTS) $(DICT_HEADER) ; fi if [ -f $(LIB_OBJECTS) ]; then rm -vf $(LIB_OBJECTS) ; fi if [ -f $(BIN_OBJECTS) ]; then rm -vf $(BIN_OBJECTS) ; fi