-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
180 lines (160 loc) · 6.65 KB
/
Makefile
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
#
# Examples Makefile.
#
# M. Kirsanov 07.04.2006
# Modified 18.11.2006
# 26.03.2008 CLHEP dependency removed
SHELL = /bin/sh
-include config.mk
ifeq (x$(PYTHIA8LOCATION),x)
PYTHIA8LOCATION=..
endif
-include $(PYTHIA8LOCATION)/config.mk
# Location of directories.
TOPDIR=$(shell \pwd)
INCDIR=include
SRCDIR=src
LIBDIR=lib
LIBDIRARCH=lib/archive
BINDIR=bin
# Libraries to include if GZIP support is enabled
ifeq (x$(ENABLEGZIP),xyes)
LIBGZIP=-L$(BOOSTLIBLOCATION) -lboost_iostreams -L$(ZLIBLOCATION) -lz
endif
# There is no default behaviour, so remind user.
all:
@echo "Usage: for NN = example number: make mainNN"
# Create an executable for one of the normal test programs
main99: \
$(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libhepmcinterface.a
@mkdir -p $(BINDIR)
$(CXX) $(CXXFLAGS) -I$(PYTHIA8LOCATION)/$(INCDIR) -I$(HEPMCLOCATION)/include $@.cc -o $(BINDIR)/$@.exe \
-L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 -llhapdfdummy $(LIBGZIP) \
-lhepmcinterface \
-L$(HEPMCLOCATION)/lib -lHepMC
@ln -fs $(BINDIR)/$@.exe $@.exe
# $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8tohepmc.a
# -lpythia8tohepmc \
main98: \
$(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libhepmcinterface.a
@mkdir -p $(BINDIR)
$(CXX) $(CXXFLAGS) -I$(PYTHIA8LOCATION)/$(INCDIR) -I$(HEPMCLOCATION)/include $@.cc -o $(BINDIR)/$@.exe \
-L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 -llhapdfdummy $(LIBGZIP) \
-lhepmcinterface \
-L$(HEPMCLOCATION)/lib -lHepMC
@ln -fs $(BINDIR)/$@.exe $@.exe
main95: \
$(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libhepmcinterface.a
@mkdir -p $(BINDIR)
$(CXX) $(CXXFLAGS) -I$(PYTHIA8LOCATION)/$(INCDIR) -I$(HEPMCLOCATION)/include $@.cc -o $(BINDIR)/$@.exe \
-L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 -llhapdfdummy $(LIBGZIP) \
-lhepmcinterface \
-L$(HEPMCLOCATION)/lib -lHepMC
@ln -fs $(BINDIR)/$@.exe $@.exe
main97 main96: \
$(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libhepmcinterface.a
@mkdir -p $(BINDIR)
$(CXX) $(CXXFLAGS) -I$(PYTHIA8LOCATION)/$(INCDIR) -I$(HEPMCLOCATION)/include $@.cc -o $(BINDIR)/$@.exe \
-L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 -llhapdfdummy $(LIBGZIP) \
-lhepmcinterface \
-L$(HEPMCLOCATION)/lib -lHepMC
@ln -fs $(BINDIR)/$@.exe $@.exe
# Create an executable for one of the normal test programs
main00 main01 main02 main03 main04 main05 main06 main07 main08 main09 main10 \
main11 main12 main13 main14 main15 main16 main17 main18 main19 main20 \
main21 main22 main23 main24 main25 main26 main27 main28 main29 main30 \
main31 main32 main33 main34 main35 main36 main37 main38 main39 main40: \
$(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a
@mkdir -p $(BINDIR)
$(CXX) $(CXXFLAGS) -I$(PYTHIA8LOCATION)/$(INCDIR) $@.cc -o $(BINDIR)/$@.exe \
-L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 -llhapdfdummy $(LIBGZIP)
@ln -fs $(BINDIR)/$@.exe $@.exe
# Create an executable linked to HepMC (if all goes well).
# Owing to excessive warning output -Wshadow is not used for HepMC.
ifneq (x$(HEPMCLOCATION),x)
main41 main42: \
$(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8tohepmc.a
@mkdir -p $(BINDIR)
$(CXX) $(CXXFLAGS) -Wno-shadow -I$(PYTHIA8LOCATION)/$(INCDIR) -I$(HEPMCLOCATION)/include \
$@.cc -o $(BINDIR)/$@.exe \
-L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 -llhapdfdummy $(LIBGZIP) \
-lpythia8tohepmc \
-L$(HEPMCLOCATION)/lib -lHepMC
@ln -fs $(BINDIR)/$@.exe $@.exe
else
main41 main42:
@echo ERROR, this target needs HepMC, variable HEPMCLOCATION
endif
# Create an executable that links to LHAPDF
main51 main52 main53: $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a
@mkdir -p $(BINDIR)
$(CXX) $(CXXFLAGS) -I$(PYTHIA8LOCATION)/$(INCDIR) $@.cc -o $(BINDIR)/$@.exe \
-L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 $(LIBGZIP) \
-L$(LHAPDFLOCATION) $(LHAPDFLIBNAME) \
$(FLIBS)
@ln -fs $(BINDIR)/$@.exe $@.exe
# Create an executable that links to LHAPDF and HepMC
main61 main62 main85 main86 main87 main88: \
$(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8tohepmc.a
@mkdir -p $(BINDIR)
$(CXX) $(CXXFLAGS) -Wno-shadow -I$(PYTHIA8LOCATION)/$(INCDIR) -I$(HEPMCLOCATION)/include \
$@.cc -o $(BINDIR)/$@.exe \
-L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 -lpythia8tohepmc $(LIBGZIP) \
-L$(LHAPDFLOCATION) $(LHAPDFLIBNAME) \
-L$(HEPMCLOCATION)/lib -lHepMC \
$(FLIBS)
@ln -fs $(BINDIR)/$@.exe $@.exe
# Create an executable that links to Fastjet
# Owing to excessive warning output -Wshadow is not used for Fastjet.
# (Fixed as of Fastjet 3.0.1, so will be modified eventually.)
ifneq (x$(FASTJETLOCATION),x)
main71 main72: $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a
@mkdir -p $(BINDIR)
# Note: $(CXXFLAGS) is after Fastjet flags as Fastjet includes
# optimisation/debug flags which may be unwanted (e.g. -g -O2)
$(CXX) -I$(PYTHIA8LOCATION)/$(INCDIR) $@.cc \
`$(FASTJETLOCATION)/bin/fastjet-config --cxxflags --plugins` \
$(CXXFLAGS) -Wno-shadow \
-o $(BINDIR)/$@.exe \
-L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 -llhapdfdummy $(LIBGZIP) \
-L$(FASTJETLOCATION)/lib \
`$(FASTJETLOCATION)/bin/fastjet-config --libs --plugins`
@ln -fs $(BINDIR)/$@.exe $@.exe
@rm -f $@.o
else
main71 main72:
@echo ERROR, this target needs Fastjet, variable FASTJETLOCATION
endif
# Create an executable that links to Fastjet, HepMC and LHApdf
# Owing to excessive warning output -Wshadow is not used for Fastjet.
# (Fixed as of Fastjet 3.0.1, so will be modified eventually.)
ifneq (x$(FASTJETLOCATION),x)
main81 main82 main83 main84: \
$(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8.a $(PYTHIA8LOCATION)/$(LIBDIRARCH)/libpythia8tohepmc.a
@mkdir -p $(BINDIR)
# Note: $(CXXFLAGS) is after Fastjet flags as Fastjet includes
# optimisation/debug flags which may be unwanted (e.g. -g -O2)
$(CXX) -I$(PYTHIA8LOCATION)/$(INCDIR) $@.cc \
`$(FASTJETLOCATION)/bin/fastjet-config --cxxflags --plugins` \
$(CXXFLAGS) -Wno-shadow \
-I$(PYTHIA8LOCATION)/$(INCDIR) -I$(HEPMCLOCATION)/include \
-o $(BINDIR)/$@.exe \
-L$(PYTHIA8LOCATION)/$(LIBDIRARCH) -lpythia8 \
-L$(LHAPDFLOCATION) $(LHAPDFLIBNAME) \
-lpythia8tohepmc \
-L$(HEPMCLOCATION)/lib -lHepMC \
-L$(FASTJETLOCATION)/lib \
-L$(LHAPDFLOCATION)/lib \
`$(FASTJETLOCATION)/bin/fastjet-config --libs --plugins`
@ln -fs $(BINDIR)/$@.exe $@.exe
@rm -f $@.o
else
main81 main82 main83 main84:
@echo ERROR, this target needs Fastjet, variable FASTJETLOCATION
endif
# Clean up: remove executables and outdated files.
.PHONY: clean
clean:
rm -rf $(BINDIR)
rm -rf *.exe
rm -f *~; rm -f \#*; rm -f core*