-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.config
348 lines (255 loc) · 8.96 KB
/
Makefile.config
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# This is the Go4 Makefile configuration included by all package Makefiles
ifeq ($(Go4_Makefile_Config),)
Go4_Makefile_Config = included
ifndef GO4_Configured
-include $(GO4SYS)/build/Makefile.gener
ifndef GO4_OS
GO4_OS=Linux
endif
endif
ifdef debug
DOOPTIMIZATION = false
endif
#rules which does not require any dependency checks
FASTRULES += package setup clean clean-bin map
ifneq ($(findstring $(MAKECMDGOALS), package),)
DOPACKAGE = true
endif
ifneq ($(findstring $(MAKECMDGOALS), $(FASTRULES)),)
DOING_FASTRULE=true
endif
ifdef ROOTINCPATH
ifeq ($(wildcard $(ROOTINCPATH)/RVersion.h),)
$(error No files found in $(ROOTINCPATH), check your ROOT installation)
endif
endif
ifeq ($(GO4_OS), Win32)
GO4_WIN32 = true
endif
include $(GO4SYS)/build/Makefile.$(GO4_OS)
#### File suffixes: ###
SrcSuf = cxx
CSuf = c
HedSuf = h
DepSuf = d
#file prefixes
DICT_PREFIX = G__
DICT_R6SUFF = _rdict.pcm
LIB_PREFIX = lib
GO4_USERLIBNAME = $(LIB_PREFIX)Go4UserAnalysis
GO4_USEREXENAME = MainUserAnalysis
#### Library version numbers: ###
MAJOR = 6
MINOR = 3.99
VERSSUF = $(MAJOR).$(MINOR)
#### Go4 general build flags: ###
ifdef GO4PACKAGE
INCLUDES = -Iinclude -I.
else
ifdef GO4_WIN32
INCLUDES = -I'$(shell cygpath -w $(GO4SYS)/include)'
else
ifdef GO4PREFIX
INCLUDES = -I$(GO4INCPATH)
else
INCLUDES = -I$(GO4SYS)/include
#this is for very old user code, when go4/include was not exists
INCLUDES += -I$(GO4SYS)
endif
endif
endif
ifdef USEHDF5
INCLUDES += -I$(HDF5INCLUDEPATH)
DEFINITIONS += -D__GO4HDF5__
endif
### suppress ROOT6 compiler warnings, should be eliminated soon
ifdef GO4_WIN32
DEFINITIONS += -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
endif
#### Combine compilers flags in one variable: ###
CXXFLAGS = $(OPTIONS) $(EXTRACXXOPTIONS) $(DEFINITIONS) $(ROOTCFLAGS) $(INCLUDES)
CFLAGS = $(OPTIONS) $(EXTRACOPTIONS) $(DEFINITIONS) $(INCLUDES)
LDRPATHS = $(ROOTLIBPATH) $(GO4LIBPATH)
#QT relevant variables
ifdef GO4_QT
ifndef USEGEDEDITOR
QTGO4DEFINITIONS += -D__NOGO4GED__
endif
ifndef USEASIMAGE
QTGO4DEFINITIONS += -D__NOGO4ASI__
endif
QTGO4DEFINITIONS += $(DEFINITIONS)
ifdef USEHDF5
QTGO4DEFINITIONS += -D__GO4HDF5__
endif
ifdef GO4_DESIGNER
QTGO4DEFINITIONS += -D__GO4DESIGNER__
endif
ifdef GO4_X11
QTGO4DEFINITIONS += -D__GO4X11__
endif
ifdef GO4_WEB
QTGO4DEFINITIONS += -D__GO4WEB__
endif
QTCXXFLAGS += $(QTGO4DEFINITIONS)
QMAKEOPTFLAG = "CONFIG+=release"
QMAKEFLAGS = "QMAKE_CXXFLAGS=$(WARNINGS) $(QTGO4DEFINITIONS)" "QMAKE_CXXFLAGS_RELEASE = -O2" "QMAKE_CFLAGS_RELEASE = -O2"
ifeq ($(GO4_OS),Win32)
QMAKEFLAGS += "INCLUDEPATH+=$(shell cygpath -w $(ROOTINCPATH))" "DEPENDPATH+=$(shell cygpath -w $(ROOTINCPATH))"
MAKEFORQT = nmake
else
QMAKEFLAGS += "INCLUDEPATH+=$(ROOTINCPATH)" "DEPENDPATH+=$(ROOTINCPATH)"
MAKEFORQT = $(MAKE)
ifeq ($(GO4_OS),Linux)
QMAKEFLAGS += "QMAKE_LFLAGS += -Wl,--no-as-needed"
endif
endif
ifndef GO4_WIN32
ifeq ($(DOOPTIMIZATION),false)
QMAKEOPTFLAG = "CONFIG+=debug"
QMAKEFLAGS += "QMAKE_CXXFLAGS+=-Wall"
endif
ifneq ($(findstring -std=c++11,$(ROOTCFLAGS)),)
QMAKEOPTFLAG += "CONFIG+=c++11"
endif
ifneq ($(findstring -std=c++14,$(ROOTCFLAGS)),)
QMAKEOPTFLAG += "CONFIG+=c++14"
endif
ifneq ($(findstring -std=c++17,$(ROOTCFLAGS)),)
QMAKEOPTFLAG += "CONFIG+=c++17"
endif
ifneq ($(findstring -std=c++20,$(ROOTCFLAGS)),)
QMAKEOPTFLAG += "CONFIG+=c++20"
endif
endif
endif
### library load path:
#root tools for file generations
ifdef GO4PACKAGE
GO4DLLPATH = lib
else
GO4DLLPATH = $(GO4LIBPATH)
endif
### library load path:
ROOTMAPNAME = .rootmap
GO4MAP = $(GO4SYS)/$(ROOTMAPNAME)
DOMAP = true
################ Go4 build scripts ##################
MakeDepend = $(GO4SYS)/build/depend.sh $(ObjSuf)
CleanLib = $(GO4SYS)/build/cleanlib.sh $(GO4_OS) "$(RM)" $(DllSuf)
ifdef ISROOT6
# ROOTCINTGO4 = echo "Generating dictionary $@ ..."; \
# $(ROOTCLING) -f $@ -m $(ROOTLIBPATH)/libCore_rdict.pcm $(INCLUDES) $(DEFINITIONS)
ROOTCINTGO4 = $(GO4SYS)/build/makedict.sh $(GO4_OS) $(DllSuf) "$(ROOTEXEPATH)" rootcling $@ "$(INCLUDES) $(DEFINITIONS)"
MakeLibrary = $(GO4SYS)/build/makelib6.sh $(GO4_OS) "$(LD)" "$(RM)" "$(MV)" "$(LN)" "$(LDFLAGS)" "$(SOFLAGS)" $(DllSuf) "$(ROOTEXEPATH)" "$(MAKELIB_SET)" "$(INCLUDES) $(DEFINITIONS)"
MakeLib = $(error MakeLib macro not defined, please change your Makefile)
MakeMap = $(error MakeMap macro not defined, please change your Makefile)
else
ifeq ($(GO4_OS),Win32)
RLIBMAP = rlibmap
else
RLIBMAP = $(ROOTEXEPATH)/bin/rlibmap
endif
ROOTCINTGO4 = $(GO4SYS)/build/makedict.sh $(GO4_OS) $(DllSuf) "$(ROOTEXEPATH)" rootcint $@ "$(INCLUDES) $(DEFINITIONS)"
MakeLibrary = $(GO4SYS)/build/makelib.sh $(GO4_OS) "$(LD)" "$(RM)" "$(MV)" "$(LN)" "$(RLIBMAP)" "$(LDFLAGS)" "$(SOFLAGS)" $(DllSuf) "---"
#this is for compatibility with old makefile,
#where version suffix is required for library file
#all new makefiles should use MakeLibrary call
MakeLib = $(GO4SYS)/build/makelib.sh $(GO4_OS) "$(LD)" "$(RM)" "$(MV)" "$(LN)" "$(RLIBMAP)" "$(LDFLAGS)" "$(SOFLAGS)" $(DllSuf) $(VERSSUF)
#Also kept for compatibility with old makefiles,
#now rootmap will be produced by makelib call
MakeMap = $(GO4SYS)/build/makemap.sh $(GO4_OS) $(RLIBMAP)
endif
# files sets
GO4QTMAIN :=
GO4QTHEADS :=
LIBDEPENDENC :=
EXAMPDEPENDENCS :=
EXAMPLEEXECS :=
DISTRFILES :=
ifeq ($(GO4_OS),Win32)
go4ldname = '$(GO4SYS)\lib\lib$1.lib'
LIBS_BASESET = $(ROOTLIBS) \
libMinuit.lib \
$(if $(USEXMLIO),libXMLIO.lib,) \
$(if $(USESPECTRUM),libSpectrum.lib,)
LIBS_WEB6SET = $(ROOTLIBS) libRHTTP.lib libROOTWebDisplay.lib
LIBS_GUISET = $(if $(GO4_X11),$(ROOTGLIBS),$(ROOTLIBS)) \
$(if $(USEXMLIO), libXMLIO.lib,) \
$(if $(USESPECTRUM), libSpectrum.lib,) \
$(if $(USEASIMAGE), libASImage.lib,) \
$(if $(USEGEDEDITOR), libGed.lib libTreePlayer.lib,) \
'..\..\lib\libGo4Fit.lib' \
'..\..\lib\libGo4Base.lib' \
'..\..\lib\libGo4ThreadManager.lib' \
'..\..\lib\libGo4TaskHandler.lib' \
'..\..\lib\libGo4AnalBase.lib' \
'..\..\lib\libGo4GUI.lib'
else
go4ldname = -l$1
LIBS_BASESET = $(ROOTLIBS) \
-lpthread \
-lThread \
-lMinuit \
$(if $(USESPECTRUM),-lSpectrum,) \
$(if $(USEXMLIO),-lXMLIO,) \
-L$(GO4LIBPATH)
ifneq ($(USERT),false)
LIBS_BASESET += -lrt
endif
LIBS_WEB6SET = $(ROOTLIBS) -lRHTTP -lROOTWebDisplay
LIBS_GUISET = $(if $(GO4_X11),$(ROOTGLIBS),$(ROOTLIBS)) \
-lMinuit \
-lThread \
-lpthread \
$(if $(USEXMLIO),-lXMLIO,) \
$(if $(USESPECTRUM),-lSpectrum,) \
$(if $(USEASIMAGE),-lASImage,) \
$(if $(USEGEDEDITOR),-lGed -lTreePlayer,) \
$(if $(LINKX11),-L/usr/X11R6/lib/ -lX11,) \
$(if $(GO4_X11),-L/usr/lib/ -lX11,) \
-L$(GO4LIBPATH) \
$(call go4ldname,Go4Fit) \
$(call go4ldname,Go4Base) \
$(call go4ldname,Go4ThreadManager) \
$(call go4ldname,Go4TaskHandler) \
$(call go4ldname,Go4AnalBase) \
$(call go4ldname,Go4GUI)
endif
LIBS_THRDMANSET = $(LIBS_BASESET) \
$(call go4ldname,Go4Base) \
$(call go4ldname,Go4ThreadManager)
LIBS_TASKHANDSET = $(LIBS_THRDMANSET) \
$(call go4ldname,Go4TaskHandler)
LIBS_FULLSET = $(LIBS_BASESET) \
$(call go4ldname,Go4Fit) \
$(call go4ldname,Go4Base) \
$(call go4ldname,Go4ThreadManager) \
$(call go4ldname,Go4TaskHandler) \
$(call go4ldname,Go4AnalBase) \
$(call go4ldname,Go4Analysis)
ifdef USEHDF5
LIBS_FULLSET += -L $(HDF5LIBPATH) -lhdf5_cpp -lhdf5
#-lhdf5_hl
endif
# this is set of libraries which linked in MakeLibrary script against currently build library
# used only in ROOT6 by makelib6.sh
MAKELIB_SET = $(LIBS_FULLSET)
BASIC_LIB_DEP = $(if $(USESPECTRUM),$(ROOTLIBPATH)/libSpectrum.$(DllSuf),) \
$(if $(USEXMLIO),$(ROOTLIBPATH)/libXMLIO.$(DllSuf),) \
$(ROOTLIBPATH)/libGpad.$(DllSuf) \
$(ROOTLIBPATH)/libTree.$(DllSuf) \
$(ROOTLIBPATH)/libMinuit.$(DllSuf) \
$(ROOTLIBPATH)/libThread.$(DllSuf)
ANAL_LIB_DEP = $(GO4DLLPATH)/libGo4Analysis.$(DllSuf) \
$(GO4DLLPATH)/libGo4AnalBase.$(DllSuf) \
$(GO4DLLPATH)/libGo4TaskHandler.$(DllSuf) \
$(GO4DLLPATH)/libGo4ThreadManager.$(DllSuf) \
$(GO4DLLPATH)/libGo4Base.$(DllSuf) \
$(GO4DLLPATH)/libGo4Fit.$(DllSuf) \
$(BASIC_LIB_DEP)
# for very old make files
MAKEDEP = rmkdepend
GO4LIBS = $(LIBS_FULLSET)
GO4PATH = -L$(GO4DLLPATH)
endif