33 lines
1.3 KiB
Makefile
33 lines
1.3 KiB
Makefile
|
|
COMPILE = g++ -std=c++11 -O2 -Wall -fPIC -Xlinker -zmuldefs -Wno-unused-local-typedefs -pthread -Wno-deprecated-declarations -m64
|
|
LOCALINCLUDE = -Iinclude
|
|
ROOTINCLUDE = -I$(ROOTSYS)/include
|
|
ROOTLIBS = $(shell root-config --libs) -lRooFitCore -lRooFit
|
|
|
|
# build the library first, then the executables
|
|
all: libCustomRooFit.so executables
|
|
|
|
# make the class object
|
|
RooExpAndGauss.o: RooExpAndGauss.cpp
|
|
$(COMPILE) $(ROOTINCLUDE) $(LOCALINCLUDE) $(ROOTLIBS) -c $^ -o $@
|
|
|
|
# the 'rootcling' step to generate the extra functions required
|
|
# ... build and compile the dictionary object
|
|
Dict.o:
|
|
rootcling -f Dict.cxx -c $(LOCALINCLUDE) -p RooExpAndGauss.hpp LinkDef.h
|
|
$(COMPILE) $(ROOTINCLUDE) $(LOCALINCLUDE) $(ROOTLIBS) -c Dict.cxx -o Dict.o
|
|
|
|
# build the shared object
|
|
libCustomRooFit.so: RooExpAndGauss.o Dict.o
|
|
g++ -shared $^ -o $@ $(ROOTGLIBS)
|
|
|
|
# can compile anything which links to the shared library and can see the headers
|
|
executables:
|
|
# $(COMPILE) $(ROOTINCLUDE) $(LOCALINCLUDE) generate.cpp -L./lib -lCustomRooFit $(ROOTLIBS) -o generate
|
|
# $(COMPILE) $(ROOTINCLUDE) $(LOCALINCLUDE) saveworkspace.cpp -L./lib -lCustomRooFit $(ROOTLIBS) -o saveworkspace
|
|
# $(COMPILE) $(ROOTINCLUDE) $(LOCALINCLUDE) readworkspace.cpp -L./lib -lCustomRooFit $(ROOTLIBS) -o readworkspace
|
|
|
|
clean:
|
|
rm dict/* lib/*.so bin/* obj/* -rf
|
|
|