-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile_ROOT5
82 lines (53 loc) · 3.36 KB
/
Makefile_ROOT5
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
71
72
73
74
75
76
77
78
79
80
81
# $Id: GNUmakefile,v 1.17 2006/09/04 15:43:27 t2k Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
ROOTCFLAGS := $(shell root-config --cflags) -DUSE_ROOT -fPIC
ROOTLIBS := $(shell root-config --libs)
CPPFLAGS += -Wno-deprecated
CPPFLAGS += -fdiagnostics-color=always -Wno-sign-compare
CPPFLAGS += -I$(PWD)/include
CPPFLAGS += -I$(ROOTSYS)/include $(ROOTCFLAGS)
EXTRALIBS += $(ROOTLIBS)
CXX = g++ -std=c++1y
G4SYSTEM=Linux-g++
G4WORKDIR := .
G4TMPDIR := $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim
# Note dependencies not yet set up right yet
ROOTSO := libWCSimRoot.so
ROOTSRC := ./src/WCSimRootEvent.cc ./include/WCSimRootEvent.hh ./src/WCSimRootGeom.cc ./include/WCSimRootGeom.hh ./include/WCSimPmtInfo.hh ./include/WCSimLAPPDInfo.hh ./include/WCSimLAPPDpulse.hh ./include/WCSimLAPPDpulseCluster.hh ./src/WCSimEnumerations.cc ./include/WCSimEnumerations.hh ./src/WCSimRootOptions.cc ./include/WCSimRootOptions.hh ./include/WCSimRootLinkDef.h
ROOTOBJS := $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimRootEvent.o $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimRootGeom.o $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimPmtInfo.o $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimLAPPDInfo.o $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimLAPPDpulse.o $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimLAPPDpulseCluster.o $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimEnumerations.o $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimRootOptions.o $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimRootDict.o
.PHONY: directories
all: directories ./src/WCSimRootDict.cc libWCSimRoot.so
directories: $(G4TMPDIR)
$(G4TMPDIR) :
mkdir -p $(G4TMPDIR)
libWCSimRoot.so : $(ROOTOBJS)
@echo Compiling libWCSimRoot.so with GNUMakefile ...
@if [ ! -d $(G4TMPDIR) ] ; then mkdir $(G4TMPDIR) ; echo mkdir $(G4TMPDIR) ;fi
@$(CXX) -shared -O $^ -o $(ROOTSO) $(ROOTLIBS)
@cp src/WCSimRootDict_rdict.pcm $(G4WORKDIR) 2>/dev/null || :
#./src/WCSimRootDict.cc : $(ROOTSRC)
# @echo Compiling rootcint ...
# rootcint -f ./src/WCSimRootDict.cc -c -I./include -I$(shell root-config --incdir) WCSimRootEvent.hh WCSimRootGeom.hh WCSimPmtInfo.hh WCSimLAPPDInfo.hh WCSimLAPPDpulse.hh WCSimLAPPDpulseCluster.hh WCSimEnumerations.hh WCSimRootLinkDef.h
./src/WCSimRootDict.cc : $(ROOTSRC)
@echo Compiling rootcint ...
rootcint -f ./src/WCSimRootDict.cc -c -I./include -I$(shell root-config --incdir) WCSimRootEvent.hh WCSimRootGeom.hh WCSimPmtInfo.hh WCSimLAPPDInfo.hh WCSimLAPPDpulse.hh WCSimLAPPDpulseCluster.hh WCSimEnumerations.hh WCSimRootOptions.hh WCSimRootLinkDef.h
rootcint: ./src/WCSimRootDict.cc
$(G4TMPDIR)/%.o: src/%.cc include/%.hh
@echo Compiling $*.cc ...
@if [ ! -d $(G4TMPDIR) ] ; then mkdir $(G4TMPDIR) ; echo mkdir $(G4TMPDIR) ;fi
@echo $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $(G4TMPDIR)/$(*F).o $<
@$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $(G4TMPDIR)/$(*F).o $<
$(G4TMPDIR)/WCSimRootDict.o: src/WCSimRootDict.cc
@echo Compiling $*.cc ...
@if [ ! -d $(G4TMPDIR) ] ; then mkdir $(G4TMPDIR) ; echo mkdir $(G4TMPDIR) ;fi
@echo $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $(G4TMPDIR)/$(*F).o $<
@$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $(G4TMPDIR)/$(*F).o $<
clean :
@rm -f $(G4TMPDIR)/*.o
@rm -f ./src/WCSimRootDict.cc
@rm -f libWCSimRoot.so
@rm -f libWCSimRoot.rootmap
@rm -f WCSimRootDict_rdict.pcm
@rm -f src/WCSimRootDict_rdict.pcm