1 |
# $Id: Makefile 306 2007-11-19 16:15:32Z rdm $ |
2 |
|
3 |
############################### geant4_vmc Makefile ########################### |
4 |
|
5 |
PACKAGE = PamG4RunConfiguration |
6 |
|
7 |
ifeq ($(PLATFORM),) |
8 |
PLATFORM = $(shell root-config --arch) |
9 |
endif |
10 |
|
11 |
|
12 |
TOPDIR = $(PWD) |
13 |
BINDIR = $(TOPDIR)/tmp/tgt_$(PLATFORM)/$(PACKAGE) |
14 |
LIBDIR = $(TOPDIR)/lib/tgt_$(PLATFORM) |
15 |
|
16 |
|
17 |
ifeq ($(ROOTSYS),) |
18 |
ROOT_INCDIR = $(shell root-config --incdir) |
19 |
ROOT_BINDIR = $(shell root-config --prefix)/bin |
20 |
ROOT_ETCDIR = $(shell root-config --prefix)/etc/vmc |
21 |
else |
22 |
ROOT_INCDIR = $(ROOTSYS)/include |
23 |
ROOT_BINDIR = $(ROOTSYS)/bin |
24 |
ROOT_ETCDIR = $(ROOTSYS)/etc/vmc |
25 |
endif |
26 |
|
27 |
include $(ROOT_ETCDIR)/Makefile.$(PLATFORM) |
28 |
|
29 |
############################### Sources ####################################### |
30 |
|
31 |
# Rules |
32 |
# |
33 |
include $(ROOT_ETCDIR)/MakeRules |
34 |
|
35 |
# Dictionary |
36 |
# |
37 |
GDICT := $(BINDIR)/$(PACKAGE)Cint.cxx |
38 |
GDICTH := $(GDICT:.cxx=.h) |
39 |
GDICTO := $(patsubst %.cxx,%.o,$(GDICT)) |
40 |
|
41 |
# Sources |
42 |
# |
43 |
CXXSRC := $(wildcard src/*.cxx) |
44 |
SRCS := $(CXXSRC) |
45 |
|
46 |
# C++ Headers processed by CINT |
47 |
# |
48 |
HDRS := include/PamG4RunConfiguration.h \ |
49 |
# include/PamG4RangeCutsPhysicsList.h \ |
50 |
# include/PamG4RangeCutsPhysics.h \ |
51 |
include/$(PACKAGE)LinkDef.h |
52 |
|
53 |
# Objects |
54 |
# |
55 |
CXXOBJ := $(patsubst %.cxx,$(BINDIR)/%.o,$(CXXSRC)) |
56 |
OBJS := $(CXXOBJ) $(GDICTO) |
57 |
|
58 |
# Make include list |
59 |
# |
60 |
ifndef G4INCLUDE |
61 |
G4INCLUDE := $(G4INSTALL)/include |
62 |
endif |
63 |
|
64 |
INCDIR := -Iinclude -I$(G4INCLUDE) \ |
65 |
-I$(CLHEP_BASE_DIR)/include \ |
66 |
-I$(G4INSTALL)/physics_lists/hadronic/LHEP_BERT/include \ |
67 |
-I$(G4INSTALL)/physics_lists/hadronic/Packaging/include \ |
68 |
-I$(G4INSTALL)/examples/novice/N03/include \ |
69 |
-I$(G4VMC_DIR)/include \ |
70 |
-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 |
|
166 |
SLIBRARY = $(LIBDIR)/lib$(PACKAGE).$(SL) |
167 |
ALIBRARY = $(LIBDIR)/lib$(PACKAGE).a |
168 |
|
169 |
LIBDIRUP = ../lib/tgt_$(PLATFORM) |
170 |
CP_FILE=$(shell mkdir -p ${LIBDIRUP})\ |
171 |
$(shell cp -rf $(LIBDIR)/lib$(PACKAGE).$(SL) ${LIBDIRUP}/) |
172 |
|
173 |
|
174 |
|
175 |
default: depend $(SLIBRARY) |
176 |
all: default includes |
177 |
|
178 |
|
179 |
$(LIBDIR)/lib$(PACKAGE).$(SL): $(OBJS) $(CP_FILE) |
180 |
$(LIBDIR)/lib$(PACKAGE).a: $(OBJS) $(CP_FILE) |
181 |
|
182 |
DICT:= $(GDICT) |
183 |
|
184 |
$(DICT): $(HDRS) |
185 |
|
186 |
depend: $(SRCS) |
187 |
|
188 |
TOCLEAN = $(BINDIR) |
189 |
TOCLEANALL = $(BINDIR) $(LIBDIR) |
190 |
|
191 |
MAKEDIST = ../config/makedist.sh lib |
192 |
MAKEDISTSRC = ../config/makedist.sh |
193 |
|
194 |
include $(ROOT_ETCDIR)/MakeMacros |
195 |
|
196 |
############################### Dependencies ################################## |
197 |
|
198 |
-include $(BINDIR)/Make-depend |