--- DarthVader/CalorimeterLevel2/Makefile 2006/06/19 13:27:38 1.4 +++ DarthVader/CalorimeterLevel2/Makefile 2014/07/21 13:01:48 1.51 @@ -1,44 +1,20 @@ # Calorimeter flight analysis software # SOFTWARE VERSION -VER= v3r05 -# 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= v7r03 +# +include ../Make.def +# +ifeq ($(GCC4),0) + EXTRAOPT=-Wno-globals -fvxt +else + EXTRAOPT= +endif +#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash ${PAM_BIT} +#F77FLAGS= -fforce-addr -funroll-all-loops -ffinite-math-only -Wall -funroll-loops -Wno-globals -fPIC -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT} +F77FLAGS= -O1 -fforce-addr -funroll-all-loops -ffinite-math-only -Wall -funroll-loops -fPIC $(EXTRAOPT) -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT} +#F77FLAGS= -g -O1 -fforce-addr -funroll-all-loops -ffinite-math-only -Wall -funroll-loops -fPIC $(EXTRAOPT) -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT} +#F77FLAGS= -g -fforce-addr -funroll-all-loops -ffinite-math-only -Wall -funroll-loops -Wno-globals -fPIC -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT} +#F77FLAGS= -Wall -Wno-globals -fPIC -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT} # Here the variables definig the local directories DIRTOP=${shell pwd} DIRLIB=../lib/${ARCH} @@ -61,8 +37,10 @@ ${DIRSRC}/nshower.for \ ${DIRSRC}/nointer.for \ ${DIRSRC}/elio.for \ + ${DIRSRC}/nuclei.for \ ${DIRSRC}/cluster.for \ ${DIRSRC}/cluster2.for \ + ${DIRSRC}/cluster4.for \ ${DIRSRC}/laterale.for \ ${DIRSRC}/baric.for \ ${DIRSRC}/selftrig.for \ @@ -79,18 +57,21 @@ COBJS=$(CSRCS:${DIRSRC}%.c=${DIRLIB}%.o) # -- CPP - ROOT libraries -- -LIBROOTSRCS=${DIRSRC}/CaloLevel2.cpp +LIBROOTSRCS=${DIRSRC}/CaloLevel0.cpp \ + ${DIRSRC}/CaloLevel1.cpp \ + ${DIRSRC}/CaloLevel2.cpp LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) -LIBROOTCLIBS=libCaloLevel2 +#LIBROOTOBJS=${DIRLIB}/millim.o +LIBROOTOBJS=${FOBJS} ${COBJS} +LIBROOTCLIBS=libCaloLevel2 libCaloLevel1 libCaloLevel0 FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so) # -- CPP - NON-ROOT libraries -- -LIBCPPSRCS=${DIRSRC}/CaloProcessing.cpp \ - ${DIRSRC}/CaloCore.cpp \ +LIBCPPSRCS=${DIRSRC}/CaloCore.cpp \ ${DIRSRC}/CaloVerl2.cpp LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) -LIBCPPCLIBS=libCaloProcessing libCaloCore libCaloVerl2 +LIBCPPCLIBS=libCaloCore libCaloVerl2 FULLLIBCPPLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so) # -- CPP - Executables -- @@ -99,10 +80,10 @@ CXXEXELIBS:=CalorimeterLevel2 # -- list of tracker objects needed to link -TRKOBJS=${DIRLIB}/libTrkLevel2.so ${DIRLIB}/libGLTables.so ${DIRLIB}/libRunInfo.so +TRKOBJS=${DIRLIB}/libTrkLevel2.so ${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so # -- directory where to find tracker headers needed to compile -SUBDIR=../GLTables ../RunInfo ../TrackerLevel2 +SUBDIR=../RunInfo ../TrackerLevel2 SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done) # List of all libraries we want to install @@ -111,7 +92,7 @@ # Other objects to install EXESRCS=${DIRBIN}/CalorimeterLevel2 -INCSRCS=${DIRINC}/CaloLevel2.h ${DIRINC}/CaloProcessing.h ${DIRINC}/CaloCore.h +INCSRCS=${DIRINC}/CaloLevel0.h ${DIRINC}/CaloLevel1.h ${DIRINC}/CaloLevel2.h ${DIRINC}/CaloStruct.h ${DIRINC}/CaloCore.h ${DIRINC}/INTEST.TXT MACROSSRCS= @@ -136,8 +117,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} @@ -148,58 +129,8 @@ exe: prepare ${CXXEXELIBS} 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} ${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}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS} - @(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) -# @${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 -lThread `root-config --cflags --glibs` `cernlib mathlib` - +include ../Make.dect # A small target to check environmental variables %_env: @${test_env} @@ -277,7 +208,7 @@ @${test_and_cp} mkverpath: - @echo '#include ' > ${DIRTOP}/${DIRSRC}/CaloVerl2.cpp; echo ' char *CaloInfo(bool print){ if ( print ) printf("\nCalorimeter Level2 flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> ${DIRTOP}/${DIRSRC}/CaloVerl2.cpp + @echo '#include ' > ${DIRTOP}/${DIRSRC}/CaloVerl2.cpp; echo 'const char *CaloInfo(bool print){ if ( print ) printf("\nCalorimeter Level2 flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> ${DIRTOP}/${DIRSRC}/CaloVerl2.cpp @sleep 0.8