LOEventGenerationBias: makefile

File makefile, 2.2 KB (added by Valentin, 4 years ago)
Line 
1BIASDIR   = ../
2SOURCEDIR = ../..
3include $(SOURCEDIR)/make_opts
4
5include ./bias_dependencies
6
7all: PY8_CKKW
8
9clean:
10        $(RM) *.o $(BIASLIBDIR)$(BIASLIBRARY)
11
12INCLUDES = $(BIASDIR)/bias.inc \
13                   $(SOURCEDIR)/maxparticles.inc \
14                   $(SOURCEDIR)/nexternal.inc \
15                   $(SOURCEDIR)/run_config.inc \
16                   $(SOURCEDIR)/lhe_event_infos.inc \
17                   $(SOURCEDIR)/run.inc \
18                   $(SOURCEDIR)/cuts.inc
19
20#
21# Compilation of the module ptj_bias
22#
23PY8_CKKW.o: PY8_CKKW.f $(INCLUDES)
24        $(FC) $(FFLAGS) $(LDFLAGS) -c -o PY8_CKKW.o PY8_CKKW.f
25
26#
27# Generate the copy of the relevant cards in the module C++ headers so that they are compiled
28# directly in the executable and do not have to be read at run time.
29#
30param_card.h: ../../../Cards/param_card.dat
31        python -c "out=open('param_card.h','w'); out.write('const std::string ParamCard = \"%s\";'%'\\\n\"\n\"'.join([line for line in open('../../../Cards/param_card.dat').read().replace('\"',r'\"').split('\n')])); out.close();"
32
33run_card.h: ../../../Cards/run_card.dat
34        python -c "out=open('run_card.h','w'); out.write('const std::string RunCard = \"%s\";'%'\\\n\"\n\"'.join([line for line in open('../../../Cards/run_card.dat').read().replace('\"',r'\"').split('\n')])); out.close();"
35
36proc_card.h: ../../../Cards/proc_card_mg5.dat
37        python -c "out=open('proc_card.h','w'); out.write('const std::string ProcCard = \"%s\";'%'\\\n\"\n\"'.join([line for line in open('../../../Cards/proc_card_mg5.dat').read().replace('\"',r'\"').split('\n')])); out.close();"
38
39py8_mg5amc_bias_interface.o: py8_mg5amc_bias_interface.cc param_card.h run_card.h proc_card.h
40        $(DEFAULT_CPP_COMPILER) $(CXXFLAGS) $(PY8CXXFLAGS) $(LDFLAGS) $(PY8LIBS) -c -o py8_mg5amc_bias_interface.o py8_mg5amc_bias_interface.cc
41
42PY8_CKKW: PY8_CKKW.o py8_mg5amc_bias_interface.o
43        $(call CREATELIB, $(BIASLIBDIR)$(BIASLIBRARY), $^)
44
45#
46# List of the requirements for this module.
47# 'VALID' is the keyword that *must* be returned if everything is in order.
48#
49requirements:   
50ifeq ($(shell $(call CHECK_MG5AMC_VERSION,2.4.2)),True)
51ifeq ($(PYTHIA8_PATH),NotInstalled)
52        @echo "Error: This module requires Pythia8. Consider installing it with the command 'install pythia8'."
53else
54        @echo "VALID"
55endif
56else
57        @echo "Error:: MG5aMC is not recent enough (found "$(MG5AMC_VERSION)")"
58        @echo "FAIL"
59endif