1 |
nikolas |
1.2 |
# $Id: Makefile 306 2007-11-19 16:15:32Z rdm $ |
2 |
nikolas |
1.1 |
|
3 |
|
|
############################### geant4_vmc Makefile ########################### |
4 |
|
|
|
5 |
|
|
PACKAGE = PamG4RunConfiguration |
6 |
|
|
|
7 |
|
|
ifeq ($(PLATFORM),) |
8 |
|
|
PLATFORM = $(shell root-config --arch) |
9 |
|
|
endif |
10 |
|
|
|
11 |
nikolas |
1.2 |
|
12 |
pam-rm2 |
1.5 |
TOPDIR = $(PWD) |
13 |
|
|
BINDIR = $(TOPDIR)/tmp/tgt_$(PLATFORM)/$(PACKAGE) |
14 |
|
|
LIBDIR = $(TOPDIR)/lib/tgt_$(PLATFORM) |
15 |
|
|
|
16 |
nikolas |
1.1 |
|
17 |
|
|
ifeq ($(ROOTSYS),) |
18 |
|
|
ROOT_INCDIR = $(shell root-config --incdir) |
19 |
|
|
ROOT_BINDIR = $(shell root-config --prefix)/bin |
20 |
nikolas |
1.2 |
ROOT_ETCDIR = $(shell root-config --prefix)/etc/vmc |
21 |
nikolas |
1.1 |
else |
22 |
|
|
ROOT_INCDIR = $(ROOTSYS)/include |
23 |
|
|
ROOT_BINDIR = $(ROOTSYS)/bin |
24 |
nikolas |
1.2 |
ROOT_ETCDIR = $(ROOTSYS)/etc/vmc |
25 |
nikolas |
1.1 |
endif |
26 |
|
|
|
27 |
nikolas |
1.2 |
include $(ROOT_ETCDIR)/Makefile.$(PLATFORM) |
28 |
|
|
|
29 |
nikolas |
1.1 |
############################### Sources ####################################### |
30 |
|
|
|
31 |
|
|
# Rules |
32 |
|
|
# |
33 |
nikolas |
1.2 |
include $(ROOT_ETCDIR)/MakeRules |
34 |
nikolas |
1.1 |
|
35 |
|
|
# Dictionary |
36 |
|
|
# |
37 |
|
|
GDICT := $(BINDIR)/$(PACKAGE)Cint.cxx |
38 |
|
|
GDICTH := $(GDICT:.cxx=.h) |
39 |
nikolas |
1.2 |
GDICTO := $(patsubst %.cxx,%.o,$(GDICT)) |
40 |
nikolas |
1.1 |
|
41 |
|
|
# Sources |
42 |
|
|
# |
43 |
|
|
CXXSRC := $(wildcard src/*.cxx) |
44 |
|
|
SRCS := $(CXXSRC) |
45 |
|
|
|
46 |
|
|
# C++ Headers processed by CINT |
47 |
|
|
# |
48 |
nikolas |
1.2 |
HDRS := include/PamG4RunConfiguration.h \ |
49 |
|
|
# include/PamG4RangeCutsPhysicsList.h \ |
50 |
|
|
# include/PamG4RangeCutsPhysics.h \ |
51 |
|
|
include/$(PACKAGE)LinkDef.h |
52 |
nikolas |
1.1 |
|
53 |
|
|
# Objects |
54 |
|
|
# |
55 |
|
|
CXXOBJ := $(patsubst %.cxx,$(BINDIR)/%.o,$(CXXSRC)) |
56 |
|
|
OBJS := $(CXXOBJ) $(GDICTO) |
57 |
|
|
|
58 |
|
|
# Make include list |
59 |
|
|
# |
60 |
|
|
ifndef G4INCLUDE |
61 |
nikolas |
1.2 |
G4INCLUDE := $(G4INSTALL)/include |
62 |
nikolas |
1.1 |
endif |
63 |
|
|
|
64 |
nikolas |
1.2 |
INCDIR := -Iinclude -I$(G4INCLUDE) \ |
65 |
nikolas |
1.1 |
-I$(CLHEP_BASE_DIR)/include \ |
66 |
nikolas |
1.2 |
-I$(G4INSTALL)/physics_lists/hadronic/LHEP_BERT/include \ |
67 |
|
|
-I$(G4INSTALL)/physics_lists/hadronic/Packaging/include \ |
68 |
|
|
-I$(G4INSTALL)/examples/novice/N03/include \ |
69 |
pam-rm2 |
1.5 |
-I$(G4VMC_DIR)/include \ |
70 |
nikolas |
1.1 |
-I$(TOPDIR)/include |
71 |
|
|
|
72 |
|
|
ifneq ($(USE_VGM),) |
73 |
|
|
INCDIR += -I$(VGM_INSTALL)/packages/VGM/include \ |
74 |
|
|
-I$(VGM_INSTALL)/packages/ClhepVGM/include \ |
75 |
|
|
-I$(VGM_INSTALL)/packages/BaseVGM/include \ |
76 |
|
|
-I$(VGM_INSTALL)/packages/Geant4GM/include \ |
77 |
|
|
-I$(VGM_INSTALL)/packages/RootGM/include \ |
78 |
|
|
-I$(VGM_INSTALL)/packages/XmlVGM/include |
79 |
|
|
endif |
80 |
|
|
|
81 |
|
|
# C++ compilation flags |
82 |
|
|
# |
83 |
|
|
CXXFLAGS := $(CXXOPTS) $(G4MCDEFS) -I. $(INCDIR) -I$(ROOT_INCDIR) |
84 |
|
|
|
85 |
|
|
# Debug option |
86 |
|
|
# |
87 |
|
|
ifdef G4DEBUG |
88 |
|
|
CXXFLAGS += -DMCDEBUG |
89 |
|
|
endif |
90 |
|
|
|
91 |
|
|
# Use VGM flag |
92 |
|
|
# |
93 |
|
|
ifneq ($(USE_VGM),) |
94 |
|
|
CXXFLAGS += -DUSE_VGM |
95 |
|
|
endif |
96 |
|
|
|
97 |
|
|
######################## Supported Geant4 VIS, UI ############################# |
98 |
|
|
# |
99 |
|
|
# Supported Geant4 VIS, UI setting: |
100 |
|
|
# OPENGLX, OPENGLXM, XM, TCSH |
101 |
|
|
# |
102 |
|
|
ifndef G4VIS_NONE |
103 |
|
|
CPPFLAGS += -DG4VIS_USE |
104 |
|
|
ifdef G4VIS_USE_OPENGLX |
105 |
|
|
G4VIS_USE_OPENGL = 1 |
106 |
|
|
CPPFLAGS += -DG4VIS_USE_OPENGLX |
107 |
|
|
INC_X11 = 1 |
108 |
|
|
endif |
109 |
|
|
ifdef G4VIS_USE_OPENGLXM |
110 |
|
|
G4VIS_USE_OPENGL = 1 |
111 |
|
|
CPPFLAGS += -DG4VIS_USE_OPENGLXM |
112 |
|
|
INC_XM = 1 |
113 |
|
|
endif |
114 |
|
|
ifdef G4VIS_USE_OPENGL |
115 |
|
|
CPPFLAGS += -DG4VIS_USE_OPENGL |
116 |
|
|
CPPFLAGS += -I$(G4INSTALL)/source/visualization/OpenGL/include |
117 |
|
|
INC_GL = 1 |
118 |
|
|
endif |
119 |
|
|
CPPFLAGS += -I$(G4INSTALL)/source/visualization/management/include |
120 |
|
|
CPPFLAGS += -I$(G4INSTALL)/source/visualization/modeling/include |
121 |
|
|
endif #G4VIS_NONE |
122 |
|
|
|
123 |
|
|
ifndef G4UI_NONE |
124 |
|
|
CPPFLAGS += -I$(G4INSTALL)/source/interfaces/basic/include |
125 |
|
|
CPPFLAGS += -I$(G4INSTALL)/source/interfaces/common/include |
126 |
|
|
CPPFLAGS += -I$(G4INSTALL)/source/interfaces/GAG/include |
127 |
|
|
CPPFLAGS += -DG4UI_USE_TERMINAL |
128 |
|
|
ifdef G4UI_USE_TCSH |
129 |
|
|
G4UI_USE = 1 |
130 |
|
|
CPPFLAGS += -DG4UI_USE_TCSH |
131 |
|
|
endif |
132 |
|
|
endif #G4UI_NONE |
133 |
|
|
|
134 |
|
|
ifdef INC_GL |
135 |
|
|
CPPFLAGS += $(OGLFLAGS) |
136 |
|
|
endif |
137 |
|
|
ifdef INC_XM |
138 |
|
|
INC_X11 = 1 |
139 |
|
|
CPPFLAGS += $(XMFLAGS) |
140 |
|
|
endif |
141 |
|
|
ifdef INC_X11 |
142 |
|
|
CPPFLAGS += $(X11FLAGS) |
143 |
|
|
endif |
144 |
|
|
|
145 |
|
|
|
146 |
|
|
######################## Full Geant4 VIS, UI ################################## |
147 |
|
|
# |
148 |
|
|
# Full Geant4 UI, VIS, interactivity setting. |
149 |
|
|
# It enables to use all Geant4 graphics drivers and UIs, |
150 |
|
|
# however not all these options were tested with Geant4 VMC |
151 |
|
|
# and even though a correct behaviour is expected, |
152 |
|
|
# it is not guaranteed. |
153 |
|
|
# |
154 |
|
|
#include $(G4INSTALL)/config/G4UI_USE.gmk |
155 |
|
|
#include $(G4INSTALL)/config/G4VIS_USE.gmk |
156 |
|
|
#include $(G4INSTALL)/config/interactivity.gmk |
157 |
|
|
|
158 |
|
|
CXXFLAGS += $(CPPFLAGS) |
159 |
|
|
|
160 |
|
|
DEPINC += -I. -I$(ROOT_INCDIR) $(INCDIR) |
161 |
|
|
|
162 |
|
|
############################### Targets ####################################### |
163 |
|
|
|
164 |
|
|
|
165 |
pam-rm2 |
1.5 |
|
166 |
nikolas |
1.1 |
SLIBRARY = $(LIBDIR)/lib$(PACKAGE).$(SL) |
167 |
|
|
ALIBRARY = $(LIBDIR)/lib$(PACKAGE).a |
168 |
|
|
|
169 |
pam-rm2 |
1.5 |
LIBDIRUP = ../lib/tgt_$(PLATFORM) |
170 |
|
|
CP_FILE=$(shell mkdir -p ${LIBDIRUP})\ |
171 |
|
|
$(shell cp -rf $(LIBDIR)/lib$(PACKAGE).$(SL) ${LIBDIRUP}/) |
172 |
|
|
|
173 |
|
|
|
174 |
|
|
|
175 |
nikolas |
1.1 |
default: depend $(SLIBRARY) |
176 |
|
|
all: default includes |
177 |
|
|
|
178 |
|
|
|
179 |
pam-rm2 |
1.5 |
$(LIBDIR)/lib$(PACKAGE).$(SL): $(OBJS) $(CP_FILE) |
180 |
|
|
$(LIBDIR)/lib$(PACKAGE).a: $(OBJS) $(CP_FILE) |
181 |
nikolas |
1.1 |
|
182 |
|
|
DICT:= $(GDICT) |
183 |
|
|
|
184 |
|
|
$(DICT): $(HDRS) |
185 |
|
|
|
186 |
|
|
depend: $(SRCS) |
187 |
|
|
|
188 |
nikolas |
1.2 |
TOCLEAN = $(BINDIR) |
189 |
|
|
TOCLEANALL = $(BINDIR) $(LIBDIR) |
190 |
nikolas |
1.1 |
|
191 |
|
|
MAKEDIST = ../config/makedist.sh lib |
192 |
|
|
MAKEDISTSRC = ../config/makedist.sh |
193 |
|
|
|
194 |
nikolas |
1.2 |
include $(ROOT_ETCDIR)/MakeMacros |
195 |
nikolas |
1.1 |
|
196 |
|
|
############################### Dependencies ################################## |
197 |
|
|
|
198 |
|
|
-include $(BINDIR)/Make-depend |