-
Notifications
You must be signed in to change notification settings - Fork 13
/
getMk.pl
executable file
·360 lines (302 loc) · 14.1 KB
/
getMk.pl
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
349
350
351
352
353
354
355
356
357
358
359
360
#!/usr/bin/perl -w
## use lib "/home/ansell/exe/getMk";
use getMake;
use strict;
## EXECUTABLES
my @masterprog=("fullBuild","ess","pipe","sinbad","t1Real",
"sns","reactor","t1MarkII","t1Eng","t3Expt",
"testMain");
my @noncompile=("bilbau","clayer","cuBuild","d4c","detectSim",
"epb","ess","photonMod","fussion","lens","muBeam",
"pressure","vcn","power");
## SYSTEM Directory
my @systemLibDir=qw( attachComp construct compWeights crystal
endf funcBase geometry input log md5
mersenne monte physics poly process
simMC source support tally visit weights
world work xml
);
my @systemNames= @systemLibDir;
## Model Directory
my @modelLibDir=qw( bibBuild bnctBuild build chip
cuBlock d4cModel delft epbBuild essBuild
gammaBuild imat lensModel moderator
muon pipeBuild photon sinbadBuild snsBuild t1Build
t1Engineer t1Upgrade t3Model zoom );
my @modelNames= @modelLibDir;
## GENERAL Directory
my @sublibdir=("src","beamline","global",
"instrument","scatMat","transport","special",
"test");
my @core=qw( src attachComp beamline compWeights
construct crystal endf funcBase
geometry global input instrument log md5 monte
mersenne physics poly process scatMat source
support tally transport visit weights
world work xml special test);
my @coreInc=qw( include attachCompInc beamlineInc
compWeightsInc constructInc crystalInc
endfInc funcBaseInc geomInc globalInc inputInc
instrumentInc logInc md5Inc mersenneInc
monteInc muonInc physicsInc polyInc processInc scatMatInc
sourceInc supportInc tallyInc transportInc visitInc
weightsInc worldInc workInc xmlInc specialInc testInclude);
my @libnames=@sublibdir;
## INCLUDES
## MODEL Directory
my @modelInclude = qw( bibBuildInc bnctBuildInc buildInc chipInc
cuBlockInc d4cModelInc delftInc epbBuildInc
essBuildInc gammaBuildInc imatInc lensModelInc
moderatorInc muonInc pipeBuildInc photonInc
sinbadBuildInc snsBuildInc t1BuildInc t1EngineerInc
t1UpgradeInc t3ModelInc zoomInc );
## SYSTEM Directory
my @systemInclude = qw(
attachCompInc constructInc compWeightsInc crystalInc
endfInc funcBaseInc geomInc inputInc logInc md5Inc
mersenneInc monteInc physicsInc polyInc processInc
simMCInc sourceInc supportInc tallyInc
visitInc weightsInc
worldInc workInc xmlInc
);
my @incdir=qw( include beamlineInc chipInc globalInc
instrumentInc polyInc scatMatInc
specialInc transportInc worldInc testInclude );
## Flags on executables
my @controlflags=("-S -B","-S -B","-S -B","-S -B",
"-S -B","-S -B","-S -B","-S -B",
"-S -B","-S -B","-S -B","-S -B",
"-S -B","-S -B");
## Lib flags
my @libflags=("","","","","",
"","","","","","",
"","","","","-S","",
"","","","",
"","","","",
"","","","",
"","","","","","","","");
my $gM=new getMake;
$gM->addMasterProgs(\@masterprog,\@controlflags);
$gM->addCoreItems(\@core,\@coreInc);
$gM->addLibs(\@libnames,\@sublibdir,\@libflags);
$gM->addSubDirLibs("Model/ESSBeam");
$gM->addDirLibs("Model",\@modelNames,\@modelLibDir,\@libflags);
$gM->addDirLibs("System",\@systemNames,\@systemLibDir,\@libflags);
$gM->addIncDir(\@incdir);
$gM->addIncSubDir("System",\@systemInclude);
$gM->addIncSubDir("Model",\@modelInclude);
$gM->addSubIncDir("Model/ESSBeam");
$gM->addDepUnit("bilbau", ["bibBuild","build","visit","chip","t1Upgrade",
"imat","moderator","build","zoom","construct",
"crystal","transport","scatMat","endf","t1Build",
"src","physics","input","process","source",
"monte","funcBase","log","geometry","tally",
"mersenne","src","work","xml","poly","support",
"world","weights","md5","global","attachComp",
"visit","poly"]);
$gM->addDepUnit("pressure", ["visit","zoom","src","monte","global",
"funcBase","log","chip","monte","mersenne",
"physics","geometry","tally","work","xml",
"poly","input","process","visit","weights",
"md5","attachComp","visit"]);
$gM->addDepUnit("divide", ["special","visit","chip","build","zoom",
"src","physics","monte","funcBase","log",
"monte","mersenne","src","geometry","input",
"process","work","xml","poly","support",
"weights","md5","global","attachComp","visit"]);
$gM->addDepUnit("fullBuild",["build","visit","chip","moderator","build",
"zoom","imat","src","simMC","physics","construct",
"transport","scatMat","crystal","endf","input",
"source","monte","funcBase","log","process",
"tally","world","monte","geometry","mersenne",
"src","work","xml","poly","support","weights",
"md5","global","attachComp","visit"]);
$gM->addDepUnit("d4c", ["d4cModel","lensModel","visit","src","physics",
"input","instrument","source","simMC","monte",
"funcBase","log","construct","crystal","transport",
"scatMat","endf","transport","scatMat","tally",
"process","tally","world","construct","monte",
"geometry","mersenne","src","xml","poly",
"support","weights","work","md5","global",
"attachComp","visit"]);
$gM->addDepUnit("t3Expt", ["t3Model","visit","src","physics",
"input","instrument","source","simMC","monte",
"funcBase","log","construct","crystal","transport",
"scatMat","endf","transport","scatMat","tally",
"process","tally","world","construct","monte",
"geometry","mersenne","src","xml","poly",
"support","weights","work","md5","global",
"attachComp","visit"]);
$gM->addDepUnit("lens", ["lensModel","visit","src","physics","input",
"source","simMC","monte","funcBase","log",
"construct","crystal","transport","scatMat",
"endf","transport","scatMat","tally",
"process","tally","world","construct",
"monte","geometry","mersenne","src",
"xml","work","poly","support",
"weights","md5","global","attachComp","visit"]);
$gM->addDepUnit("simple", ["visit","physics","src","input","source",
"monte","funcBase","log","crystal","transport",
"scatMat","endf","process","tally","world",
"monte","geometry","mersenne","src","xml",
"poly","support","weights","md5","global",
"attachComp","process","work","tally","visit"]);
$gM->addDepUnit("t1MarkII", ["t1Upgrade","t1Build","imat","chip","build",
"visit","moderator","zoom","src","simMC",
"construct","crystal","transport","scatMat",
"endf","physics","input","process","source",
"monte","funcBase","log","monte","tally",
"geometry","mersenne","src","world","work",
"xml","poly","support","weights","md5",
"global","attachComp","visit","poly"]);
$gM->addDepUnit("t1Eng", ["t1Engineer","t1Upgrade","t1Build","imat","chip",
"build","visit","moderator","zoom","src","simMC",
"construct","crystal","transport","scatMat","endf",
"physics","input","process","source","monte",
"funcBase","log","monte","tally","geometry",
"mersenne","src","world","work","xml","poly",
"support","weights","md5","global","attachComp",
"visit","poly"]);
$gM->addDepUnit("photonMod", ["photon","visit","src","simMC",
"construct","physics","input","process",
"transport","scatMat","endf","crystal",
"source","monte","funcBase","log","monte",
"tally","geometry","mersenne","src","world",
"work","xml","poly","support","weights",
"md5","global","attachComp","visit","poly"]);
$gM->addDepUnit("pipe", ["pipeBuild","visit","src","simMC",
"construct","physics","input","process",
"transport","scatMat","endf","crystal",
"source","monte","funcBase","log","monte",
"tally","geometry","mersenne","src","world",
"work","xml","poly","support","weights",
"md5","global","attachComp","visit","poly"]);
$gM->addDepUnit("ts1layer", ["build","visit","chip","moderator","build",
"zoom","src","physics","input","process",
"monte","funcBase","log","monte","tally",
"geometry","mersenne","src","work","xml",
"poly","support","weights","md5","global",
"attachComp","visit","poly"]);
$gM->addDepUnit("t1Real", ["t1Build","imat","chip","build","visit",
"moderator","zoom","src","simMC","construct",
"crystal","transport","scatMat","endf",
"physics","input","process","source","monte",
"funcBase","log","monte","tally","geometry",
"mersenne","src","world","work","xml",
"poly","support","weights","md5","global",
"attachComp","visit","poly"]);
$gM->addDepUnit("reactor", ["delft","visit","src","simMC","physics",
"input","source","monte","funcBase","log",
"construct","transport",
"scatMat","crystal","endf","process","tally",
"world","monte","geometry","mersenne","src",
"xml","poly","support","weights","md5","work",
"global","attachComp","visit"]);
$gM->addDepUnit("siMod", ["visit","src","physics","input","source","monte",
"funcBase","log","tally","construct","crystal",
"transport","scatMat","endf","process","world",
"monte","geometry","mersenne","src","xml",
"poly","support","weights","global","attachComp",
"visit"]);
$gM->addDepUnit("cuBuild", ["cuBlock","delft","visit","src","physics",
"input","source","monte","funcBase","log",
"tally","construct","crystal","transport",
"scatMat","md5","endf","process","world",
"work","monte","geometry","mersenne","src",
"xml","poly","support","weights","global",
"attachComp","visit"]);
$gM->addDepUnit("ess", ["essBuild","visit","src","simMC",
"beamline","physics","support",
"input","instrument","source","monte","funcBase","log",
"tally","construct","crystal","transport",
"scatMat","md5","endf","process","world","work",
"monte","geometry","mersenne","src","xml","poly",
"weights","global","attachComp",
"visit"]);
$gM->addDepUnit("sinbad", ["sinbadBuild","visit","src","simMC",
"physics","input",
"source","monte","funcBase","log","tally",
"construct","crystal","transport","scatMat",
"md5","endf","process","world","work","monte",
"geometry","mersenne","src","xml","poly",
"support","weights","global","attachComp",
"visit"]);
$gM->addDepUnit("sns", ["snsBuild","visit","src","simMC","physics","input",
"source","monte","funcBase","log","tally",
"construct","crystal","transport","scatMat",
"md5","endf","process","world","work","monte",
"geometry","mersenne","src","xml","poly",
"support","weights","global","attachComp",
"visit"]);
$gM->addDepUnit("epb", ["epbBuild","delft","visit","src","physics",
"simMC","input","source","monte","funcBase","log",
"tally","construct","crystal","transport",
"scatMat","md5","endf","process","world",
"work","monte","geometry","mersenne","src",
"xml","poly","support","weights","global",
"attachComp","visit"]);
$gM->addDepUnit("muBeam", ["muon","t1Build","imat","chip","build","visit",
"moderator","zoom","src","construct","crystal",
"transport","scatMat","endf","physics","input",
"process","source","monte","funcBase","log",
"monte","tally","geometry","mersenne","src",
"world","work","xml","poly","support","weights",
"md5","global","attachComp","visit","poly"]);
$gM->addDepUnit("bnct", ["bnctBuild","t1Build","imat","chip","build",
"visit","moderator","zoom","src","construct",
"crystal","transport","scatMat","endf","physics",
"input","process","source","monte","funcBase",
"log","monte","tally","geometry","mersenne",
"src","world","work","xml","poly","support",
"weights","md5","global","attachComp","visit",
"poly"]);
$gM->addDepUnit("gamma", ["gammaBuild","t1Build","imat","chip","build",
"visit","moderator","zoom","src","construct",
"crystal","transport","scatMat","endf",
"physics","input","process","source","monte",
"funcBase","log","monte","tally","geometry",
"mersenne","src","world","work","xml","poly",
"support","weights","md5","global","attachComp",
"visit","poly"]);
$gM->addDepUnit("testMain", ["test","build","visit","chip","t1Upgrade",
"imat","moderator","build","zoom","construct",
"crystal","transport","scatMat","endf","t1Build",
"src","simMC","physics","input","process","source",
"monte","funcBase","log","geometry","tally",
"mersenne","src","work","xml","poly","support",
"world","weights","md5","global","attachComp",
"visit","poly"]);
##
## START OF MAIN:::
##
if (@ARGV==0)
{
print STDERR "Options \n";
print STDERR " -O :: optimise \n";
print STDERR " -P :: profile \n";
print STDERR " -G :: Glut \n";
print STDERR " -g :: No debug\n";
print STDERR " -K :: GTK \n";
print STDERR " -S :: GSL \n";
print STDERR " -NS :: No GSL \n";
print STDERR " -NR :: No Regex \n";
print STDERR " -M :: GTKmm \n";
print STDERR " -L :: Don't make library\n";
print STDERR " -m :: masterprog : Set master prog\n";
print STDERR " -o :: outputDir \n";
print STDERR " -s :: shared \n";
print STDERR " -u :: lua \n";
print STDERR " -v :: Add -v to the linker \n";
print STDERR " -w :: SWIG lua \n";
print STDERR " -x :: executable name \n";
$gM->findNonUniq();
exit(1);
}
$gM->setParameters(\@ARGV);
$gM->setPrintFile("Makefile");
$gM->printHeaders();
$gM->runSubDir();
$gM->runMainDir();
$gM->runSwigDir();
$gM->appPrintFile("Makefile");
$gM->printMainAll();