-
Notifications
You must be signed in to change notification settings - Fork 1
/
GNUmakefile.FNAL
88 lines (58 loc) · 2.79 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.
# --------------------------------------------------------------
CXXFLAGS = -g -Wall -fPIC -O0
ROOTCFLAGS := $(shell root-config --cflags) -DUSE_ROOT -fPIC
ROOTLIBS := $(shell root-config --evelibs)
ROOTGLIBS := $(shell root-config --glibs)
CXXFLAGS += $(ROOTCFLAGS)
CPPFLAGS += -Wno-deprecated
CPPFLAGS += -fdiagnostics-color=always -Wno-sign-compare
CPPFLAGS += -I$(PWD)/include
CPPFLAGS += -I$(ROOTSYS)/include $(ROOTCFLAGS)
EXTRALIBS += $(ROOTLIBS) $(ROOTGLIBS)
CXX = g++
G4SYSTEM=Linux-g++
G4WORKDIR := $(PWD)
G4TMPDIR := $(G4WORKDIR)/tmp/$(G4SYSTEM)/EventDisplay
INCDIR = ./include
SRCDIR = ./src
TMPDIR = ./tmp
LIBDIR = ./lib
BINDIR = ./bin
ROOTSO := libEventDisplay.so
ROOTSRC := $(SRCDIR)/EventDisplay3D.cc $(INCDIR)/EventDisplay3D.hh $(SRCDIR)/EventDisplay2D.cc $(INCDIR)/EventDisplay2D.hh $(INCDIR)/EventDisplayLinkDef.h $(SRCDIR)/ANNIEDisplay.cc $(INCDIR)/ANNIEDisplay.hh
ROOTOBJS := $(G4TMPDIR)/EventDisplay3D.o $(G4TMPDIR)/EventDisplay2D.o $(G4TMPDIR)/EvtDisplayRootDict.o $(G4TMPDIR)/ANNIEDisplay.o
.PHONY: directories
all: directories $(SRCDIR)/EvtDisplayRootDict.cc libEventDisplay.so
directories: $(G4TMPDIR)
$(G4TMPDIR) :
mkdir -p $(G4TMPDIR)
libEventDisplay.so : $(ROOTOBJS)
@echo PWD IS $(PWD)
@echo Compiling libEventDisplay.so with GNUMakefile ...
@if [ ! -d $(G4TMPDIR) ] ; then mkdir $(G4TMPDIR) ; echo mkdir $(G4TMPDIR) ;fi
@$(CXX) -shared -O $^ -o $(ROOTSO) $(ROOTLIBS)
@cp $(SRCDIR)/EvtDisplayRootDict_rdict.pcm $(G4WORKDIR)
$(SRCDIR)/EvtDisplayRootDict.cc : $(ROOTSRC)
@echo Compiling rootcint ...
rootcling -f $(SRCDIR)/EvtDisplayRootDict.cc -rml $(G4WORKDIR)/libEventDisplay.so -rmf $(G4WORKDIR)/libEventDisplay.rootmap -I$(G4WORKDIR)/$(INCDIR) -I$(shell root-config --incdir) EventDisplay3D.hh EventDisplay2D.hh ANNIEDisplay.hh
rootcint: $(SRCDIR)/EvtDisplayRootDict.cc
$(G4TMPDIR)/%.o: $(SRCDIR)/%.cc $(INCDIR)/%.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)/EvtDisplayRootDict.o: $(SRCDIR)/EvtDisplayRootDict.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 $(SRCDIR)/EvtDisplayRootDict.cc
@rm -f libEventDisplay.so
@rm -f libEventDisplay.rootmap
@rm -f EvtDisplayRootDict_rdict.pcm
@rm -f $(SRCDIR)/EvtDisplayRootDict_rdict.pcm