--- PamelaLevel2/Makefile 2007/01/15 11:51:38 1.13 +++ PamelaLevel2/Makefile 2014/10/17 06:54:10 1.35 @@ -1,6 +1,6 @@ -# Calorimeter flight analysis software +# PamelaLevel2 software # SOFTWARE VERSION -VER= v3r00 +VER= v11r01 # An almost general purpouse Makefile for PAMELA repository # Let's start with some usefull definition for colorize the echo RED='\E[1;31;40m' @@ -23,20 +23,32 @@ # Here the variables used to override the standard make flags # C CC=gcc -CFLAGS=-Wall -O -fPIC -pthread -g -#CFLAGS=-Wall -O -fPIC -pthread +#CFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT} +CFLAGS=-Wall -O4 -fPIC -pthread ${PAM_BIT} # Enviroment: GCCVER=`gcc --version | head -1` UNAMEA=`uname -a` TODAY=`date` -# F77 +ifeq ($(GCC4),) +export GCCVERS=$(shell echo `gcc -dumpversion | sed 's/\./\ /g'`) +export GCCVERMAJ=$(word 1,$(GCCVERS)) +export GCC4=$(shell echo `echo "${GCCVERMAJ} > 3" |bc -l`) +endif +ifeq ($(GCC4),1) +F77=gfortran +LG2C=-lgfortran +EXTRAOPT= +else F77=g77 -F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash -#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash +LG2C=-lg2c +EXTRAOPT=-Wno-globals -fvxt +endif +#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash ${PAM_BIT} +F77FLAGS= -Wall -funroll-loops -fPIC $(EXTRAOPT) -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT} # C++ CXX=g++ -#CXXFLAGS=-Wall -O -fPIC -pthread -g -CXXFLAGS=-Wall -O -fPIC -pthread +#CXXFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT} +CXXFLAGS=-Wall -O4 -fPIC -pthread ${PAM_BIT} # ROOTCINT ROOTCINT=rootcint # Here the variables definig the local directories @@ -130,7 +142,7 @@ ${LIBF77LIBS}: ${LIBF77OBJS} @(${EYELLOW} " F77 shared library --------------------------") @(${EGREEN} "Creating library: "${WHITE} "$@"; ${RESET}) - @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $^ -lg2c `doc/cernlib_pam mathlib` + @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $^ $(LG2C) `doc/cernlib_pam mathlib` ${LIBROOTLIBS}: ${LIBROOTSRCS} ${FOBJS} @@ -139,19 +151,23 @@ # # Create *Dict.cpp and *Dict.h # - @${ROOTCINT} -f ${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -c -I${ROOTINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC} ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`.h ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`LinkDef.h +# @${ROOTCINT} -f ${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -c -I${ROOTINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC} ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`.h ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`LinkDef.h + @${ROOTCINT} -f ${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -c -I${PAM_INC} -I${ROOTINC} -I${PAM_YODA}/include/yoda/ ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`.h ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`LinkDef.h +# +# order of include directories changed since RunInfo.h can be found (with completely different definition) in YODA while we want to load the DV one! +# should be fixed some time changing names... # # create .o # @(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) - @cd ${DIRSRC} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _${VER}.so | sed s/lib//`.cpp -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ -I${NROOTINC}; + @cd ${DIRSRC} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _${VER}.so | sed s/lib//`.cpp -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ -I${NROOTINC}; @(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) @cd ${DIRSRC} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ -I${NROOTINC}; # # create .so # @(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET}) - @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda -I${PAM_INC} ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.o ${LIBROOTOBJS} `doc/cernlib_pam mathlib` 1>/dev/null + @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $(LG2C) -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda -I${PAM_INC} ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.o ${LIBROOTOBJS} `doc/cernlib_pam mathlib` 1>/dev/null # @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) ${LIBCPPLIBS}: ${LIBCPPSRCS} @@ -164,7 +180,7 @@ # create .so # @(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET}) - @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${PAM_INC} ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o 1>/dev/null + @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $(LG2C) -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${PAM_INC} ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o 1>/dev/null ${CXXEXELIBS}: ${COBJS} ${FOBJS} ${CXXEXEOBJS}