source: HiSusy/trunk/Pythia8/pythia8170/rootexamples/Makefile @ 1

Last change on this file since 1 was 1, checked in by zerwas, 11 years ago

first import of structure, PYTHIA8 and DELPHES

File size: 2.1 KB
Line 
1######################################################################
2# Makefile for building Pythia's ROOT examples.
3# Axel Naumann, 2011-03-03
4######################################################################
5
6# Need this to get SHAREDSUFFIX (e.g. dylib or so)
7-include ../config.mk
8
9# A few variables used in this Makefile:
10EX           := hist tree
11EXE          := $(addsuffix .exe,$(EX))
12PYTHIA8      ?= $(PWD)/..
13STATICLIB    := $(PYTHIA8)/lib/archive/libpythia8.a
14SHAREDLIB    := $(PYTHIA8)/lib/libpythia8.$(SHAREDSUFFIX)
15DICTCXXFLAGS := -I$(PYTHIA8)/include
16ROOTCXXFLAGS := $(DICTCXXFLAGS) $(shell root-config --cflags)
17
18# Libraries to include if GZIP support is enabled
19ifeq (x$(ENABLEGZIP),xyes)
20LIBGZIP=-L$(BOOSTLIBLOCATION) -lboost_iostreams -L$(ZLIBLOCATION) -lz
21endif
22
23# LDFLAGS1 for static library, LDFLAGS2 for shared library
24LDFLAGS1 := $(shell root-config --ldflags --glibs) \
25  -L$(PYTHIA8)/lib/archive -lpythia8 -llhapdfdummy $(LIBGZIP)
26LDFLAGS2 := $(shell root-config --ldflags --glibs) \
27  -L$(PYTHIA8)/lib -lpythia8 -llhapdfdummy $(LIBGZIP)
28
29# Default target; make examples (but not shared dictionary)
30all: $(EX)
31
32# Rule to build hist example. Needs static PYTHIA 8 library
33hist: $(STATICLIB) hist.cc
34        $(CXX) $(ROOTCXXFLAGS) $@.cc -o $@.exe $(LDFLAGS1)
35
36# Rule to build tree example. Needs dictionary to be built and
37# static PYTHIA 8 library
38tree: $(STATICLIB) tree.cc
39        rootcint -f treeDict.cc -c $(DICTCXXFLAGS) pythiaROOT.h pythiaLinkdef.h
40        $(CXX) $(ROOTCXXFLAGS) treeDict.cc $@.cc -o $@.exe $(LDFLAGS1)
41
42# Rule to build full dictionary
43dict: $(SHAREDLIB)
44        rootcint -f pythiaDict.cc -c $(DICTCXXFLAGS) \
45           -DPYTHIA8_COMPLETE_ROOT_DICTIONARY \
46           pythiaROOT.h pythiaLinkdef.h
47        $(CXX) -shared -o pythiaDict.$(SHAREDSUFFIX) pythiaDict.cc \
48         -DPYTHIA8_COMPLETE_ROOT_DICTIONARY \
49         $(ROOTCXXFLAGS) $(LDFLAGS2)
50
51
52# Error messages if PYTHIA libraries don't exist
53$(STATICLIB):
54        @echo "Error: PYTHIA 8 archive library must be built"
55        @false
56$(SHAREDLIB):
57        @echo "Error: PYTHIA 8 shared library must be built"
58        @false
59
60# Clean up
61clean:
62        rm -f $(EXE) hist.root pythiaDict.* \
63               treeDict.cc treeDict.h pytree.root
64
Note: See TracBrowser for help on using the repository browser.