examples/testing/Makefile
1 include ../make.inc
2 include $(PHOTOSLOCATION)/make.inc
3 
4 ROOTLIB := $(shell root-config --glibs)
5 ROOTINC := $(shell root-config --cflags)
6 ROOTLIBPATH := $(shell root-config --libdir)
7 
8 # Keep in mind Makefile and examples are not prepared to automatically adapt
9 # to different pythia versions: 8.170 (or lower), 8.180-8.185, 8.2
10 # At present they are adapted to v8.2
11 #PYTHIA_LIBS = -L$(PYTHIALOCATION)/lib/archive -lpythia8 -llhapdfdummy -lhepmcinterface
12 #PYTHIA_LIBS = -L$(PYTHIALOCATION)/lib/archive -lpythia8 -llhapdfdummy -lpythia8tohepmc
13 PYTHIA_LIBS = -L$(PYTHIALOCATION)/lib -lpythia8 -ldl
14 
15 MC_TESTER_LIBS = -L$(MCTESTERLOCATION)/lib -lHEPEvent -lHepMCEvent -lMCTester
16 HEPMC_LIBS = -L$(HEPMCLOCATION)/lib -lHepMC
17 TAUOLA_LIBS = -L$(TAUOLALOCATION)/lib -lTauolaCxxInterface -lTauolaFortran -lTauolaHepMC
18 PHOTOS_LIBS = -L$(PHOTOSLOCATION)/lib -lPhotospp -lPhotosppHepMC -lPhotosppHEPEVT $(HEPMC_LIBS)
19 
20 all:
21 ifneq ($(HEPMCLOCATION), )
22 ifneq ($(PYTHIALOCATION), )
23 ifneq ($(MCTESTERLOCATION), )
24  @make photos_test.exe
25 ifneq ($(TAUOLALOCATION), )
26  @make photos_tauola_test.exe
27 endif
28 endif
29 endif
30 endif
31  @echo "##################################################################"
32  @echo " Available programs:"
33  @if test -e photos_test.exe; then \
34  echo " ./photos_test.exe"; else \
35  echo ""; \
36  echo " WARNING: Main program used for tests - 'photos_test.exe' "; \
37  echo " requires HepMC, Pythia8 and MC-TESTER."; \
38  fi
39  @if test -e photos_tauola_test.exe; then \
40  echo " ./photos_tauola_test.exe"; else \
41  echo ""; \
42  echo " WARNING: Second program used for tests - 'photos_tauola_test.exe' "; \
43  echo " requires HepMC, Tauola++, Pythia8 and MC-TESTER."; \
44  fi
45  @echo ""
46  @echo " To execute all available tests: 'make run',"
47  @echo " For single test: cd to chosen sub-directory and 'make' "
48  @echo "##################################################################"
49 
50 %.exe: %.cxx
51  $(CC) $(CFLAGS) -I$(PHOTOSLOCATION)/include -I$(HEPMCLOCATION)/include \
52  $(LDFLAGS) $(HEPMC_LIBS) $(PHOTOS_LIBS) $< -o $@ \
53  -Wl,-rpath,$(PHOTOSLOCATION)/lib \
54  -Wl,-rpath,$(HEPMCLOCATION)/lib
55 
56 photos_test.exe: photos_test.cxx
57  $(CC) $(CFLAGS) -I$(PHOTOSLOCATION)/include -I$(PYTHIALOCATION)/include -I$(MCTESTERLOCATION)/include -I$(HEPMCLOCATION)/include \
58  $(ROOTINC) $< -o $@ \
59  $(LDFLAGS) $(ROOTLIB) $(PYTHIA_LIBS) $(MC_TESTER_LIBS) $(HEPMC_LIBS) $(PHOTOS_LIBS) \
60  -Wl,-rpath,$(PHOTOSLOCATION)/lib \
61  -Wl,-rpath,$(ROOTLIBPATH) \
62  -Wl,-rpath,$(HEPMCLOCATION)/lib \
63  -Wl,-rpath,$(PYTHIALOCATION)/lib \
64  -Wl,-rpath,$(MCTESTERLOCATION)/lib
65 
66 photos_tauola_test.exe: photos_tauola_test.cxx
67  $(CC) $(CFLAGS) -I$(PHOTOSLOCATION)/include -I$(TAUOLALOCATION)/include -I$(PYTHIALOCATION)/include -I$(MCTESTERLOCATION)/include \
68  -I$(HEPMCLOCATION)/include $(ROOTINC) $< -o $@ \
69  $(LDFLAGS) $(ROOTLIB) $(PYTHIA_LIBS) $(MC_TESTER_LIBS) $(HEPMC_LIBS) $(TAUOLA_LIBS) $(PHOTOS_LIBS) \
70  -Wl,-rpath,$(PHOTOSLOCATION)/lib \
71  -Wl,-rpath,$(TAUOLALOCATION)/lib \
72  -Wl,-rpath,$(ROOTLIBPATH) \
73  -Wl,-rpath,$(HEPMCLOCATION)/lib \
74  -Wl,-rpath,$(PYTHIALOCATION)/lib \
75  -Wl,-rpath,$(MCTESTERLOCATION)/lib
76 
77 make.inc:
78  @echo ""
79  @echo "Please execute ./configure in main examples directory first!"
80  @echo ""
81  @false
82 
83 $(PHOTOSLOCATION)/make.inc:
84  @echo ""
85  @echo "Please compile the interface first!"
86  @echo ""
87  @false
88 
89 run:
90  make -C Zee
91  make -C Zmumu
92  make -C ZmumuNLO
93  make -C Wenu
94  make -C Wmunu
95  make -C WmunuNLO
96  make -C ttbar
97 ifneq ($(TAUOLALOCATION), )
98  make -C Htautau
99  make -C Ztautau
100  make -C ScalNLO
101 endif
102 
103 clean:
104  rm -f *.o *~ *.exe
105  rm -f *~ */*~
106 
107 clobber: clean
108  make -C Zee clobber
109  make -C Zmumu clobber
110  make -C ZmumuNLO clobber
111  make -C Wenu clobber
112  make -C Wmunu clobber
113  make -C WmunuNLO clobber
114  make -C ttbar clobber
115  make -C Htautau clobber
116  make -C Ztautau clobber
117  make -C ScalNLO clobber