Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #========================================
  2. # Makefile for MpdRoot Analysis team
  3. # by V. Kireyeu and A. Mudrokh
  4. # v2017-04-18
  5. #
  6. # This Makefile uses for analysis script
  7. # compilation via the system compiler.
  8. # Please do not forget to run config.sh
  9. # script from MpdRoot build directory!!!
  10. # =======================================
  11. # Used compiler
  12. CC=g++
  13. ROOTCINT := rootcint
  14. ROOTCONFIG := root-config
  15. # Path to the MpdRoot installation
  16. #MPDROOTDIR := /lustre/nyx/hades/user/parfenov/Soft/MPDROOT/mpdroot_dev_240718
  17. #MPDROOTDIR := ${VMCWORKDIR}
  18. MPDROOTDIR := /lustre/nyx/hades/user/parfenov/Soft/MPDROOT/mpdroot_dev_260719/
  19. FAIRINCDIR := $(shell $(ROOTCONFIG) --prefix)/include/
  20. FAIRROOTDIR := /lustre/nyx/hades/user/parfenov/Soft/FAIRROOT/fairroot_18_04
  21. #FAIRROOTDIR := /lustre/nyx/hades/user/parfenov/Soft/FAIRSOFT/fairroot_v17_10b
  22. CFLAGS := $(shell $(ROOTCONFIG) --cflags)
  23. CFLAGS += --std=c++11 -O2
  24. CFLAGS += -I${FAIRROOTDIR}/install/include
  25. INCL := -I$(FAIRROOTDIR)/base/event
  26. INCL += -I$(FAIRROOTDIR)/base/source
  27. INCL += -I$(FAIRROOTDIR)/base/steer
  28. INCL += -I$(FAIRROOTDIR)/base/field
  29. INCL += -I$(FAIRROOTDIR)/base/sim
  30. INCL += -I$(FAIRROOTDIR)/geobase
  31. INCL += -I$(MPDROOTDIR)/tpc
  32. INCL += -I$(MPDROOTDIR)/kalman
  33. INCL += -I$(MPDROOTDIR)/lhetrack
  34. INCL += -I$(MPDROOTDIR)/mcstack
  35. INCL += -I$(MPDROOTDIR)/strawendcap
  36. INCL += -I$(MPDROOTDIR)/etof
  37. INCL += -I$(MPDROOTDIR)/tof
  38. INCL += -I$(MPDROOTDIR)/sft
  39. INCL += -I$(MPDROOTDIR)/sts
  40. INCL += -I$(FAIRROOTDIR)/parbase
  41. INCL += -I$(MPDROOTDIR)/mpddst
  42. INCL += -I$(MPDROOTDIR)/mpdbase
  43. INCL += -I$(FAIRROOTDIR)/fairtools
  44. INCL += -I$(MPDROOTDIR)/clustering
  45. INCL += -I$(MPDROOTDIR)/geometry
  46. INCL += -I$(MPDROOTDIR)/mpdpid
  47. INCL += -I$(MPDROOTDIR)/passive
  48. INCL += -I$(MPDROOTDIR)/cpc
  49. INCL += -I$(MPDROOTDIR)/generators
  50. INCL += -I$(MPDROOTDIR)/mpdfield
  51. INCL += -I$(FAIRROOTDIR)/geane
  52. INCL += -I$(MPDROOTDIR)/zdc
  53. INCL += -I$(FAIRINCDIR)
  54. LDFLAGS := $(shell $(ROOTCONFIG) --ldflags)
  55. LDFLAGS += $(shell $(ROOTCONFIG) --glibs)
  56. LDFLAGS += -L$(MPDROOTDIR)/build/lib
  57. LDFLAGS += -L$(FAIRROOTDIR)/build/lib
  58. LDFLAGS += -lMpdField -lFairTools -lGeoBase -lBase -lMCStack -lPassive -lTrkBase
  59. LDFLAGS += -lMpdBase -lMpdDst -lMpdGeneralGenerator -lKalman -lGeane -lCluster
  60. LDFLAGS += -ltpc -lTof -lEtof -lStrawendcap -lZdc -lFfd -lCpc -lStrawECT
  61. LDFLAGS += -lLHETrack -lSts -lMpdPid
  62. # Makefile will proceed all files with .cc suffix
  63. # SOURCES=$(wildcard src/*.cc)
  64. # Output executable has the same name without suffix
  65. # OBJECTS=$(patsubst src/%.cc,%, $(SOURCES))
  66. BIN_SOURCES = reducedTreeCreator.C
  67. BIN_OBJECTS = $(patsubst %.C,%, $(BIN_SOURCES))
  68. # Library
  69. LIB_SOURCES = reducedTreeCreator.C
  70. LIB_OBJECTS = $(patsubst %.C,%.so, $(LIB_SOURCES))
  71. # Dict
  72. DICT_SOURCES = $(patsubst %.C,%.h, $(LIB_SOURCES))
  73. DICT_SOURCES += $(patsubst %.C,%.LinkDef.h, $(LIB_SOURCES))
  74. DICT_OBJECTS = $(patsubst %.C,%.Dict.cxx, $(LIB_SOURCES))
  75. DICT_HEADER = $(patsubst %.C,%.Dict.h, $(LIB_SOURCES))
  76. all: $(DICT_OBJECTS) $(LIB_OBJECTS) $(BIN_OBJECTS)
  77. $(DICT_OBJECTS):
  78. @echo "Generating dictionary..."
  79. $(ROOTCINT) -f $@ -c -inlineInputHeader $(INCL) $(DICT_SOURCES)
  80. $(LIB_OBJECTS):
  81. @echo "Generating library..."
  82. $(CC) -shared -o $@ -fPIC $(CFLAGS) $(INCL) $(LDFLAGS) $(DICT_OBJECTS)
  83. $(BIN_OBJECTS): $(BIN_SOURCES)
  84. @echo "Generating executable..."
  85. $(CC) $(CFLAGS) $(INCL) $(LDFLAGS) -Wl,-rpath=. $(LIB_OBJECTS) $< -o $@
  86. clean:
  87. if [ -f $(DICT_HEADER) ]; then rm -vf $(DICT_OBJECTS) $(DICT_HEADER) ; fi
  88. if [ -f $(DICT_OBJECTS) ]; then rm -vf $(DICT_OBJECTS) $(DICT_HEADER) ; fi
  89. if [ -f $(LIB_OBJECTS) ]; then rm -vf $(LIB_OBJECTS) ; fi
  90. if [ -f $(BIN_OBJECTS) ]; then rm -vf $(BIN_OBJECTS) ; fi