--- tracker/flight/TrkNuclei/Makefile 2010/03/30 07:56:41 1.2 +++ tracker/flight/TrkNuclei/Makefile 2010/03/30 08:02:47 1.3 @@ -29,9 +29,23 @@ 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 +LG2C=-lg2c +EXTRAOPT=-Wno-globals -fvxt +endif #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 ${PAM_BIT} +F77FLAGS= -Wall -funroll-loops -fPIC $(EXTRAOPT) -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT} +#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT} # C++ CXX=g++ #CXXFLAGS=-Wall -O -fPIC -pthread -g @@ -129,7 +143,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} @@ -154,7 +168,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 ${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} @@ -167,7 +181,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}