Makefile 846 B

1234567891011121314151617181920212223242526272829303132
  1. # Define compiler
  2. CXX = g++
  3. # Define flags. -D_VANILLA_ROOT_ is needed to avoid StMessMgr confusion
  4. CFLAGS = $(shell root-config --cflags) -O2 -fPIC -Wall -pipe -std=c++17 -D_VANILLA_ROOT_ -I.
  5. LIBS = $(shell root-config --libs)
  6. INCS = $(shell root-config --incdir)
  7. # Define output library
  8. STFEMTODST = libStFemtoDst.so
  9. # Compile all *.cxx classes in the directory
  10. SRC = $(shell find . -name "*.cxx")
  11. all: $(STFEMTODST)
  12. # $(SRC:.cc=.o)
  13. $(STFEMTODST): $(SRC:.cxx=.o) StFemtoDst_Dict.C
  14. $(CXX) $(CFLAGS) -shared $^ -o $(STFEMTODST) $(LIBS)
  15. %.o: %.cxx
  16. $(CXX) -fPIC $(CFLAGS) -c -o $@ $<
  17. StFemtoDst_Dict.C: $(shell find . -name "*.h" ! -name "*LinkDef*")
  18. rootcint -f $@ -c -D_VANILLA_ROOT_ -DROOT_CINT -D__ROOT__ -I. -I$(INCS) $^ StFemtoDstLinkDef.h
  19. clean:
  20. rm -vf *.o StFemtoDst_Dict*
  21. distclean:
  22. rm -vf *.o StFemtoDst_Dict* $(STFEMTODST)