Makefile 914 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Define compiler
  2. CXX = g++
  3. # Define flags
  4. CFLAGS = $(shell root-config --cflags) -O2 -fPIC -Wall -pipe -std=c++11 -I.
  5. LIBS = $(shell root-config --glibs) -lEG
  6. INCS = $(shell root-config --incdir)
  7. # Define output library
  8. UNIGEN = libUniGen.so
  9. # Compile all *.cxx classes in the directory
  10. SRC = $(shell find . -name "*.cxx")
  11. all: $(UNIGEN)
  12. # $(SRC:.cc=.o)
  13. $(UNIGEN): $(SRC:.cxx=.o) UniGen_Dict.C
  14. $(CXX) $(CFLAGS) -shared $^ -o $(UNIGEN) $(LIBS)
  15. %.o: %.cxx
  16. $(CXX) -fPIC $(CFLAGS) -c -o $@ $<
  17. # Dictionary deneration: -DROOT_CINT -D__ROOT__
  18. UniGen_Dict.C: $(shell find . -name "*.h" ! -name "*LinkDef*")
  19. rootcint -f $@ -c -I. -I$(INCS) $^ UniGenLinkDef.h
  20. .PHONY: clean distclean converters
  21. clean:
  22. rm -vf *.o UniGen_Dict*
  23. distclean:
  24. rm -vf *.o UniGen_Dict* $(UNIGEN) urqmd2u
  25. converters: urqmd2u.cpp
  26. $(CXX) $(CFLAGS) -I$(INCS) $^ -o $(patsubst %.cpp,%,$<) -L. -l$(patsubst lib%.so,%,$(UNIGEN)) $(LIBS)