# Define compiler CXX = g++ # Define flags CFLAGS = $(shell root-config --cflags) -fPIC -Wall -pipe -std=c++11 -I. LIBS = $(shell root-config --glibs) -lEG INCS = $(shell root-config --incdir) # Define output library UNIGEN = libUniGen.so # Compile all *.cxx classes in the directory SRC = $(shell find . -name "*.cxx") all: CFLAGS += -O2 all: $(UNIGEN) .PHONY: optdebug debug optdebug: CFLAGS += -O2 -g optdebug: $(UNIGEN) debug: CFLAGS += -O0 -g debug: $(UNIGEN) # $(SRC:.cc=.o) $(UNIGEN): $(SRC:.cxx=.o) UniGen_Dict.C $(CXX) $(CFLAGS) -shared $^ -o $(UNIGEN) $(LIBS) %.o: %.cxx $(CXX) -fPIC $(CFLAGS) -c -o $@ $< # Dictionary deneration: -DROOT_CINT -D__ROOT__ UniGen_Dict.C: $(shell find . -name "*.h" ! -name "*LinkDef*") rootcint -f $@ -c -I. -I$(INCS) $^ UniGenLinkDef.h .PHONY: clean distclean converters converters_debug converters_optdebug clean: rm -vf *.o UniGen_Dict* distclean: rm -vf *.o UniGen_Dict* $(UNIGEN) urqmd2u converters_debug: CFLAGS += -O0 -g converters_debug: converters converters_optdebug: CFLAGS += -O2 -g converters_optdebug: converters converters: urqmd2u.cpp $(CXX) $(CFLAGS) -I$(INCS) $^ -o $(patsubst %.cpp,%,$<) -L. -l$(patsubst lib%.so,%,$(UNIGEN)) $(LIBS)