--- PamCut/makefile 2009/05/27 13:30:01 1.1.1.1 +++ PamCut/makefile 2010/02/08 11:51:29 1.7 @@ -26,17 +26,26 @@ # "#ifdef DEBUGPAMCUT" and "#endif"). Note that if you # use debug instructions also in the .h code (headers) you will also have to add -DDEBUGPAMCUT # to the compiler options for the main analysis program. +# 3) Since this is a general compiler flag it can also be used, eg., to set the -m32 flag OPTIMIZE = -g3 #-DDEBUGPAMCUT +# Linker flags +# The flags defined here will be directly inserted into the linker invocation. Place here the +# -m32 flag, for example. +LINKERFLAGS = + # Library flags # Pamela software is modular, so some libraries may not be available in some istallations. # To avoid linking problems, here you can define flags to exclude those parts of the # PamCut software which make use of unavailable libraries. Remember to place # the code to be excluded between proper preprocessor directives. See the documentation or the cut # TofNucleiZCut for an example. -EXCLUSIONFLAGS = #-DNO_TOFNUCLEI -DNO_CALONUCLEI -DNO_TRKNUCLEI - +# Since PamCut headers may refer to the optional libraries, it's important to define the same +# flags when compiling the analysis code. Otherwise, analysis code will include PamCut headers which, +# if no exclusion flag is set, will try to include optional software headers. +# Conversely, if you use optional libraries remember to tell it to the linker. +EXCLUSIONFLAGS = -DNO_CALONUCLEI -DNO_TRKNUCLEI -DNO_TOFNUCLEI # Put below the files on which every .cpp must depend on, ie., those files that, # if modified, will trigger a complete recompilation of the project. @@ -62,13 +71,18 @@ endif # All Target -all: version libPamCut.so - +all: libPamCut.so + @echo + @echo "**** Compiler version and compilation host ****" + @$(C++) --version | grep GCC + @hostname + @echo + # Tool invocations libPamCut.so: $(OBJS) $(USER_OBJS) @echo 'Building target: $@' @echo 'Invoking: GCC C++ Linker' - $(C++) -shared -o"libPamCut.so" $(OBJS) + $(C++) -shared $(LINKERFLAGS) -o"libPamCut.so" $(OBJS) @echo 'Finished building target: $@' @echo ' ' @@ -77,7 +91,24 @@ -$(RM) $(CPP_DEPS) $(OBJS) libPamCut.so -@echo ' ' -version: - @gcc --version | grep gcc; echo +distclean: + @rm -f ${PAM_LIB}/libPamCut.so + @rm -rf ${PAM_INC}/PamCut + @echo Installed files successfully removed. + +install: + @if [[ "${PAM_INC}" == "" || "${PAM_LIB}" == "" ]]; then \ + echo Pamela environment not set. ; \ + else \ + rootdir=`pwd`; \ + for file in `find -name "*.h"`; do \ + dir=`dirname $${file} | sed 's/.\///'`; \ + mkdir -p ${PAM_INC}/PamCut/$${dir}; \ + cp -u $${file} ${PAM_INC}/PamCut/$${dir}; \ + done; \ + cp -u libPamCut.so ${PAM_LIB}; \ + fi + @echo PamCut installed. + +.PHONY: all clean distclean install -.PHONY: all clean dependents version