--- DarthVader/OrbitalInfo/Makefile 2007/05/07 07:59:09 1.14 +++ DarthVader/OrbitalInfo/Makefile 2014/07/28 15:42:06 1.35 @@ -1,44 +1,8 @@ #Orbital Information for flight analysis software # SOFTWARE VERSION -VER= v2r02 -# 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 -# 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 -O -fPIC -pthread -# ROOTCINT -ROOTCINT=rootcint +VER= v4r08 +# +include ../Make.def # Here the variables definig the local directories DIRTOP=${shell pwd} DIRLIB=../lib/${ARCH} @@ -53,6 +17,8 @@ # Here the PAMELA environmental variables to be checked PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env PAM_YODA_env +F77FLAGS= -Wall -funroll-loops -fPIC $(EXTRAOPT) -fno-automatic -extend_source -fno-bounds-check -static -fno-backslash ${PAM_BIT} + # Here the local variables used to build the targets # -- F77 - no libraries -- FSRCS=${DIRSRC}/igrf_sub.for @@ -68,10 +34,11 @@ # -- CPP - ROOT libraries -- LIBROOTSRCS=${DIRSRC}/OrbitalInfo.cpp \ - ${DIRSRC}/InclinationInfo.cpp + ${DIRSRC}/InclinationInfo.cpp \ + ${DIRSRC}/OrientationInfo.cpp LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) -LIBROOTCLIBS=libOrbitalInfo libInclinationInfo +LIBROOTCLIBS=libOrbitalInfo libInclinationInfo libOrientationInfo FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so) # -- CPP - NON-ROOT libraries -- @@ -90,11 +57,11 @@ #TRKOBJS=${DIRTOP}/../lib2/libTrkLevel2.so ${DIRTOP}/../lib2/libtrack.so #TRKOBJS=${PAM_LIB}/libTrkLevel2.so ${PAM_LIB}/libtrack.so ${PAM_LIB}/libreadB.so ${PAM_LIB}/libinterB.so ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libRunInfo.so #TRKOBJS= -OTHERLIBS=${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so +OTHERLIBS=${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so ${DIRLIB}/libToFLevel2.so # -- directory where to find tracker headers needed to compile #TRKHEAD=${DIRTOP}/../tracker/inc #TRKHEAD=${PAM_INC} -SUBDIR=../RunInfo +SUBDIR=../RunInfo ../ToFLevel2 ../TrackerLevel2 ../TriggerLevel2 SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done) # List of all libraries we want to install @@ -103,7 +70,7 @@ # Other objects to install EXESRCS=${DIRBIN}/OrbitalInfoLevel2 -INCSRCS=${DIRINC}/OrbitalInfo.h ${DIRINC}/OrbitalInfoStruct.h +INCSRCS=${DIRINC}/OrbitalInfo.h ${DIRINC}/OrbitalInfoStruct.h ${DIRINC}/InclinationInfo.h ${DIRINC}/OrientationInfo.h MACROSSRCS= @@ -128,8 +95,8 @@ #all: test mkbindir mklibdir mkverpath ${FOBJS} ${CPPOBJS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS} all: prepare libs 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} "" +# @(${EGREEN} " Finished, now you can install the package \n (use: make install or make upgrade or make forceinstall) "; ${RESET}) @echo -e ${GREEN} "" @${RESET} @@ -141,56 +108,7 @@ 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_INC}/ `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_INC}/ `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.cpp and *Dict.h -# - @${ROOTCINT} -f ${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -c -I${DIRINC} -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 -# -# 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} -I${DIRTOP} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ -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_INC}/ -I${NROOTINC}; -# -# 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/ ${SUBINC} -I${PAM_INC}/ ${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)) - -${LIBCPPLIBS}: ${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} -I${DIRTOP} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ -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} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ ${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}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS} - @(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) - @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRLIB}/$@.o ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} ${OTHERLIBS} ${CPPOBJS} ${COBJS} ${FOBJS} ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` `cernlib mathlib` - +include ../Make.dect # A small target to check environmental variables %_env: @${test_env} @@ -270,7 +188,7 @@ @${test_and_cp} mkverpath: - @echo '#include ' > ${DIRTOP}/${DIRSRC}/OrbitalInfoVerl2.cpp; echo ' char *OrbitalInfoInfo(bool print){ if ( print ) printf("\nOrbitalInfo flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> ${DIRTOP}/${DIRSRC}/OrbitalInfoVerl2.cpp + @echo '#include ' > ${DIRTOP}/${DIRSRC}/OrbitalInfoVerl2.cpp; echo 'const char *OrbitalInfoInfo(bool print){ if ( print ) printf("\nOrbitalInfo flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> ${DIRTOP}/${DIRSRC}/OrbitalInfoVerl2.cpp @sleep 0.8