-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (52 loc) · 1.85 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Root variables
ROOTCFLAGS := $(shell root-config --cflags)
ROOTLIBS := -lMinuit $(shell root-config --libs)
ROOTLIBS += -lRooFitCore -lRooFit -lRooStats -lFoam -lMathMore
# compiler and flags
OMPFLAGS = -fopenmp -lgomp
CXX = g++
CXXFLAGS = -g -Wall -fPIC -Wno-deprecated -O2
LD = /usr/bin/ld -m elf_x86_64
LDFLAGS = -g -O2 -fopenmp
SOFLAGS = -shared
# standard commands
RM = rm -f
MV = mv
ECHO = echo
CINT = /cvmfs/atlas.cern.ch/repo/sw/software/17.4.0/sw/lcg/app/releases/ROOT/5.30.02/x86_64-slc5-gcc43-opt/root/bin/rootcint
# add ROOT flags
CXXFLAGS += $(ROOTCFLAGS)
CXXFLAGS += -I. -I./include -I$(BATINSTALLDIR)/include
LIBS += -L$(BATINSTALLDIR)/lib -lBATmodels -lBAT -lBATmtf $(ROOTLIBS)
CXXSRCS = src/EikosUnfolder.cxx src/Sample.cxx
CXXOBJS = $(patsubst %.cxx,%.o,$(CXXSRCS))
EXEOBJS =
MYPROGS = run-Eikos
GARBAGE = $(CXXOBJS) $(EXEOBJS) *.o *~ link.d $(MYPROGS) src/*Dict.cxx src/*Dict.o src/*.pcm
# targets
all : library
link.d : $(patsubst %.cxx,%.h,$(CXXSRCS))
$(CXX) -MM $(CXXFLAGS) $(CXXSRCS) > link.d;
-include link.d
src/EikosUnfolderDict.cxx :
rootcint -f src/EikosUnfolderDict.cxx -c include/EikosUnfolder.h include/LinkDef.h
%.o : %.cxx
$(CXX) $(CXXFLAGS) -fPIC -c $< -o $@
clean :
$(RM) $(GARBAGE)
library: src/EikosUnfolderDict.o $(CXXOBJS)
@echo
@echo Building shared library libEikos.so
@echo
$(CXX) -g -shared -fPIC -fopenmp -Wl,-soname,libEikos.so -o libEikos.so $(CXXOBJS) src/EikosUnfolderDict.o $(LIBS) -lc
install:
mv libEikos.so $(BATINSTALLDIR)/lib
mv EikosUnfolderDict_rdict.pcm $(BATINSTALLDIR)/lib
print :
echo compiler : $(CXX)
echo c++ srcs : $(CXXSRCS)
echo c++ objs : $(CXXOBJS)
echo c++ flags : $(CXXFLAGS)
echo libs : $(LIBS)
echo so flags : $(SOFLAGS)
echo rootlibs : $(ROOTLIBS)