--- DarthVader/Makefile 2007/09/03 08:54:06 1.37 +++ DarthVader/Makefile 2014/04/15 15:48:16 1.59 @@ -1,46 +1,8 @@ # DarthVader flight analysis software # SOFTWARE VERSION IS -VER= v4r00 -# 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 -fPIC -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -# C++ -CXX=g++ -#CXXFLAGS=-Wall -O -fPIC -pthread -g -CXXFLAGS=-Wall -O4 -fPIC -pthread -# ROOTCINT -ROOTCINT=rootcint +VER= v10r06 +# +include Make.def #CERNLIB CERNLIB=./docs/cernlib_pam #CERNLIB=cernlib @@ -137,10 +99,9 @@ #all: test mkbindir mklibdir mkverpath ${FOBJS} ${CPPOBJS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS} all: - @for dir in `echo ${SUBDIR}`; do \ - echo "Making all in $${dir}"; \ - (cd $${dir} && ${MAKE} all); \ - done; make locall + @for dir in `echo ${SUBDIR}`; do (${EBLUE} "Making all in $${dir}"; ${RESET}); (cd $${dir} &>/dev/null && ${MAKE} -s all); done +# @for dir in `echo ${SUBDIR}`; do (${EBLUE} "Making all in $${dir}"; ${RESET}); (cd $${dir} && ${MAKE} all); done + @make -s locall ; locall: prepare libs exe locall: @@ -191,7 +152,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} @@ -204,13 +165,14 @@ # 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 -lThread `root-config --cflags --glibs` `${CERNLIB} mathlib` - @${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 `${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 ${DIRTOP}/${DIRLIB}/libExtTrkingAlg.so ${DIRTOP}/${DIRLIB}/libExtTrack.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` @@ -232,9 +194,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: @@ -242,9 +204,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} @@ -254,8 +216,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 @@ -263,27 +225,27 @@ 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 \ - echo "Making upgrade in $${dir}"; \ - (cd $${dir} && ${MAKE} upgrade); \ - done; make locupgradenc + (${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 @@ -327,7 +289,7 @@ @${test_and_cp} mkverpath: - @echo '#include ' > ${DIRTOP}/${DIRSRC}/DarthVaderVerl2.cpp; echo ' char *DarthVaderInfo(bool print){ if ( print ) printf("\nPAMELA Level2 flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> ${DIRTOP}/${DIRSRC}/DarthVaderVerl2.cpp + @echo '#include ' > ${DIRTOP}/${DIRSRC}/DarthVaderVerl2.cpp; echo 'const char *DarthVaderInfo(bool print){ if ( print ) printf("\nPAMELA Level2 flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> ${DIRTOP}/${DIRSRC}/DarthVaderVerl2.cpp @sleep 0.8