hepmc - Rev 37
Subversion Repositories:
################################################################################ Makefile for building a HepMC shared library with the gcc compiler# Matt.Dobbs@CERN.CH 1.2000## This makefiles also works to compile the example programs.# I.E.: syntax for compiling the example_MyPythia.cxx example:# gmake examples/example_MyPythia.exe# or simply gmake examples to compile all examples.# This should be run from the main HepMC directory. The executables will# be placed in the examples directory.################################################################################# Define directory paths# You may have to change Pythia_LIB and/or other variables.# DOXYGENdir, DOXYGEN_REFERENCEdir, LATEX_USER_MANUALdir, DISTRIBUTIONdir# are for developers only, ignore them.#HepMCdir = @prefix@HepMClib = $(HepMCdir)/lib/libHepMC.aHepMCfiolib = $(HepMCdir)/lib/libHepMCfio.aCLHEPdir = @CLHEPdir@GENSERdir = @GENSERdir@Pythia_LIB = -L$(GENSERdir)/lib -lpythia6_403 -lpythia6_403_dumm -lpythia6_403_pdfdumm $(initpydata_OBJ)Herwig_LIB = -L$(GENSERdir)/lib -lherwig6_510 -lherwig6_510_dumm -lherwig6_510_pdfdumm################################################################################ Compiler options#CXX = @CXX@INCLUDES = -I$(HepMCdir)/include -I$(CLHEPdir)/includeCXXFLAGS = @AM_CXXFLAGS@ @CXXFLAGS@ $(INCLUDES)ifeq "$(CXX)" "g++"F77 = g77FLAGS = $(DFLG) -fno-second-underscore $(INCDIR)elseF77 = f77FLAGS = $(DFLG) $(INCDIR)endifCLHEP_LIB = -L$(CLHEPdir)/lib -lCLHEPinitpydata_OBJ= initpydata.oLINK_LIBS = @AM_LDFLAGS@SRCS = example_BuildEventFromScratch.cc \example_EventSelection.cc \example_MyHerwig.cc \example_MyPythia.cc \example_MyPythiaOnlyToHepMC.cc \example_MyPythiaWithEventSelection.cc \example_PythiaParticle.cc \example_ReadPDGtable.cc \example_UsingIterators.cc \initpydata.fHDRS = $(HepMCdir)/include/HepMC/*.hEXAMPLES = example_BuildEventFromScratch.exe \example_EventSelection.exe \example_MyHerwig.exe \example_MyPythia.exe \example_MyPythiaOnlyToHepMC.exe \example_MyPythiaWithEventSelection.exe \example_PythiaParticle.exe \example_ReadPDGtable.exe \example_UsingIterators.exe################################################################################PLATFORM=$(shell uname)ifeq "$(PLATFORM)" "IRIX"IRIX6 = $(findstring 6,$(shell uname -r))ifeq "$(IRIX6)" "6"PLATFORM=IRIX64endifendififeq "$(PLATFORM)" "HP-UX"LINK_LIBS += -lg2c -lftn -lfendififeq "$(PLATFORM)" "IRIX"LINK_LIBS += -lg2c -lftnendififeq "$(PLATFORM)" "IRIX64"LINK_LIBS += -lg2c -lftnendififeq "$(PLATFORM)" "Linux"LINK_LIBS += -lg2cendififeq "$(PLATFORM)" "OSF1"LINK_LIBS += -lfor -lUforendififeq "$(PLATFORM)" "SunOS"LINK_LIBS += -lg2cendif################################################################################ HP-UX Options and Fixes# see http://consult.cern.ch/qa/2534 for hint at HP-UX solution#PLATFORM=$(shell uname)ifeq "$(PLATFORM)" "HP-UX"LINK_LIBS = $(LINK_LIBS) -lfendif################################################################################ definition of the compiler options# -I location of directory containing include files# -L location of directory containing libraries# -lname include the library from -L location called libname.a# -lg2c is the library containing info on converting fortran to C# -lf is the library containing the intrinsic for HPUX only.# -shared make a shared library as output# -fPIC produce position independent code# necessary on some platforms (including HPUX) for -shared# -fpic ^^ same(?)# -O optimizes# -g produces output for the debugger# -pg produces output for gprof profiler# note: if you want to see all warnings and ensure ansi standard# compatibility, use:# -pipe -ansi -pedantic -fnonnull-objects \# -W -Wall -Wwrite-strings -Wpointer-arith -Wnested-externs \# -Woverloaded-virtual -Wbad-function-cast -fnonnull-objects# The proper order for cernlib libraries is:# -lpawlib -lgraflib -lgrafX11 -lmathlib -lkernlib -lpacklib -ljetset74## makefile syntax:# for target thedir/target.suf from source anotherdir/source.suf2# ${*D} = thedir# ${*F} = target# $* = thedir/target# $@ = thedir/target.suf# $< = anotherdir/source.suf2#################################################################################.SUFFIXES: .o .cxx .f .exeall: $(initpydata_OBJ) $(EXAMPLES)example_BuildEventFromScratch.exe: $(initpydata_OBJ) example_BuildEventFromScratch.o@echo "Building $@ ..."$(CXX) $(FLAGS) example_BuildEventFromScratch.o \$(HepMClib) \$(LINK_LIBS) -o $@example_EventSelection.exe: $(initpydata_OBJ) example_EventSelection.o@echo "Building $@ ..."$(CXX) $(FLAGS) example_EventSelection.o \$(HepMClib) \$(LINK_LIBS) -o $@example_MyHerwig.exe: $(initpydata_OBJ) example_MyHerwig.o@echo "Building $@ ..."$(CXX) $(FLAGS) example_MyHerwig.o \$(HepMClib) $(HepMCfiolib) \$(Herwig_LIB) $(LINK_LIBS) -o $@example_MyPythia.exe: $(initpydata_OBJ) example_MyPythia.o@echo "Building $@ ..."$(CXX) $(FLAGS) example_MyPythia.o \$(HepMClib) $(HepMCfiolib) \$(Pythia_LIB) $(LINK_LIBS) -o $@example_MyPythiaOnlyToHepMC.exe: $(initpydata_OBJ) example_MyPythiaOnlyToHepMC.o@echo "Building $@ ..."$(CXX) $(FLAGS) example_MyPythiaOnlyToHepMC.o \$(HepMClib) $(HepMCfiolib) \$(Pythia_LIB) $(LINK_LIBS) -o $@example_MyPythiaWithEventSelection.exe: $(initpydata_OBJ) example_MyPythiaWithEventSelection.o@echo "Building $@ ..."$(CXX) $(FLAGS) example_MyPythiaWithEventSelection.o \$(HepMClib) $(HepMCfiolib) \$(Pythia_LIB) $(LINK_LIBS) -o $@example_PythiaParticle.exe: $(initpydata_OBJ) example_PythiaParticle.o@echo "Building $@ ..."$(CXX) $(FLAGS) example_PythiaParticle.o \$(HepMClib) $(HepMCfiolib) \$(Pythia_LIB) \$(CLHEP_LIB) $(LINK_LIBS) -o $@example_ReadPDGtable.exe: $(initpydata_OBJ) example_ReadPDGtable.o@echo "Building $@ ..."$(CXX) $(FLAGS) example_ReadPDGtable.o \$(HepMClib) \$(LINK_LIBS) -o $@example_UsingIterators.exe: $(initpydata_OBJ) example_UsingIterators.o@echo "Building $@ ..."$(CXX) $(FLAGS) example_UsingIterators.o \$(HepMClib) \$(LINK_LIBS) -o $@################################################################################ instructions for building a .o file from a .cxx file#.cc.o: $(HDRS) $<@echo "Compiling $< with $(CXX) ..."@$(CXX) $(CXXFLAGS) -c $< -o $@################################################################################ instructions for building a .o file from a .f file#.f.o: $<@echo "Compiling $< with $(F77) ..."@$(F77) $(FLAGS) -c $< -o $@################################################################################ gmake clean removes all garbage from HepMC directories.#clean:rm -f *.o################################################################################ gmake distclean removes all compiled libraries, executables, +garbage# to prepare the package for distributiondistclean:$(MAKE) clean --no-print-directoryrm -f *.exerm -f *.dat
