-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (39 loc) · 1.45 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
LIBNAME = DmtpcSkim
CXX=g++
LDFLAGS=`root-config --libs` `dmtpc-config --lib-core`
CXXFLAGS= `root-config --cflags` -fPIC -O3 -g `dmtpc-config --inc-core`
#LDFLAGS+= -Wl,-z,defs
LDFLAGS+= -rdynamic
# add JanEvent location
#CXXFLAGS+= -I../DmtpcJanEve/include
#LDFLAGS+=-L/home/balewski/dmtpc-software//DmtpcJanEve/lib -lM3Event
VPATH=src:include:build
LIBDIR=lib
BUILDDIR=build
INCLUDEDIR=include
BINDIR=bin
#SRCS_J = WeventIO.cc CcdPed_init.cc CcdPedMaker.cc CcdCalibMaker.cc CcdCluster_init.cc CcdClusterMaker.cc AnaM3EveBlue.cc
SRCS_J = CcdPed_init.cc CcdPedMaker.cc
OBJS_J = $(notdir $(patsubst %.cc,%.o,$(SRCS_J)))
OBJS := $(addprefix $(BUILDDIR)/, $(LIBNAME)Cint.o $(OBJS_J) )
INCLUDES := $(addprefix $(INCLUDEDIR)/, $(shell ls $(INCLUDEDIR)))
all: shared
shared: $(LIBDIR)/lib$(LIBNAME).so
# UGLY solution - why libDmtpcCore.so must be loaded here and not in .C
$(LIBDIR)/lib$(LIBNAME).so: $(OBJS) | $(LIBDIR)
@echo Building shared library $@
$(CXX) $(LDFLAGS) $(OBJS) -g -shared ../DmtpcCore/lib/libDmtpcCore.so -o $@
$(OBJS): | $(BUILDDIR)
$(LIBDIR):
mkdir -p $(LIBDIR)
$(BUILDDIR):
mkdir -p $(BUILDDIR)
$(BUILDDIR)/$(LIBNAME)Cint.cc: $(INCLUDES) LinkDef.h | $(BUILDDIR)
@echo Running rootcint
rootcint -f $(BUILDDIR)/$(LIBNAME)Cint.cc -c $(INCLUDES) LinkDef.h
$(BUILDDIR)/%.o: %.cc $(INCLUDES) Makefile | $(BUILDDIR)
@echo Compiling $<
$(CXX) $(CXXFLAGS) -I./include -I./ -o $@ -c $<
clean:
rm -rf build
rm -rf lib