--- eventviewer/flight/Makefile 2006/03/20 10:36:46 1.1.1.1 +++ eventviewer/flight/Makefile 2008/03/06 15:04:58 1.13 @@ -1,50 +1,42 @@ -# FLIGHT EVENT VIEWER +# Flight Event Viewer software # SOFTWARE VERSION -VER= v1r00 -# REQUIRES CALOCOMMON and ROOT2PAW versions -COMMONVER=v1r9 -R2PVER=v3r00 -# installed calocommon version -COMPCOMVER=`echo ${COMMONVER} | tr -d [a-z:A-Z]` -INSTCOMVER=`${PAM_BIN}/calocommon |head -2 |tail -1 | tr -d [a-z:A-Z]` -COMPR2PVER=`echo ${R2PVER} | tr -d [a-z:A-Z]` -INSTR2PVER=`${PAM_BIN}/GroundDataConvert --version |head -2 |tail -1 | sed s/2//\1 | tr -d [a-z:A-Z]` +VER= v3r00 # 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' -WHITE='\E[1;37;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} -EVIOLET=echo -e ${VIOLET} -ECYAN=echo -e ${CYAN} EWHITE=echo -e ${WHITE} # Reset the terminal RESET=tput sgr0 # Here the variables used to override the standard make flags # C CC=gcc -#CFLAGS=-Wall -fPIC -O3 -g -CFLAGS=-Wall -fPIC -O3 +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 -fPIC -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 +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 -fPIC -O3 -g -CXXFLAGS=-Wall -fPIC -O3 +CXXFLAGS=-Wall -O -fPIC -pthread -g +#CXXFLAGS=-Wall -O -fPIC -pthread # ROOTCINT ROOTCINT=rootcint # Here the variables definig the local directories @@ -57,212 +49,150 @@ DIRMACROS=macros DIRCALIB=calib # Here the PAMELA environmental variables to be checked -PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env PAM_MACROS_env PAM_CALIB_env PAM_YODA_env +PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env PAM_YODA_env + # Here the local variables used to build the targets +# -- F77 - no libraries -- FSRCS= -#${DIRSRC}/readb2maps.for \ -# ${DIRSRC}/ptlevel1.for \ -# ${DIRSRC}/track.for - -FOBJS=$(FSRCS:${DIRSRC}%.for=${DIRBIN}%.o) -FLIBS= -#readb2maps ptlevel1 track -FULLFLIBS=$(FLIBS:%=${DIRLIB}/lib%_${VER}.so) -FULLLINKFLIBS=$(FLIBS:%=${DIRLIB}/lib%.so) +FOBJS=$(FSRCS:${DIRSRC}%.for=${DIRLIB}%.o) -CSRCS= -COBJS=$(CSRCS:${DIRMACROS}%.c=${DIRBIN}%.o) -CLIBS= -FULLCLIBS=$(CLIBS:%=${DIRLIB}/lib%_${VER}.so) -FULLLINKCLIBS=$(CLIBS:%=${DIRLIB}/lib%.so) - -CXXSRCS= -#${DIRSRC}/libptlevel1.C \ -# ${DIRSRC}/libtrack.C \ -# ${DIRSRC}/libreadb2maps.C - -FULLCXXLIBS=$(CXXSRCS:${DIRSRC}/%.C=${DIRLIB}/%_C_${VER}.so) - -MACROSRCS=${DIRMACROS}/FEVpathtoc.cxx \ - ${DIRMACROS}/FEVpamevcontrol.cxx \ - ${DIRMACROS}/FEventViewer.cxx -MACROSLIBS=$(MACROSRCS:${DIRMACROS}/%.cxx=${DIRLIB}/%_cxx_${VER}.so) -MACROCLIBS=FEVpathtoc_cxx FEVpamevcontrol_cxx FEventViewer_cxx -FULLMACROCLIBS=$(MACROCLIBS:%=${DIRLIB}/%_${VER}.so) -FULLLINKMACROCLIBS=$(MACROCLIBS:%=${DIRLIB}/%.so) +# -- CPP - no libraries -- +CPPSRCS=${DIRSRC}/FEVpathtoc.cpp \ + ${DIRSRC}/FEVVerl2.cpp \ + ${DIRSRC}/FEventViewerCore.cpp +CPPOBJS=$(CPPSRCS:${DIRSRC}%.cpp=${DIRLIB}%.o) -HSRCS= -FULLHLIBS=$(HSRCS:${DIRINC}/%.h=${DIRLIB}/%_h_${VER}.so) +# -- C - no libraries -- +CSRCS= +COBJS=$(CSRCS:${DIRSRC}%.c=${DIRLIB}%.o) -CXXEXESRCS=${DIRSRC}/FEventViewer.cc -CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cc=${DIRBIN}%.o) +# -- CPP - ROOT libraries -- +LIBROOTSRCS=${DIRSRC}/FEVpamevcontrol.cpp +LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) +LIBROOTCLIBS=libFEVpamevcontrol +FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so) + +# -- CPP - NON-ROOT libraries -- +LIBCPPSRCS=${DIRSRC}/color.cpp \ + ${DIRSRC}/FEVdetector.cpp +LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) +LIBCPPCLIBS=libcolor libFEVdetector +FULLLIBCPPLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so) + +# -- CPP - Executables -- +CXXEXESRCS=${DIRSRC}/FEventViewer.cpp +CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=${DIRLIB}%.o) CXXEXELIBS:=FEventViewer -FULLLIBS=${FULLFLIBS} ${FULLCXXLIBS} ${FULLCLIBS} ${FULLHLIBS} +# -- list of tracker objects needed to link +TRKOBJS=${PAM_LIB}/libDarthVader.so ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libsgp4.so +#${PAM_LIB}/libTrkLevel2.so ${PAM_LIB}/libTrkLevel1.so ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libRunInfo.so ${PAM_LIB}/libNDLevel2.so ${PAM_LIB}/libAcLevel2.so ${PAM_LIB}/libToFLevel2.so ${PAM_LIB}/libS4Level2.so ${PAM_LIB}/libCaloLevel2.so ${PAM_LIB}/libOrbitalInfo.so ${PAM_LIB}/libTrigLevel2.so +# -- directory where to find tracker headers needed to compile +SUBDIR= +SUBINC=-I${PAM_INC} +#SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done) + +# List of all libraries we want to install +FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} -EXESRCS = ${DIRBIN}/FEventViewer +# Other objects to install +EXESRCS=${DIRBIN}/FEventViewer -INCSRCS= ${DIRINC}/feventviewer.h +INCSRCS=${DIRINC}/FEventViewer.h ${DIRINC}/FEVpamevcontrol.h ${DIRINC}/FEVpathtoc.h ${DIRINC}/feventvstruct.h ${DIRINC}/color.h - -MACROSSRCS=${DIRMACROS}/FEventViewer.cxx ${DIRMACROS}/ffilter.cxx +MACROSSRCS= CALIBFILES= -DOCFILES=${DIRDOC}/FEventViewer.README.pdf ${DIRDOC}/ffilter.cxx +DOCFILES= # Here the Variables used for info target -PACKAGE=PAMELA flight event viewer software -EXECUTABLES=FEventViewer -LIBS= ${FLIBS} ${FOBJS} ${CLIBS} ${COBJS} ${CXXEXEOBJS} +PACKAGE= +EXECUTABLES= ${EXESRCS} +LIBS= ${FULLLIBS} DOCS= -SRCS= ${FSRCS} ${CRSCS} ${CXXEXESRCS} +SRCS= +#SRCS= ${FSRCS} ${CRSCS} ${CXXEXESRCS} ${LIBROOTSRCS} ${LIBCPPSRCS} MACROS= ${MACROSSRCS} +INCLUDE= ${INCSRCS} # TOBEDEL = junk ROOTINC=$$${shell root-config --incdir} NROOTINC=${shell root-config --incdir} # Let's start -all : test mkbindir mklibdir mkpathtoc ${FULLFLIBS} ${FULLCXXLIBS} ${MACROSLIBS} ${CXXEXELIBS} +#all: test mkbindir mklibdir mkverpath ${FOBJS} ${CPPOBJS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS} +all: prepare libs exe all: @echo -e ${GREEN} "" @(${EGREEN} " Finished, now you can install the package \n (use: make install or make upgrade or make forceinstall) "; ${RESET}) @echo -e ${GREEN} "" - @if [ "$(shell ${PAM_BIN}/CaloLEVEL2 --version 2>/dev/null | grep version | tr -d [a-z:A-Z\ ])" ]; then (${EVIOLET} "WARNING: the installation will break dependencies of CALOLEVEL2"; ${RESET}); (${EVIOLET} "WARNING: re-compile CALOLEVEL2 package after the installation"; ${RESET}); echo -e ${GREEN} ""; fi @${RESET} -# Here some general rules to produce objects in our local dir -# .o from fortran -${DIRBIN}/%.o : ${DIRSRC}/%.for - @(${EGREEN} "Creating object file: "${WHITE} "$@"; ${RESET}) - @${F77} ${F77FLAGS} -c -o $@ $< -I${DIRINC} - -${DIRBIN}/%.o: ${DIRSRC}/%.cc - @(${EGREEN} "Creating object file: "${WHITE} "$@"; ${RESET}) - @cat ${DIRSRC}/`basename ${@} .o`.cc > ${DIRSRC}/temp.cc; - @echo ' ' >> ${DIRSRC}/temp.cc - @echo 'void info(){ printf("\nEventViewer package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); }' >> ${DIRSRC}/temp.cc - @${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/temp.cc -I${DIRINC} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ `root-config --cflags` - -# .o from C -${DIRBIN}/%.o : ${DIRSRC}/%.c - @(${EGREEN} "Creating object file: "${WHITE} "$@"; ${RESET}) - @${CC} ${CFLAGS} -c -o $@ $< -I${DIRINC} - - -# .so from .o fortran -${FULLFLIBS}: ${FOBJS} - @(${EGREEN} "Creating library: "${WHITE} "$@"; ${RESET}) - @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ ${DIRBIN}/$(patsubst lib%_${VER}.so,%.o,$(@F)) -lg2c `cernlib mathlib` - @(${EGREEN} "Creating symlink from : "${WHITE} "$@"; ${RESET}) - @(${EGREEN} " to : "${WHITE} "${DIRLIB}/`basename $@ _${VER}.so`.so"; ${RESET}) - @ln -sf `basename $@` ${DIRLIB}/`basename $@ _${VER}.so`.so - -# .so from .o c -${FULLCLIBS}: ${COBJS} - @(${EGREEN} "Creating library: "${WHITE} "$@"; ${RESET}) - @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $^ -lg2c `mysql_config --cflags --libs` - @(${EGREEN} "Creating symlink from : "${WHITE} "$@"; ${RESET}) - @(${EGREEN} " to : "${WHITE} "${DIRLIB}/`basename $@ _${VER}.so`.so"; ${RESET}) - @ln -sf `basename $@` ${DIRLIB}/`basename $@ _${VER}.so`.so +prepare: test mkbindir mklibdir mkverpath mkpathtoc +exe: prepare ${CXXEXELIBS} -${MACROSLIBS}: ${MACROSRCS} - @(${EGREEN} "Compiling macro: "${WHITE} "$@"; ${RESET}) +libs: prepare ${LIBROOTLIBS} ${LIBCPPLIBS} + +# Here some general rules to produce objects in our local dir +${DIRLIB}/%.o: ${DIRSRC}/%.cpp + @(${EGREEN} "Creating CPP object file: "${WHITE} "`basename $@`"; ${RESET}) + @${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.cpp -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ `root-config --cflags` + +${DIRLIB}/%.o: ${DIRSRC}/%.c + @(${EGREEN} "Creating C object file: "${WHITE} "`basename $@`"; ${RESET}) + @${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.c -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ `root-config --cflags` + +${DIRLIB}/%.o: ${DIRSRC}/%.for + @(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET}) + @${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.for -I${DIRINC} + +${LIBROOTLIBS}: ${LIBROOTSRCS} + @(${EGREEN} "ROOTCINT - creating file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) # -# Create *Dict.cxx and *Dict.h +# Create *Dict.cpp and *Dict.h # - @${ROOTCINT} -f ${DIRMACROS}/`basename $(@F) _cxx_${VER}.so`Dict.cxx -c -I${ROOTINC} ${DIRINC}/`basename $(@F) _cxx_${VER}.so`fun.h ${DIRINC}/`basename $(@F) _cxx_${VER}.so`LinkDef.h + @${ROOTCINT} -f ${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -c -I${ROOTINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`.h ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`LinkDef.h # # create .o # - @cd ${DIRMACROS} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _cxx_${VER}.so`.cxx -I${PAM_INC} -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${NROOTINC}; - @cd ${DIRMACROS} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _cxx_${VER}.so`Dict.cxx -I${PAM_INC} -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${NROOTINC}; + @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) + @${CXX} ${CXXFLAGS} -c ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.cpp -o ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`.o -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ -I${NROOTINC}; + @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) + @${CXX} ${CXXFLAGS} -c ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -o ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.o -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ -I${NROOTINC}; # # create .so # - @if [ "$@" == "${DIRLIB}/FEVpathtoc_cxx_${VER}.so" ] || [ "$@" == "${DIRLIB}/FEVpamevcontrol_cxx_${VER}.so" ]; then ${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${PAM_INC} -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ ${PAM_YODA}/lib/libyoda.so ${DIRTOP}/${DIRMACROS}/`basename $(@F) _cxx_${VER}.so`.o ${DIRTOP}/${DIRMACROS}/`basename $(@F) _cxx_${VER}.so`Dict.o `root-config --cflags --glibs` 1>/dev/null; fi -# - @if [ "$@" == "${DIRLIB}/FEventViewer_cxx_${VER}.so" ]; then ${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${PAM_INC} -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ ${PAM_YODA}/lib/libyoda.so ${DIRTOP}/${DIRMACROS}/`basename $(@F) _cxx_${VER}.so`.o ${DIRTOP}/${DIRMACROS}/`basename $(@F) _cxx_${VER}.so`Dict.o ${DIRTOP}/${DIRLIB}/FEVpathtoc_cxx_${VER}.so ${DIRTOP}/${DIRLIB}/FEVpamevcontrol_cxx_${VER}.so `root-config --cflags --glibs` 1>/dev/null; fi - + @(${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_YODA}/include/utils/ ${SUBINC} ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.o 1>/dev/null + @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) -#${MACROSLIBS}: ${MACROSRCS} -# @(${EGREEN} "Compiling macro: "${WHITE} "$@"; ${RESET}) -# @echo '.include ${DIRTOP}/${DIRINC}' > build_so.txt -# @echo '.include ${PAM_INC}' >> build_so.txt -# @echo 'TString *junk=new TString();' >> build_so.txt -# @echo '*junk=gSystem->GetDynamicPath();' >> build_so.txt -# @echo '*junk+=":${DIRLIB}";' >> build_so.txt -# @echo 'gSystem->SetDynamicPath(junk.Data());' >> build_so.txt -# @echo 'char *lmac = gSystem->ExpandPathName("$$PAM_INC");'>>build_so.txt -# @echo 'gInterpreter->AddIncludePath(lmac);'>>build_so.txt -# @echo 'char *pamyoda = gSystem->ExpandPathName("$$PAM_YODA");' >>build_so.txt -# @echo 'stringstream incy;' >>build_so.txt -# @echo 'incy.str("");' >>build_so.txt -# @echo 'incy << pamyoda << "/include/yoda/";' >>build_so.txt -# @echo 'gInterpreter->AddIncludePath(incy.str().c_str());' >>build_so.txt -# @echo 'incy.str("");' >>build_so.txt -# @echo 'incy << pamyoda << "/event/";'>>build_so.txt -# @echo 'gInterpreter->AddIncludePath(incy.str().c_str());'>>build_so.txt -# @echo 'gSystem->cd("'${DIRMACROS}'");' >> build_so.txt -# @echo 'char *pamyodalib = gSystem->ExpandPathName("$$PAM_YODA");' >>build_so.txt -# @echo 'stringstream libYODA;'>>build_so.txt -# @echo 'libYODA.str("");' >>build_so.txt -# @echo 'libYODA << pamyodalib << "/lib/libyoda.so";'>>build_so.txt -# @echo 'gSystem->Load(libYODA.str().c_str());'>>build_so.txt -# @echo 'libYODA.str("");' >>build_so.txt -## @echo 'libYODA << "${DIRTOP}/${DIRLIB}/libtrack_${VER}.so";'>>build_so.txt -## @echo 'gSystem->Load(libYODA.str().c_str());'>>build_so.txt -## @echo 'libYODA.str("");' >>build_so.txt -## @echo 'libYODA << "${DIRTOP}/${DIRLIB}/libtrack_C_${VER}.so";'>>build_so.txt -## @echo 'gSystem->Load(libYODA.str().c_str());'>>build_so.txt -## @echo 'libYODA.str("");' >>build_so.txt -## @echo 'libYODA << "${DIRTOP}/${DIRLIB}/libptlevel1_${VER}.so";'>>build_so.txt -## @echo 'gSystem->Load(libYODA.str().c_str());'>>build_so.txt -## @echo 'libYODA.str("");' >>build_so.txt -## @echo 'libYODA << "${DIRTOP}/${DIRLIB}/libptlevel1_C_${VER}.so";'>>build_so.txt -## @echo 'gSystem->Load(libYODA.str().c_str());'>>build_so.txt -## @echo 'libYODA.str("");' >>build_so.txt -## @echo 'libYODA << "${DIRTOP}/${DIRLIB}/libreadb2maps_${VER}.so";'>>build_so.txt -## @echo 'gSystem->Load(libYODA.str().c_str());'>>build_so.txt -## @echo 'libYODA.str("");' >>build_so.txt -## @echo 'libYODA << "${DIRTOP}/${DIRLIB}/libreadb2maps_C_${VER}.so";'>>build_so.txt -## @echo 'gSystem->Load(libYODA.str().c_str());'>>build_so.txt -## @echo 'libYODA.str("");' >>build_so.txt -## @echo 'libYODA << "${PAM_LIB}/caloclasses_h.so";'>>build_so.txt -## @echo 'gSystem->Load(libYODA.str().c_str());'>>build_so.txt -## @echo 'libYODA.str("");' >>build_so.txt -## @echo 'libYODA << "${PAM_LIB}/aclev1class_h.so";'>>build_so.txt -## @echo 'gSystem->Load(libYODA.str().c_str());'>>build_so.txt -# if [ "$@" != "${DIRLIB}/FEVpathtoc_c_"${VER}".so" ]; then \ -# echo 'libYODA.str("");' >>build_so.txt ; \ -# echo 'libYODA << "'${DIRTOP}/${DIRLIB}'/FEVpathtoc_c_'${VER}'.so";'>>build_so.txt ; \ -# echo 'gSystem->Load(libYODA.str().c_str());'>>build_so.txt ; \ -# fi; -# if [ "$@" != "${DIRLIB}/FEVpathtoc_cxx_"${VER}".so" ]; then \ -# ${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ ${DIRMACROS}/`basename $(@F) _cxx_${VER}.so`.cxx -lg2c -I${PAM_INC} -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ ${PAM_YODA}/lib/libyoda.so ${DIRTOP}/${DIRLIB}/FEVpathtoc_cxx_${VER}.so `root-config --cflags --glibs` 1>/dev/null; \ -# else \ -# ${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ ${DIRMACROS}/`basename $(@F) _cxx_${VER}.so`.cxx -lg2c -I${PAM_INC} -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ ${PAM_YODA}/lib/libyoda.so `root-config --cflags --glibs` 1>/dev/null; \ -# fi -# @echo '.debug' >> build_so.txt -# @echo '.L $(patsubst %_c_${VER}.so,%.c++,$(@F))' >> build_so.txt -# @echo '.q' >> build_so.txt -# @root -l -b 1>/dev/null < build_so.txt -# @mv -f ${DIRMACROS}/$(patsubst %_c_${VER}.so,%_c.so,$(@F)) ${DIRLIB}/$(@F) -# @rm -f build_so.txt +${LIBCPPLIBS}: ${LIBCPPSRCS} ${LIBSRCS} ${COBJS} ${FOBJS} +# +# create .o +# + @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) + @${CXX} ${CXXFLAGS} -c ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.cpp -o ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`.o -I${DIRTOP}/${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ -I${NROOTINC}; +# +# create .so +# + @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) + @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${SUBINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ ${DIRTOP}/${DIRLIB}/`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}: ${CXXEXEOBJS} +${CXXEXELIBS}: ${LIBROOTSRCS} ${CPPOBJS} ${COBJS} ${CXXEXEOBJS} @(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) - @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRBIN}/$@.o -I${DIRINC} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ ${PAM_YODA}/lib/libyoda.so ${DIRTOP}/${DIRLIB}/FEVpathtoc_cxx_${VER}.so ${DIRTOP}/${DIRLIB}/FEVpamevcontrol_cxx_${VER}.so ${DIRTOP}/${DIRLIB}/$@_cxx_${VER}.so `root-config --cflags --glibs` -# @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRBIN}/$@.o -I${DIRINC} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ ${PAM_LIB}/caloclasses_h.so ${PAM_YODA}/lib/libyoda.so ${DIRTOP}/${DIRLIB}/FEVpathtoc_c_${VER}.so ${PAM_LIB}/aclev1class_h.so ${DIRTOP}/${DIRLIB}/libreadb2maps_${VER}.so ${DIRTOP}/${DIRLIB}/libreadb2maps_C_${VER}.so ${DIRTOP}/${DIRLIB}/libtrack_${VER}.so ${DIRTOP}/${DIRLIB}/libtrack_C_${VER}.so ${DIRTOP}/${DIRLIB}/libptlevel1_${VER}.so ${DIRTOP}/${DIRLIB}/libptlevel1_C_${VER}.so ${DIRTOP}/${DIRLIB}/$@_c_${VER}.so `root-config --cflags --glibs` -# @rm -f ${DIRSRC}/temp.cc +# @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRLIB}/$@.o ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} ${CPPOBJS} ${FOBJS} ${TRKOBJS} ${PAM_YODA}/lib/libyoda.so -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -lThread `root-config --cflags --glibs` `cernlib mathlib` +## @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRLIB}/$@.o ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} ${TRKOBJS} ${CPPOBJS} ${COBJS} ${FOBJS} ${PAM_YODA}/lib/libyoda.so ${PAM_YODA}/lib/libutils.so ${PAM_LIB}/libPamLevel2.so -lThread `root-config --cflags --glibs` `cernlib mathlib` +# echo 'nuclei is ${NUCLEI}' + @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRLIB}/$@.o ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} ${TRKOBJS} ${CPPOBJS} ${COBJS} ${FOBJS} ${PAM_YODA}/lib/libyoda.so ${PAM_LIB}/libPamLevel2.so -lThread `root-config --cflags --glibs` `doc/cernlib_pam mathlib`; # A small target to check environmental variables %_env: @${test_env} -.PHONY: install installdoc installlib installmacros installinc -.PHONY: clean depclean info mkbindir mklibdir testcern testpamenv test testcalocommon testroot2paw testmysql +.PHONY: install installdoc installlib installmacros installinc installexe installcmacro +.PHONY: clean depclean info mkbindir mklibdir testcern testpamenv test mkbindir: ${DIRBIN} ${DIRBIN}: @@ -273,7 +203,7 @@ @${test_and_mk} # Here what has to be deleted in clean target -clean: TOBEDEL=${DIRMACROS}/*.o ${DIRMACROS}/*Dict.cxx ${DIRMACROS}/*Dict.h ${FOBJS} ${FULLLIBS} ${DIRBIN}/${CXXEXELIBS} ${COBJS} ${CXXEXEOBJS} ${FULLLINKFLIBS} ${FULLLINKCLIBS} +clean: TOBEDEL= ${DIRSRC}/*.o ${DIRSRC}/*Dict.cpp ${DIRSRC}/*Dict.h ${FOBJS} ${FULLLIBS} ${DIRBIN}/${CXXEXELIBS} ${CPPOBJS} ${CXXEXEOBJS} ${FULLLINKCLIBS} ${FULLMACROCLIBS} ${FULLLINKMACROCLIBS} ${DIRSRC}/FEVVerl2.cpp ${DIRSRC}/FEVpathtoc.cpp clean: @${test_and_rm} @@ -288,7 +218,7 @@ upgrade: FORCE=-u upgrade: install -install: installlib installinc installmacros installcalib installdoc installexe installcmacro +install: installlib installinc installmacros installcalib installdoc installcmacro installexe installlib: LINK=y installlib: TOBEMOVED= $(FULLLIBS:${DIRLIB}%=${PAM_LIB}%) @@ -327,6 +257,19 @@ installdoc: @${test_and_cp} +mkverpath: + @echo '#include ' > ${DIRTOP}/${DIRSRC}/FEVVerl2.cpp; echo ' char *FEVInfo(bool print){ if ( print ) printf("\nEvent Viewer flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> ${DIRTOP}/${DIRSRC}/FEVVerl2.cpp + @sleep 0.8 + +mkpathtoc: + @if [ "${PAM_CCO}" == "" ]; then echo '#include ' > ${DIRTOP}/${DIRSRC}/FEVpathtoc.cpp; echo ' const char *pathtocalibration(){ return((const char*)gSystem->Getenv("PAM_CALIB"));}' >> ${DIRTOP}/${DIRSRC}/FEVpathtoc.cpp; echo ' const char *pathtoinclude(){ return((const char*)gSystem->Getenv("PAM_INC"));}' >> ${DIRTOP}/${DIRSRC}/FEVpathtoc.cpp; fi + @if [ "${PAM_CCO}" != "" ]; then echo '#include ' > ${DIRTOP}/${DIRSRC}/FEVpathtoc.cpp; echo ' const char *pathtocalibration(){ return((const char*)"'${PAM_CALIB}'/");}' >> ${DIRTOP}/${DIRSRC}/FEVpathtoc.cpp; echo ' const char *pathtocalibration(){ return((const char*)"'${PAM_INC}'/");}' >> ${DIRTOP}/${DIRSRC}/FEVpathtoc.cpp; fi + @sleep 0.5 + + + + + info: @echo " " @${EGREEN} "Infos for package :" ${WHITE} ${PACKAGE} @@ -336,43 +279,14 @@ @${EGREEN} " DOCS :" ${WHITE} ${DOCS} @${EGREEN} " SRCS :" ${WHITE} ${SRCS} @${EGREEN} " MACROS :" ${WHITE} ${MACROS} + @${EGREEN} " INCLUDE :" ${WHITE} ${INCLUDE} @echo " " @${RESET} test: testpamenv -#test: testpamenv testcernlib testmysql testcalocommon testroot2paw testpamenv: ${PAM_ENV} -testcernlib: cernlib root-config - -testmysql: mysql_config - -testcalocommon: '${PAM_BIN}'/calocommon - @if [ ${INSTCOMVER} -lt ${COMPCOMVER} ]; then ${ERED} " ERROR: EventViewer ${VER} requires package CALOCOMMON version ${COMMONVER} "; ${RESET} ; exit 1; fi - -testroot2paw: '${PAM_BIN}'/GroundDataConvert - @if [ ${INSTR2PVER} -lt ${COMPR2PVER} ]; then ${ERED} " ERROR: EventViewer ${VER} requires package root2paw version ${R2PVER} "; ${RESET} ; exit 1; fi - -mysql_config: OPT=--cflags -mysql_config: - @$(test_cmd) - -mkpathtoc: - @if [ "${PAM_CCO}" == "" ]; then echo '#include ' > ${DIRTOP}/${DIRMACROS}/FEVpathtoc.cxx; echo ' const char *pathtocalibration(){ return((const char*)gSystem->Getenv("PAM_CALIB"));}' >> ${DIRTOP}/${DIRMACROS}/FEVpathtoc.cxx; fi - @if [ "${PAM_CCO}" != "" ]; then echo '#include ' > ${DIRTOP}/${DIRMACROS}/FEVpathtoc.cxx; echo ' const char *pathtocalibration(){ return((const char*)"'${PAM_CALIB}'/");}' >> ${DIRTOP}/${DIRMACROS}/FEVpathtoc.cxx; fi - @sleep 0.5 - - -'${PAM_BIN}'/calocommon: - @$(test_cmd) - -'${PAM_BIN}'/GroundDataConvert: OPT=--version -'${PAM_BIN}'/GroundDataConvert: - @$(test_cmd) - -cernlib: - @${test_cmd} root-config: OPT=--cflags root-config: