This repository was archived by the owner on Oct 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
74 lines (59 loc) · 2.5 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
# Makefile is a part of the PYTHIA event generator.
# Copyright (C) 2015 Torbjorn Sjostrand.
# PYTHIA is licenced under the GNU GPL version 2, see COPYING for details.
# Please respect the MCnet Guidelines, see GUIDELINES for details.
# Author: Philip Ilten, September 2014.
#
# This is is the Makefile used to build PYTHIA examples on POSIX systems.
# Example usage is:
# make main01
# For help using the make command please consult the local system documentation,
# i.e. "man make" or "make --help".
################################################################################
# VARIABLES: Definition of the relevant variables from the configuration script.
################################################################################
# Include the configuration.
-include Makefile.inc
# Handle GZIP support.
ifeq ($(GZIP_USE),true)
CXX_COMMON+= -DGZIPSUPPORT
CXX_COMMON+= -L$(BOOST_LIB) -Wl,-rpath $(BOOST_LIB) -lboost_iostreams
CXX_COMMON+= -L$(GZIP_LIB) -Wl,-rpath $(GZIP_LIB) -lz
endif
# Check distribution (use local version first, then installed version).
ifneq ("$(wildcard ../lib/libpythia8.a)","")
PREFIX_LIB=../lib
PREFIX_INCLUDE=../include
endif
CXX_COMMON:=-I$(PREFIX_INCLUDE) $(CXX_COMMON) -Wl,-rpath $(PREFIX_LIB) -ldl
################################################################################
# RULES: Definition of the rules used to build the PYTHIA examples.
################################################################################
# Rules without physical targets (secondary expansion for specific rules).
.SECONDEXPANSION:
.PHONY: all clean
# All targets (no default behavior).
all:
@echo "Usage: make mainXX"
# The Makefile configuration.
Makefile.inc:
$(error Error: PYTHIA must be configured, please run "./configure"\
in the top PYTHIA directory)
# PYTHIA libraries.
$(PREFIX_LIB)/libpythia8.a :
$(error Error: PYTHIA must be built, please run "make"\
in the top PYTHIA directory)
# Examples without external dependencies.
main% : main%.cc $(PREFIX_LIB)/libpythia8.a
$(CXX) $^ -o $@ $(CXX_COMMON)
main42_new: main42_new.cc $(PREFIX_LIB)/libpythia8.a
$(CXX) $^ -o $@ $(CXX_COMMON)
coalescence: coalescence.cc $(PREFIX_LIB)/libpythia8.a
$(CXX) $^ -o $@ $(CXX_COMMON)
# Clean.
clean:
@rm -f main[0-9][0-9]; rm -f out[0-9][0-9];\
rm -f mymain[0-9][0-9]; rm -f myout[0-9][0-9];\
rm -f test[0-9][0-9][0-9]; rm -f out[0-9][0-9][0-9];\
rm -f weakbosons.lhe; rm -f Pythia8.promc; rm -f hist.root;\
rm -f *~; rm -f \#*; rm -f core*; rm -f *Dct.*