forked from nuPRISM/WCSim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile_root
64 lines (37 loc) · 1.86 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
# $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 ./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/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)
./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 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