--- DarthVader/RunInfo/Makefile 2006/07/21 11:00:12 1.3 +++ DarthVader/RunInfo/Makefile 2009/08/04 14:01:28 1.14 @@ -1,44 +1,8 @@ # RunInfo software # SOFTWARE VERSION -VER= v1r02 -# 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= v2r00 +# +include ../Make.def # Here the variables definig the local directories DIRTOP=${shell pwd} DIRLIB=../lib/${ARCH} @@ -51,8 +15,9 @@ # Here the PAMELA environmental variables to be checked PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env # -SUBDIR=../GLTables -SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done) +SUBDIR= +SUBINC=-I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ +#SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done) # Here the local variables used to build the targets # -- F77 - no libraries -- @@ -88,7 +53,7 @@ CXXEXELIBS=RunInfoLevel2 # Other needed libraries -OTHOBJS = ${DIRLIB}/libGLTables.so +OTHOBJS = ${PAM_LIB}/libGLTables.so # List of all libraries we want to install FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} @@ -122,8 +87,6 @@ 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} "" @${RESET} standalone: all exe @@ -134,55 +97,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/wizard3/pamela/sw/src/offline/pamlevel2/calorimeter/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} -I${SUBINC} `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} ${SUBINC} ${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${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${NROOTINC}; -# -# create .so -# - @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) - @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${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${NROOTINC}; -# -# create .so -# - @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) - @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${SUBINC} ${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} "`basename $@ Level2`"; ${RESET}) - @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRLIB}/$@.o ${OTHOBJS} ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} ${CPPOBJS} ${FOBJS} ${PAM_YODA}/lib/libyoda.so -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -lThread `root-config --cflags --glibs` `cernlib mathlib` +include ../Make.dect # A small target to check environmental variables %_env: @@ -314,12 +229,12 @@ else \ ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\ ${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \ - cp -f ${ORIGIN}/$${i##/*/} $${i}; \ + cp -rf ${ORIGIN}/$${i##/*/} $${i}; \ fi; \ else \ ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\ ${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \ - cp ${FORCE} ${ORIGIN}/$${i##/*/} $${i}; \ + cp -rf ${FORCE} ${ORIGIN}/$${i##/*/} $${i}; \ fi;\ fi ;\ if [ ! -z ${LINK} ] ; then \