-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmadevent_makefile_source
119 lines (90 loc) · 3.78 KB
/
madevent_makefile_source
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
# Definitions
LIBDIR= ../lib/
BINDIR= ../bin/internal/
PDFDIR= ./PDF/
CUTTOOLSDIR= ./CutTools/
IREGIDIR= ./IREGI/src/
include make_opts
# Source files
PROCESS= hfill.o matrix.o myamp.o
DSAMPLE = dsample.o ranmar.o DiscreteSampler.o StringCast.o %(additional_dsample)s
HBOOK = hfill.o hcurve.o hbook1.o hbook2.o
GENERIC = $(alfas_functions).o transpole.o invarients.o hfill.o pawgraphs.o ran1.o \
rw_events.o rw_routines.o kin_functions.o open_file.o basecode.o setrun.o \
run_printout.o dgauss.o readgrid.o getissud.o
INCLUDEF= coupl.inc genps.inc hbook.inc DECAY/decay.inc psample.inc cluster.inc sudgrid.inc
COMBINE = combine_events.o rw_events.o ranmar.o kin_functions.o open_file.o rw_routines.o alfas_functions.o setrun.o
GENSUDGRID = gensudgrid.o is-sud.o setrun_gen.o rw_routines.o open_file.o
# Locally compiled libraries
LIBRARIES=$(LIBDIR)libdsample.$(libext) $(LIBDIR)libgeneric.$(libext)
# Binaries
BINARIES = $(BINDIR)gen_ximprove $(BINDIR)combine_events \
$(BINDIR)gensudgrid $(BINDIR)combine_runs
# Compile commands
all: %(libraries)s
# Libraries
$(LIBDIR)libdsample.$(libext): $(DSAMPLE)
$(call CREATELIB, $@, $^)
$(LIBDIR)libgeneric.$(libext): $(GENERIC)
$(call CREATELIB, $@, $^)
$(LIBDIR)libdhelas.$(libext): DHELAS
cd DHELAS; make
$(LIBDIR)libpdf.$(libext): PDF
cd PDF; make
$(LIBDIR)libcernlib.$(libext): CERNLIB
cd CERNLIB; make
# The bias library is here the dummy by default; compilation of other ones specified in the run_card will be done by MG5aMC directly.
$(LIBDIR)libbias.$(libext): BIAS/dummy
cd BIAS/dummy; make
%(model)s
$(BINDIR)gen_ximprove: gen_ximprove.o ranmar.o rw_routines.o open_file.o
$(FC) $(LDFLAGS) -o $@ $^
$(BINDIR)combine_events: $(COMBINE) $(LIBDIR)libmodel.$(libext) $(LIBDIR)libpdf.$(libext) run_card.inc $(LIBDIR)libbias.$(libext)
$(FC) -o $@ $(COMBINE) -L$(LIBDIR) -lmodel -lpdf $(llhapdf) $(LDFLAGS) -lbias
$(BINDIR)gensudgrid: $(GENSUDGRID) $(LIBDIR)libpdf.$(libext) $(LIBDIR)libcernlib.$(libext)
$(FC) -o $@ $(GENSUDGRID) -L$(LIBDIR) -lmodel -lpdf -lcernlib $(llhapdf) $(LDFLAGS)
# Dependencies
dsample.o: DiscreteSampler.o dsample.f genps.inc StringCast.o
DiscreteSampler.o: StringCast.o
invarients.o: invarients.f genps.inc
setrun.o: setrun.f nexternal.inc leshouche.inc genps.inc
gen_ximprove.o: gen_ximprove.f run_config.inc run_card.inc
combine_events.o: combine_events.f run_config.inc run_card.inc
combine_runs.o: combine_runs.f run_config.inc run_card.inc
select_events.o: select_events.f run_config.inc
setrun.o: setrun.f nexternal.inc leshouche.inc run_card.inc run_config.inc
rw_events.o: rw_events.f run_config.inc
%(additional_dependencies)s
run_card.inc: ../Cards/run_card.dat
../bin/madevent treatcards run
clean4pdf:
rm -f ../lib/libpdf.$(libext)
rm -f ../lib/libgeneric.$(libext)
cleanCT:
cd $(CUTTOOLSDIR); make clean; cd ..
cleanIR:
cd $(IREGIDIR); make clean; cd ..
libiregi: $(LIBDIR)libiregi.a
libcuttools: $(LIBDIR)libcts.a
treatCards:
../bin/madevent treatcards all
treatCardsLoopNoInit:
../bin/madevent treatcards loop --no_MadLoopInit
libmodel: $(LIBDIR)libmodel.$(libext)
libdhelas: $(LIBDIR)libdhelas.$(libext)
$(LIBDIR)libcts.a: $(CUTTOOLSDIR)
cd $(CUTTOOLSDIR); make
ln -sf ../Source/$(CUTTOOLSDIR)includects/libcts.a $(LIBDIR)libcts.a
ln -sf ../Source/$(CUTTOOLSDIR)includects/mpmodule.mod $(LIBDIR)mpmodule.mod
$(LIBDIR)libiregi.a: $(IREGIDIR)
cd $(IREGIDIR); make
ln -sf ../Source/$(IREGIDIR)libiregi.a $(LIBDIR)libiregi.a
clean:
$(RM) *.o $(LIBRARIES) $(BINARIES)
cd PDF; make clean; cd ..
cd DHELAS; make clean; cd ..
cd CERNLIB; make clean; cd ..
cd MODEL; make clean; cd ..
if [ -d $(CUTTOOLSDIR) ]; then cd $(CUTTOOLSDIR); make clean; cd ..; fi
if [ -d $(IREGIDIR) ]; then cd $(IREGIDIR); make clean; cd ..; fi
for i in `ls -d ../SubProcesses/P*`; do cd $$i; make clean; cd -; done;