hepmc - Blame information for rev 308

Subversion Repositories:
Rev:
Rev Author Line No. Line
7 garren 1 ################################################################################ Makefile for building a HepMC shared library with the gcc compiler
2 # Matt.Dobbs@CERN.CH 1.2000
3 #
4 # This makefiles also works to compile the example programs.
43 garren 5 # I.E.: syntax for compiling the example_MyPythia.cc example:
6 # gmake example_MyPythia.exe
7 # or simply gmake all to compile all examples.
7 garren 8 #
9 ################################################################################ Define directory paths
43 garren 10 # You may have to change GENSERdir and/or other variables
7 garren 11 #
37 garren 12 HepMCdir = @prefix@
13 HepMClib = $(HepMCdir)/lib/libHepMC.a
14 HepMCfiolib = $(HepMCdir)/lib/libHepMCfio.a
15 GENSERdir = @GENSERdir@
43 garren 16 CLHEPdir = @CLHEPdir@
76 garren 17 Pythia_LIB = -L$(GENSERdir)/lib -lpythia6_403 -lpythia6_403_dumm -lpythia6_403_pdfdumm
37 garren 18 Herwig_LIB = -L$(GENSERdir)/lib -lherwig6_510 -lherwig6_510_dumm -lherwig6_510_pdfdumm
7 garren 19  
20 ################################################################################ Compiler options
21 #
22 CXX = @CXX@
37 garren 23 INCLUDES = -I$(HepMCdir)/include -I$(CLHEPdir)/include
7 garren 24 CXXFLAGS = @AM_CXXFLAGS@ @CXXFLAGS@ $(INCLUDES)
25 ifeq "$(CXX)" "g++"
26 F77 = g77
27 FLAGS = $(DFLG) -fno-second-underscore $(INCDIR)
28 else
29 F77 = f77
30 FLAGS = $(DFLG) $(INCDIR)
31 endif
32 CLHEP_LIB = -L$(CLHEPdir)/lib -lCLHEP
33 initpydata_OBJ= initpydata.o
76 garren 34 pythia_OBJ = initPythia.o initpydata.o
291 garren 35 LINK_LIBS =
7 garren 36 SRCS = example_BuildEventFromScratch.cc \
37 example_EventSelection.cc \
38 example_MyHerwig.cc \
39 example_MyPythia.cc \
40 example_MyPythiaOnlyToHepMC.cc \
41 example_UsingIterators.cc \
234 garren 42 testPythiaCopies.cc \
43 testHerwigCopies.cc \
76 garren 44 initPythia.cc \
7 garren 45 initpydata.f
76 garren 46 HDRS = $(HepMCdir)/include/HepMC/*.h *.h
7 garren 47 EXAMPLES = example_BuildEventFromScratch.exe \
48 example_EventSelection.exe \
49 example_MyHerwig.exe \
50 example_MyPythia.exe \
51 example_MyPythiaOnlyToHepMC.exe \
234 garren 52 example_UsingIterators.exe \
53 testPythiaCopies.exe \
54 testHerwigCopies.exe
7 garren 55  
56 ################################################################################
57  
58 PLATFORM=$(shell uname)
59  
60 ifeq "$(PLATFORM)" "Linux"
61 LINK_LIBS += -lg2c
62 endif
63  
64 ################################################################################ definition of the compiler options
65 # -I location of directory containing include files
66 # -L location of directory containing libraries
67 # -lname include the library from -L location called libname.a
68 # -lg2c is the library containing info on converting fortran to C
69 # -lf is the library containing the intrinsic for HPUX only.
70 # -shared make a shared library as output
71 # -fPIC produce position independent code
72 # necessary on some platforms (including HPUX) for -shared
73 # -fpic ^^ same(?)
74 # -O optimizes
75 # -g produces output for the debugger
76 # -pg produces output for gprof profiler
77 # note: if you want to see all warnings and ensure ansi standard
78 # compatibility, use:
79 # -pipe -ansi -pedantic -fnonnull-objects \
80 # -W -Wall -Wwrite-strings -Wpointer-arith -Wnested-externs \
81 # -Woverloaded-virtual -Wbad-function-cast -fnonnull-objects
82 # The proper order for cernlib libraries is:
83 # -lpawlib -lgraflib -lgrafX11 -lmathlib -lkernlib -lpacklib -ljetset74
84 #
85 # makefile syntax:
86 # for target thedir/target.suf from source anotherdir/source.suf2
87 # ${*D} = thedir
88 # ${*F} = target
89 # $* = thedir/target
90 # $@ = thedir/target.suf
91 # $< = anotherdir/source.suf2
92 #
93  
94 ###############################################################################
95 #
96 .SUFFIXES: .o .cxx .f .exe
43 garren 97 all: $(EXAMPLES)
7 garren 98  
43 garren 99 example_BuildEventFromScratch.exe: example_BuildEventFromScratch.o
7 garren 100 @echo "Building $@ ..."
101 $(CXX) $(FLAGS) example_BuildEventFromScratch.o \
9 garren 102 $(HepMClib) \
43 garren 103 $(CLHEP_LIB) \
7 garren 104 $(LINK_LIBS) -o $@
105  
43 garren 106 example_EventSelection.exe: example_EventSelection.o
7 garren 107 @echo "Building $@ ..."
108 $(CXX) $(FLAGS) example_EventSelection.o \
9 garren 109 $(HepMClib) \
7 garren 110 $(LINK_LIBS) -o $@
111  
43 garren 112 example_MyHerwig.exe: example_MyHerwig.o
7 garren 113 @echo "Building $@ ..."
114 $(CXX) $(FLAGS) example_MyHerwig.o \
9 garren 115 $(HepMClib) $(HepMCfiolib) \
7 garren 116 $(Herwig_LIB) $(LINK_LIBS) -o $@
117  
76 garren 118 example_MyPythia.exe: $(initpydata_OBJ) $(pythia_OBJ) example_MyPythia.o
7 garren 119 @echo "Building $@ ..."
76 garren 120 $(CXX) $(FLAGS) $(pythia_OBJ) example_MyPythia.o \
9 garren 121 $(HepMClib) $(HepMCfiolib) \
7 garren 122 $(Pythia_LIB) $(LINK_LIBS) -o $@
123  
76 garren 124 example_MyPythiaOnlyToHepMC.exe: $(initpydata_OBJ) $(pythia_OBJ) example_MyPythiaOnlyToHepMC.o
7 garren 125 @echo "Building $@ ..."
76 garren 126 $(CXX) $(FLAGS) $(pythia_OBJ) example_MyPythiaOnlyToHepMC.o \
9 garren 127 $(HepMClib) $(HepMCfiolib) \
7 garren 128 $(Pythia_LIB) $(LINK_LIBS) -o $@
129  
43 garren 130 example_UsingIterators.exe: example_UsingIterators.o
7 garren 131 @echo "Building $@ ..."
132 $(CXX) $(FLAGS) example_UsingIterators.o \
9 garren 133 $(HepMClib) \
7 garren 134 $(LINK_LIBS) -o $@
135  
234 garren 136 testPythiaCopies.exe: $(initpydata_OBJ) $(pythia_OBJ) testPythiaCopies.o
137 @echo "Building $@ ..."
138 $(CXX) $(FLAGS) $(pythia_OBJ) testPythiaCopies.o \
139 $(HepMClib) $(HepMCfiolib) \
140 $(Pythia_LIB) $(LINK_LIBS) -o $@
141  
142 testHerwigCopies.exe: testHerwigCopies.o
143 @echo "Building $@ ..."
144 $(CXX) $(FLAGS) testHerwigCopies.o \
145 $(HepMClib) $(HepMCfiolib) \
146 $(Herwig_LIB) $(LINK_LIBS) -o $@
147  
7 garren 148 ###############################################################################
149 # instructions for building a .o file from a .cxx file
150 #
151 .cc.o: $(HDRS) $<
152 @echo "Compiling $< with $(CXX) ..."
153 @$(CXX) $(CXXFLAGS) -c $< -o $@
154  
155 ###############################################################################
156 # instructions for building a .o file from a .f file
157 #
158 .f.o: $<
159 @echo "Compiling $< with $(F77) ..."
160 @$(F77) $(FLAGS) -c $< -o $@
161  
162 ###############################################################################
163 # gmake clean removes all garbage from HepMC directories.
164 #
165 clean:
166 rm -f *.o
167  
168 ###############################################################################
169 # gmake distclean removes all compiled libraries, executables, +garbage
170 # to prepare the package for distribution
171 distclean:
172 $(MAKE) clean --no-print-directory
173 rm -f *.exe
174 rm -f *.dat
175