-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile.FNAL
88 lines (60 loc) · 4.38 KB
/
GNUmakefile.FNAL
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
82
83
84
85
86
87
# $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) -lGenVector
ROOTGLIBS := $(shell root-config --glibs)
CPPFLAGS += -Wno-deprecated
CPPFLAGS += -fdiagnostics-color=always -Wno-sign-compare
CPPFLAGS += -I$(PWD)/include
CPPFLAGS += -I$(ROOTSYS)/include $(ROOTCFLAGS)
EXTRALIBS += $(ROOTLIBS)
CXX = g++
G4SYSTEM=Linux-g++
G4WORKDIR := .
G4TMPDIR := $(G4WORKDIR)/tmp/$(G4SYSTEM)/RATEvent
INCDIR = ./include
SRCDIR = ./src
LIBDIR = ./lib
BINDIR = ./bin
INCLUDES = -I$(INCDIR)
ROOTDICT = $(SRCDIR)/RATEventRootDict.cc
ROOTSO := $(LIBDIR)/libRATEvent.so
ROOTSRC := $(SRCDIR)/fileio.cc $(INCDIR)/fileio.hpp $(SRCDIR)/file_system.cc $(INCDIR)/file_system.hpp $(SRCDIR)/debug.cc $(INCDIR)/debug.hpp $(INCDIR)/exceptions.hpp $(SRCDIR)/exceptions.cc $(INCDIR)/string_utilities.hpp $(SRCDIR)/string_utilities.cc $(INCDIR)/string_utilities.tpp $(INCDIR)/textio.hpp $(SRCDIR)/textio.cc $(INCDIR)/os_fixes.hpp $(SRCDIR)/os_fixes.cc $(INCDIR)/dprintf.hpp $(SRCDIR)/dprintf.cc $(INCDIR)/TrackNode.hh $(INCDIR)/TrackNav.hh $(SRCDIR)/TrackNav.cc $(INCDIR)/TrackCursor.hh $(SRCDIR)/TrackCursor.cc $(INCDIR)/PosFit.hh $(SRCDIR)/DSReader.cc $(INCDIR)/DSReader.hh $(SRCDIR)/Root.cc $(INCDIR)/Root.hh $(SRCDIR)/MCLAPPD.cc $(INCDIR)/MCLAPPD.hh $(SRCDIR)/MCPMT.cc $(INCDIR)/MCPMT.hh $(SRCDIR)/RunStore.cc $(INCDIR)/RunStore.hh $(INCDIR)/Centroid.hh $(INCDIR)/Calib.hh $(INCDIR)/EV.hh $(INCDIR)/LAPPD.hh $(INCDIR)/LAPPDHit.hh $(INCDIR)/LAPPDInfo.hh $(INCDIR)/MC.hh $(INCDIR)/MCParticle.hh $(INCDIR)/MCPhoton.hh $(INCDIR)/MCSummary.hh $(INCDIR)/MCTrack.hh $(INCDIR)/MCTrackStep.hh $(INCDIR)/PathFit.hh $(INCDIR)/PMT.hh $(INCDIR)/PMTInfo.hh $(INCDIR)/Run.hh $(INCDIR)/ObjInt.hh $(INCDIR)/ObjDbl.hh $(INCDIR)/RATEventLinkDef.h
ROOTOBJS := $(G4TMPDIR)/MCLAPPD.o $(G4TMPDIR)/MCPMT.o $(G4TMPDIR)/RunStore.o $(G4TMPDIR)/DSReader.o $(G4TMPDIR)/Root.o $(G4TMPDIR)/TrackCursor.o $(G4TMPDIR)/TrackNav.o $(G4TMPDIR)/dprintf.o $(G4TMPDIR)/textio.o $(G4TMPDIR)/os_fixes.o $(G4TMPDIR)/debug.o $(G4TMPDIR)/exceptions.o $(G4TMPDIR)/file_system.o $(G4TMPDIR)/fileio.o $(G4TMPDIR)/string_utilities.o $(G4TMPDIR)/RATEventRootDict.o
.PHONY: all directories
all: directories rootcling $(LIBDIR)/libRATEvent.so
directories: $(G4TMPDIR)
$(G4TMPDIR) :
mkdir -p $(G4TMPDIR)
$(LIBDIR)/libRATEvent.so : $(ROOTOBJS)
@echo Compiling libRATEvent.so with GNUMakefile ...
@if [ ! -d $(G4TMPDIR) ] ; then mkdir $(G4TMPDIR) ; echo mkdir $(G4TMPDIR) ;fi
@$(CXX) -shared -O $^ -o $(ROOTSO) $(ROOTLIBS) $(ROOTGLIBS)
@cp $(SRCDIR)/RATEventRootDict_rdict.pcm $(LIBDIR)
rootcling : $(ROOTSRC)
@echo Compiling with rootcling ...
rootcling -f $(ROOTDICT) -rml libRATEvent.so -rmf $(LIBDIR)/libRATEvent.rootmap -m $(LIBDIR)/RATEventRootDict_rdict.pcm $(INCLUDES) -I$(shell root-config --incdir) Root.hh MCLAPPD.hh MCPMT.hh RunStore.hh Centroid.hh Calib.hh EV.hh LAPPD.hh LAPPDHit.hh LAPPDInfo.hh MC.hh MCParticle.hh MCPhoton.hh MCSummary.hh MCTrack.hh MCTrackStep.hh PathFit.hh PMT.hh PMTInfo.hh PosFit.hh Run.hh RunStore.hh DSReader.hh TrackNav.hh TrackCursor.hh TrackNode.hh ObjInt.hh ObjDbl.hh RATEventLinkDef.h
rootcint: $(SRCDIR)/RATEventRootDict.cc
$(G4TMPDIR)/RATEventRootDict.o: $(ROOTDICT)
@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)/%.o: $(SRCDIR)/%.cc include/%.hpp
@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)/%.o: $(SRCDIR)/%.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 $<
clean :
@rm -f $(G4TMPDIR)/*.o
@rm -f $(SRCDIR)/RATEventRootDict.cc
@rm -f $(LIBDIR)/libRATEvent.so
@rm -f $(LIBDIR)/libRATEvent.rootmap
@rm -f $(SRCDIR)/RATEventRootDict_rdict.pcm
@rm -f $(LIBDIR)/RATEventRootDict_rdict.pcm