1 | ################################################################################ |
---|
2 | # Makefile for building a HepMC PYTHIA8 example |
---|
3 | # |
---|
4 | # Lynn Garren garren@fnal.gov |
---|
5 | # |
---|
6 | # main31 and main32 have been copied from PYTHIA 8.157 |
---|
7 | # you must source either config.csh or config.sh first |
---|
8 | # |
---|
9 | # ./main31.exe |
---|
10 | # ./main32.exe main32.cmnd hepmcout32.dat |
---|
11 | # |
---|
12 | ################################################################################ Define directory paths |
---|
13 | # You may have to change PYTHIA8_HOME and/or other variables |
---|
14 | # |
---|
15 | HepMCdir = /afs/cern.ch/sw/lcg/external/HepMC/2.06.08/x86_64-slc5-gcc41-opt |
---|
16 | HEPMCLOCATION = $(HepMCdir) |
---|
17 | HepMClib = -L$(HEPMCLOCATION)/lib -Wl,-rpath -Wl,$(HEPMCLOCATION)/lib \ |
---|
18 | -lHepMC |
---|
19 | Pythia_LIB = -L$(PYTHIA8_HOME)/lib -Wl,-rpath -Wl,$(PYTHIA8_HOME)/lib \ |
---|
20 | -lpythia8 -llhapdfdummy -lhepmcinterface |
---|
21 | |
---|
22 | ################################################################################ Compiler options |
---|
23 | # |
---|
24 | CXX = g++ |
---|
25 | INCLUDES = -I$(HEPMCLOCATION)/include -I$(PYTHIA8_HOME)/include |
---|
26 | CXXFLAGS = -O -ansi -pedantic -Wall -D_GNU_SOURCE -O2 -g -Wshadow -fbounds-check $(INCLUDES) |
---|
27 | ifeq "$(CXX)" "g++" |
---|
28 | FLAGS = $(DFLG) -fno-second-underscore $(INCDIR) |
---|
29 | else |
---|
30 | FLAGS = $(DFLG) $(INCDIR) |
---|
31 | endif |
---|
32 | |
---|
33 | LINK_LIBS = |
---|
34 | |
---|
35 | UNAME = $(shell uname) |
---|
36 | ifneq "$(UNAME)" "Darwin" |
---|
37 | LINK_LIBS += -Wl,-rpath -Wl,$(HepMCdir)/lib |
---|
38 | endif |
---|
39 | |
---|
40 | HDRS = $(HepMCdir)/include/HepMC/*.h *.h |
---|
41 | EXAMPLES = main31.exe main32.exe |
---|
42 | |
---|
43 | ############################################################################### |
---|
44 | # |
---|
45 | .SUFFIXES: .o .cc .exe |
---|
46 | |
---|
47 | all: $(EXAMPLES) |
---|
48 | |
---|
49 | main31.exe: main31.o |
---|
50 | $(CXX) $(CXXFLAGS) -o $@ main31.o \ |
---|
51 | $(Pythia_LIB) \ |
---|
52 | $(HepMClib) |
---|
53 | |
---|
54 | main32.exe: main32.o |
---|
55 | $(CXX) $(CXXFLAGS) -o $@ main32.o \ |
---|
56 | $(Pythia_LIB) \ |
---|
57 | $(HepMClib) |
---|
58 | |
---|
59 | ############################################################################### |
---|
60 | # |
---|
61 | .cc.o: $(HDRS) $< |
---|
62 | $(CXX) $(CXXFLAGS) -c $< -o $@ |
---|
63 | |
---|
64 | ############################################################################### |
---|
65 | # gmake clean removes all garbage from HepMC directories. |
---|
66 | # gmake distclean removes all compiled libraries, executables, +garbage |
---|
67 | # |
---|
68 | clean: |
---|
69 | rm -f *.o |
---|
70 | |
---|
71 | distclean: |
---|
72 | $(MAKE) clean --no-print-directory |
---|
73 | rm -f $(EXAMPLES) |
---|
74 | rm -f *.dat |
---|