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