--- DarthVader/OrbitalInfo/Makefile 2006/06/19 13:27:41 1.4 +++ DarthVader/OrbitalInfo/Makefile 2015/03/26 14:55:37 1.45 @@ -1,44 +1,8 @@ #Orbital Information for flight analysis software # SOFTWARE VERSION -VER= v1r00 -# 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 -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= v4r18 +# +include ../Make.def # Here the variables definig the local directories DIRTOP=${shell pwd} DIRLIB=../lib/${ARCH} @@ -53,9 +17,11 @@ # 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= +FSRCS=${DIRSRC}/igrf_sub.for FOBJS=$(FSRCS:${DIRSRC}%.for=${DIRLIB}%.o) # -- CPP - no libraries -- @@ -67,10 +33,12 @@ COBJS=$(CSRCS:${DIRSRC}%.c=${DIRLIB}%.o) # -- CPP - ROOT libraries -- -LIBROOTSRCS=${DIRSRC}/OrbitalInfo.cpp +LIBROOTSRCS=${DIRSRC}/OrbitalInfo.cpp \ + ${DIRSRC}/InclinationInfo.cpp \ + ${DIRSRC}/OrientationInfo.cpp LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) -LIBROOTCLIBS=libOrbitalInfo +LIBROOTCLIBS=libOrbitalInfo libInclinationInfo libOrientationInfo FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so) # -- CPP - NON-ROOT libraries -- @@ -89,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=${DIRLIB}/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=../GLTables ../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 @@ -102,7 +70,7 @@ # Other objects to install EXESRCS=${DIRBIN}/OrbitalInfoLevel2 -INCSRCS=${DIRINC}/OrbitalInfo.h +INCSRCS=${DIRINC}/OrbitalInfo.h ${DIRINC}/OrbitalInfoStruct.h ${DIRINC}/InclinationInfo.h ${DIRINC}/OrientationInfo.h MACROSSRCS= @@ -127,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} @@ -140,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_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.cpp and *Dict.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 -# - @(${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 -# - @(${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)) - -${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_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} -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}: ${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 ${PAM_YODA}/lib/libutils.so -lThread `root-config --cflags --glibs` `cernlib mathlib` - +include ../Make.dect # A small target to check environmental variables %_env: @${test_env} @@ -269,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