forked from WCSim/WCSim
-
Notifications
You must be signed in to change notification settings - Fork 2
/
GNUmakefile_root
69 lines (42 loc) · 2.32 KB
/
GNUmakefile_root
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
# $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 += -I$(PWD)/include
CPPFLAGS += -I$(ROOTSYS)/include $(ROOTCFLAGS)
EXTRALIBS += $(ROOTLIBS)
CXX = 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 ./src/WCSimEnumerations.cc ./include/WCSimEnumerations.hh ./src/WCSimRootOptions.cc ./include/WCSimRootOptions.hh ./include/WCSimRootLinkDef.hh
ROOTOBJS := $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimRootEvent.o $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimRootGeom.o $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimPmtInfo.o $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimEnumerations.o $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimRootOptions.o $(G4WORKDIR)/tmp/$(G4SYSTEM)/WCSim/WCSimRootDict.o
.PHONY: directories
all: directories libWCSimRoot.so
directories: $(G4TMPDIR)
$(G4TMPDIR) :
mkdir -p $(G4TMPDIR)
libWCSimRoot.so : $(ROOTOBJS)
@if [ ! -d $(G4TMPDIR) ] ; then mkdir $(G4TMPDIR) ; echo mkdir $(G4TMPDIR) ;fi
@$(CXX) -shared -O $^ -o $(ROOTSO) $(ROOTLIBS)
@cp src/WCSimRootDict_rdict.pcm $(G4WORKDIR)
./src/WCSimRootDict.cc : $(ROOTSRC)
@echo Compiling rootcint ...
rootcling -f ./src/WCSimRootDict.cc -rml libWCSimRoot.so -rmf libWCSimRoot.rootmap -I./include -I$(shell root-config --incdir) WCSimRootEvent.hh WCSimRootGeom.hh WCSimPmtInfo.hh WCSimEnumerations.hh WCSimRootOptions.hh WCSimRootLinkDef.hh
rootcint: ./src/WCSimRootDict.cc
$(G4TMPDIR)/%.o: src/%.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