--- DarthVader/Makefile 2006/11/08 09:36:58 1.20 +++ DarthVader/Makefile 2009/08/04 14:01:14 1.47 @@ -1,46 +1,12 @@ # DarthVader flight analysis software # SOFTWARE VERSION IS -VER= v2r00 -# An almost general purpouse Makefile for PAMELA repository -# Let's start with some usefull definition for colorize the echo -RED='\E[1;31;40m' -GREEN='\E[1;32;40m' -YELLOW='\E[1;33;40m' -BLUE='\E[1;34;40m' -WHITE='\E[1;37;40m' -VIOLET='\E[1;35;40m' -CYAN='\E[1;36;40m' -# Here the echo definition to use them -EVIOLET=echo -e ${VIOLET} -ECYAN=echo -e ${CYAN} -ERED=echo -e ${RED} -EGREEN=echo -e ${GREEN} -EYELLOW=echo -e ${YELLOW} -EBLUE=echo -e ${BLUE} -EWHITE=echo -e ${WHITE} -# Reset the terminal -RESET=tput sgr0 -# Here the variables used to override the standard make flags -#MAKE -MAKE=make -# C -CC=gcc -#CFLAGS=-Wall -O -fPIC -pthread -g -CFLAGS=-Wall -O -fPIC -pthread -# Enviroment: -GCCVER=`gcc --version | head -1` -UNAMEA=`uname -a` -TODAY=`date` -# F77 -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 -# C++ -CXX=g++ -#CXXFLAGS=-Wall -O -fPIC -pthread -g -CXXFLAGS=-Wall -O -fPIC -pthread -# ROOTCINT -ROOTCINT=rootcint +VER= v6r01 +# +include Make.def +#CERNLIB +CERNLIB=./docs/cernlib_pam +#CERNLIB=cernlib + # Here the variables definig the local directories DIRTOP=${shell pwd} #DIRLIB=../lib/${ARCH} @@ -109,7 +75,7 @@ MACROSSRCS= -CALIBFILES=${DIRCALIB}/trk-param ${DIRCALIB}/cal-param ${DIRCALIB}/tof-param +CALIBFILES=${DIRCALIB}/trk-param ${DIRCALIB}/cal-param ${DIRCALIB}/tof-param ${DIRCALIB}/orb-param DOCFILES= @@ -134,8 +100,9 @@ all: @for dir in `echo ${SUBDIR}`; do \ - echo "Making all in $${dir}"; \ - (cd $${dir} && ${MAKE} all); \ + (${EBLUE} "Making all in $${dir}"; ${RESET});\ + (cd $${dir} &>/dev/null && ${MAKE} -s all); \ +# (cd $${dir} &>/dev/null && ${MAKE} all); \ done; make locall locall: prepare libs exe @@ -187,7 +154,7 @@ # create .so # @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${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 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 1>/dev/null @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) ${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS} @@ -200,13 +167,15 @@ # create .so # @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) - @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${FOBJS} ${COBJS} 1>/dev/null + @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $(LG2C) -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${FOBJS} ${COBJS} 1>/dev/null @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) ${CXXEXELIBS}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS} @(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) - @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${OBJS} ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libsgp4.so ${PAM_YODA}/lib/libyoda.so ${PAM_LIB}/libshift.so -lThread `root-config --cflags --glibs` `cernlib_noshift mathlib` - @${CXX} ${CXXFLAGS} -Xlinker -soname=libDarthVader_${VER}.so -shared -o ${DIRTOP}/${DIRLIB}/libDarthVader_${VER}.so -lg2c ${DIRTOP}/${DIRLIB}/libAcLevel2.so ${DIRTOP}/${DIRLIB}/libCaloLevel2.so ${PAM_LIB}/libsgp4.so ${DIRTOP}/${DIRLIB}/libNDLevel2.so ${DIRTOP}/${DIRLIB}/libS4Level2.so ${DIRTOP}/${DIRLIB}/libToFLevel2.so ${DIRTOP}/${DIRLIB}/libTrigLevel2.so ${DIRTOP}/${DIRLIB}/libTrkLevel2.so ${DIRTOP}/${DIRLIB}/libTrkLevel1.so ${PAM_LIB}/libGLTables.so ${DIRTOP}/${DIRLIB}/libRunInfo.so ${DIRTOP}/${DIRLIB}/libOrbitalInfo.so `cernlib mathlib` + @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${OBJS} ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libsgp4.so ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` `${CERNLIB} mathlib` + @(${EGREEN} "Creating libDarthVader.so library: "${WHITE} "libDarthVader_${VER}.so"; ${RESET}) + @${CXX} ${CXXFLAGS} -Xlinker -soname=libDarthVader_${VER}.so -shared -o ${DIRTOP}/${DIRLIB}/libDarthVader_${VER}.so $(LG2C) ${DIRTOP}/${DIRLIB}/libAcLevel2.so ${DIRTOP}/${DIRLIB}/libCaloLevel0.so ${DIRTOP}/${DIRLIB}/libCaloLevel1.so ${DIRTOP}/${DIRLIB}/libCaloLevel2.so ${PAM_LIB}/libsgp4.so ${DIRTOP}/${DIRLIB}/libNDLevel2.so ${DIRTOP}/${DIRLIB}/libS4Level2.so ${DIRTOP}/${DIRLIB}/libToFLevel2.so ${DIRTOP}/${DIRLIB}/libTrigLevel2.so ${DIRTOP}/${DIRLIB}/libTrkLevel2.so ${DIRTOP}/${DIRLIB}/libTrkLevel1.so ${DIRTOP}/${DIRLIB}/libTrkLevel0.so ${DIRTOP}/${DIRLIB}/libTrkHough.so ${DIRTOP}/${DIRLIB}/libTrkCalib.so ${DIRTOP}/${DIRLIB}/libTrkParams.so ${PAM_LIB}/libGLTables.so ${DIRTOP}/${DIRLIB}/libRunInfo.so ${DIRTOP}/${DIRLIB}/libOrbitalInfo.so ${DIRTOP}/${DIRLIB}/libOrientationInfo.so ${DIRTOP}/${DIRLIB}/libInclinationInfo.so `root-config --glibs` `${CERNLIB} mathlib` + # @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${OBJS} ${PAM_YODA}/lib/libyoda.so ${PAM_YODA}/lib/libutils.so -lThread `root-config --cflags --glibs` `cernlib mathlib` # A small target to check environmental variables @@ -227,9 +196,9 @@ # Here what has to be deleted in clean target clean: @for dir in `echo ${SUBDIR}`; do \ - echo "Making clean in $${dir}"; \ - (cd $${dir} && ${MAKE} clean); \ - done; make locclean + (${EBLUE} "Making clean in $${dir}"; ${RESET});\ + (cd $${dir} &>/dev/null && ${MAKE} -s clean); \ + done; make -s locclean locclean: TOBEDEL= ${DIRSRC}/*.o ${DIRSRC}/*Dict.cpp ${DIRSRC}/*Dict.h ${FOBJS} ${FULLLIBS} ${DIRBIN}/${CXXEXELIBS} ${CPPOBJS} ${CXXEXEOBJS} ${FULLLINKCLIBS} ${FULLMACROCLIBS} ${FULLLINKMACROCLIBS} ${DIRSRC}/DarthVaderVerl2.cpp locclean: @@ -237,9 +206,9 @@ distclean: @for dir in `echo ${SUBDIR}`; do \ - echo "Making distclean in $${dir}"; \ - (cd $${dir} && ${MAKE} distclean); \ - done; make locdistclean + (${EBLUE} "Making distclean in $${dir}"; ${RESET});\ + (cd $${dir} &>/dev/null && ${MAKE} -s distclean); \ + done; make -s locdistclean locdistclean: clean locdistclean: TOBEDEL= ${DIRBIN} ${DIRLIB} @@ -249,8 +218,8 @@ forceinstall: @for dir in `echo ${SUBDIR}`; do \ - echo "Making forceinstall in $${dir}"; \ - (cd $${dir} && ${MAKE} forceinstall); \ + (${EBLUE} "Making forceinstall in $${dir}"; ${RESET});\ + (cd $${dir} &>/dev/null && ${MAKE} -s forceinstall); \ done; make locforceinstall locforceinstall: FORCE=-f @@ -258,21 +227,32 @@ upgrade: @for dir in `echo ${SUBDIR}`; do \ - echo "Making upgrade in $${dir}"; \ - (cd $${dir} && ${MAKE} upgrade); \ - done; make locupgrade + (${EBLUE} "Making upgrade in $${dir}"; ${RESET});\ + (cd $${dir}&>/dev/null && ${MAKE} -s upgrade); \ + done; make -s locupgrade locupgrade: FORCE=-u locupgrade: locinstall +upgradenc: + @for dir in `echo ${SUBDIR}`; do \ + (${EBLUE} "Making upgradenc in $${dir}"; ${RESET});\ + (cd $${dir}&>/dev/null && ${MAKE} -s upgrade); \ + done; make -s locupgradenc + +locupgradenc: FORCE=-u +locupgradenc: locinstallnc + install: @for dir in `echo ${SUBDIR}`; do \ - echo "Making install in $${dir}"; \ - (cd $${dir} && ${MAKE} install); \ - done; make locinstall + (${EBLUE} "Making install in $${dir}"; ${RESET});\ + (cd $${dir} &>/dev/null && ${MAKE} -s install); \ + done; make -s locinstall locinstall: installlib installinc installmacros installcalib installdoc installexe installcmacro +locinstallnc: installlib installinc installmacros installdoc installexe installcmacro + installlib: LINK=y installlib: TOBEMOVED= $(FULLLIBS:${DIRLIB}%=${PAM_LIB}%) installlib: ORIGIN=${DIRLIB}