examples/Makefile

00001 include make.inc
00002 
00003 ifneq ($(PHOTOSLOCATION), )
00004 include $(PHOTOSLOCATION)/make.inc
00005 endif
00006 
00007 ROOTLIB       :=  $(shell root-config --glibs)
00008 ROOTINC       :=  $(shell root-config --cflags)
00009 ROOTLIBPATH   :=  $(shell root-config --libdir)
00010 TAUOLA_LIBS    = -L$(TAUOLALOCATION)/lib -lTauolaCxxInterface -lTauolaFortran
00011 PYTHIA_LIBS    = -L$(PYTHIALOCATION)/lib/archive -lpythia8 -llhapdfdummy -lhepmcinterface
00012 MC_TESTER_LIBS = -L$(MCTESTERLOCATION)/lib -lHEPEvent -lHepMCEvent -lMCTester
00013 PHOTOS_LIBS    = -L$(PHOTOSLOCATION)/lib -lPhotosCxxInterface -lPhotosFortran $(HEPMC_LIBS)
00014 HEPMC_LIBS     =
00015 
00016 ifneq ($(HEPMCLOCATION), )
00017   override HEPMC_LIBS += -L$(HEPMCLOCATION)/lib -lHepMC
00018 endif
00019 
00020 all:
00021         @make photos_hepevt_example.exe
00022 ifneq ($(HEPMCLOCATION), )
00023         @make photos_standalone_example.exe
00024 ifneq ($(PYTHIALOCATION), )
00025         @make single_photos_gun_example.exe
00026         @make photosLCG_pythia_example.exe
00027 ifneq ($(MCTESTERLOCATION), )
00028         @make photos_pythia_example.exe
00029 ifneq ($(TAUOLALOCATION), )
00030         @make tauola_photos_pythia_example.exe
00031 endif
00032 endif
00033 endif
00034 endif
00035         @echo "##################################################################"
00036         @echo " Examples compiled successfully. Available examples:"
00037         @if test -e photos_hepevt_example.exe; then \
00038         echo " ./photos_hepevt_example.exe"; fi
00039         @if test -e photos_standalone_example.exe; then \
00040         echo " ./photos_standalone_example.exe"; fi
00041         @if test -e single_photos_gun_example.exe; then \
00042         echo " ./single_photos_gun_example.exe"; fi
00043         @if test -e photosLCG_pythia_example.exe; then \
00044         echo " ./photosLCG_pythia_example.exe"; fi
00045         @if test -e photos_pythia_example.exe; then \
00046         echo " ./photos_pythia_example.exe"; fi
00047         @if test -e tauola_photos_pythia_example.exe; then \
00048         echo " ./tauola_photos_pythia_example.exe"; fi
00049         @echo "##################################################################"
00050 
00051 # Universal example (all paths presents)
00052 %.o: %.cxx
00053         $(CC) $(CFLAGS) -I$(PHOTOSLOCATION)/include -I$(TAUOLALOCATION)/include -I$(PYTHIALOCATION)/include \
00054         -I$(MCTESTERLOCATION)/include -I$(HEPMCLOCATION)/include $(ROOTINC) -c $<
00055 
00056 # Universal example (all paths presents) - linking procedure
00057 %.exe: %.o
00058         $(CC) -o $@ $(LDFLAGS) $< $(ROOTLIB) \
00059         $(TAUOLA_LIBS) $(PYTHIA_LIBS) $(MC_TESTER_LIBS) $(HEPMC_LIBS) $(PHOTOS_LIBS) \
00060         -Wl,-rpath,$(PREFIX)/lib \
00061         -Wl,-rpath,$(PHOTOSLOCATION)/lib \
00062         -Wl,-rpath,$(ROOTLIBPATH) \
00063         -Wl,-rpath,$(TAUOLALOCATION)/lib \
00064         -Wl,-rpath,$(HEPMCLOCATION)/lib \
00065         -Wl,-rpath,$(PYTHIALOCATION)/lib \
00066         -Wl,-rpath,$(MCTESTERLOCATION)/lib
00067 
00068 # Version for pythia example - HepMC, Pythia8 and MC-Tester required
00069 photos_pythia_example.exe: photos_pythia_example.cxx
00070         $(CC) $(CFLAGS) -I$(PHOTOSLOCATION)/include -I$(PYTHIALOCATION)/include \
00071         -I$(MCTESTERLOCATION)/include -I$(HEPMCLOCATION)/include $(ROOTINC) -c $<
00072         $(CC) -o $@ $(LDFLAGS) $(<:.cxx=.o) $(ROOTLIB) \
00073         $(PYTHIA_LIBS) $(MC_TESTER_LIBS) $(HEPMC_LIBS) $(PHOTOS_LIBS) \
00074         -Wl,-rpath,$(PREFIX)/lib \
00075         -Wl,-rpath,$(PHOTOSLOCATION)/lib \
00076         -Wl,-rpath,$(ROOTLIBPATH) \
00077         -Wl,-rpath,$(HEPMCLOCATION)/lib \
00078         -Wl,-rpath,$(PYTHIALOCATION)/lib \
00079         -Wl,-rpath,$(MCTESTERLOCATION)/lib
00080 
00081 # Version for photos gun example - HepMC and Pythia8 required
00082 single_photos_gun_example.exe: single_photos_gun_example.cxx
00083         $(CC) $(CFLAGS) -I$(PHOTOSLOCATION)/include -I$(PYTHIALOCATION)/include \
00084         -I$(HEPMCLOCATION)/include -c $<
00085         $(CC) -o $@ $(LDFLAGS) $(<:.cxx=.o) $(HEPMC_LIBS) $(PYTHIA_LIBS) $(PHOTOS_LIBS) \
00086         -Wl,-rpath,$(PREFIX)/lib \
00087         -Wl,-rpath,$(PHOTOSLOCATION)/lib \
00088         -Wl,-rpath,$(HEPMCLOCATION)/lib \
00089         -Wl,-rpath,$(PYTHIALOCATION)/lib
00090 
00091 # Version for photos LCG example - HepMC and Pythia8 required
00092 photosLCG_pythia_example.exe: photosLCG_pythia_example.cxx
00093         $(CC) $(CFLAGS) -I$(PHOTOSLOCATION)/include -I$(PYTHIALOCATION)/include \
00094         -I$(HEPMCLOCATION)/include -c $<
00095         $(CC) -o $@ $(LDFLAGS) $(<:.cxx=.o) $(HEPMC_LIBS) $(PYTHIA_LIBS) $(PHOTOS_LIBS) \
00096         -Wl,-rpath,$(PREFIX)/lib \
00097         -Wl,-rpath,$(PHOTOSLOCATION)/lib \
00098         -Wl,-rpath,$(HEPMCLOCATION)/lib \
00099         -Wl,-rpath,$(PYTHIALOCATION)/lib
00100 
00101 # Version for photos standalone example - only HepMC required
00102 photos_standalone_example.exe: photos_standalone_example.cxx
00103         $(CC) $(CFLAGS) -I$(PHOTOSLOCATION)/include -I$(HEPMCLOCATION)/include -c $<
00104         $(CC) -o $@ $(LDFLAGS) $(<:.cxx=.o) $(HEPMC_LIBS) $(PHOTOS_LIBS) \
00105         -Wl,-rpath,$(PREFIX)/lib \
00106         -Wl,-rpath,$(PHOTOSLOCATION)/lib \
00107         -Wl,-rpath,$(HEPMCLOCATION)/lib
00108 
00109 # Version for photos HEPEVT example - no other libraries are required
00110 photos_hepevt_example.exe: photos_hepevt_example.cxx
00111         $(CC) $(CFLAGS) -I$(PHOTOSLOCATION)/include -c $<
00112         $(CC) -o $@ $(LDFLAGS) $(<:.cxx=.o) $(HEPMC_LIBS) $(PHOTOS_LIBS) \
00113         -Wl,-rpath,$(PREFIX)/lib \
00114         -Wl,-rpath,$(PHOTOSLOCATION)/lib \
00115         -Wl,-rpath,$(HEPMCLOCATION)/lib
00116 
00117 clean:
00118         rm -f *.o *.a *~ *.exe
00119 
00120 Clean: clean
00121         rm -rf config.log config.status autom4te.cache configure.paths.sh
00122         rm -f make.inc
00123 
00124 make.inc:
00125         @echo ""
00126         @echo "Please execute ./configure first!"
00127         @echo ""
00128         @false
00129 
00130 $(PHOTOSLOCATION)/make.inc:
00131         @echo ""
00132         @echo "Please compile the interface first!"
00133         @echo ""
00134         @false
Generated on Sun Oct 20 20:23:56 2013 for C++InterfacetoPHOTOS by  doxygen 1.6.3