1 |
# Tracker flight analysis software |
# Tracker flight analysis software |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v5r00 |
VER= v6r05 |
4 |
DEBUG=0 |
DEBUG=0 |
5 |
# An almost general purpouse Makefile for PAMELA repository |
# |
6 |
# Let's start with some usefull definition for colorize the echo |
include ../Make.def |
7 |
RED='\E[1;31;40m' |
ifeq ($(PAM_BIT),"-m32") |
8 |
GREEN='\E[1;32;40m' |
MALIGN=-malign-double |
9 |
YELLOW='\E[1;33;40m' |
else |
10 |
BLUE='\E[1;34;40m' |
MALIGN= |
11 |
WHITE='\E[1;37;40m' |
endif |
12 |
VIOLET='\E[1;35;40m' |
ifeq ($(GCC4),0) |
13 |
CYAN='\E[1;36;40m' |
EXTRAOPT=-Wno-globals -fvxt |
14 |
# Here the echo definition to use them |
else |
15 |
EVIOLET=echo -e ${VIOLET} |
EXTRAOPT= |
16 |
ECYAN=echo -e ${CYAN} |
endif |
|
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 ${PAM_BIT} |
|
|
#CFLAGS=-Wall -O -fPIC -pthread ${PAM_BIT} |
|
|
CFLAGS=-Wall -O3 -funroll-loops -fPIC -pthread ${PAM_BIT} |
|
|
#CFLAGS=-Wall -fPIC -pthread ${PAM_BIT} |
|
|
# Enviroment: |
|
|
GCCVER=`gcc --version | head -1` |
|
|
UNAMEA=`uname -a` |
|
|
TODAY=`date` |
|
|
# F77 |
|
|
F77=g77 |
|
17 |
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash ${PAM_BIT} |
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash ${PAM_BIT} |
18 |
F77FLAGS= -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT} |
#F77FLAGS= -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT} |
19 |
|
#F77FLAGS= -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT} |
20 |
|
export F77FLAGS= -O2 $(MALIGN) -Wall -funroll-loops $(EXTRAOPT) -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT} |
21 |
|
#F77FLAGS= -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT} |
22 |
|
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT} |
23 |
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT} |
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT} |
|
# C++ |
|
|
CXX=g++ |
|
|
#CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=${DEBUG}' ${PAM_BIT} |
|
|
#CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=0' ${PAM_BIT} |
|
|
#CXXFLAGS=-Wall -O -fPIC -pthread -fpermissive ${PAM_BIT} |
|
|
#CXXFLAGS=-Wall -O4 -fPIC -pthread ${PAM_BIT} |
|
|
CXXFLAGS=-Wall -O3 -funroll-loops -fPIC -pthread ${PAM_BIT} |
|
|
#CXXFLAGS=-Wall -fPIC -pthread ${PAM_BIT} |
|
|
# ROOTCINT |
|
24 |
ROOTCINT=rootcint |
ROOTCINT=rootcint |
25 |
# Here the variables definig the local directories |
# Here the variables definig the local directories |
26 |
DIRTOP=${shell pwd} |
DIRTOP=${shell pwd} |
156 |
#all : test mkbindir mklibdir mkverpath ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${FOBJS} ${COBJS} ${CXXEXELIBS} |
#all : test mkbindir mklibdir mkverpath ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${FOBJS} ${COBJS} ${CXXEXELIBS} |
157 |
all : test mkbindir mklibdir mkverpath ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS} |
all : test mkbindir mklibdir mkverpath ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS} |
158 |
all: |
all: |
159 |
@echo -e ${GREEN} "" |
# @echo -e ${GREEN} "" |
160 |
@(${EGREEN} " Finished, now you can install the package \n (use: make install or make upgrade or make forceinstall) "; ${RESET}) |
# @(${EGREEN} " Finished, now you can install the package \n (use: make install or make upgrade or make forceinstall) "; ${RESET}) |
161 |
@echo -e ${GREEN} "" |
@echo -e ${GREEN} "" |
162 |
@${RESET} |
@${RESET} |
163 |
|
|
164 |
standalone: all ${CXXEXELIBS} |
standalone: all ${CXXEXELIBS} |
165 |
|
|
166 |
# Here some general rules to produce objects in our local dir |
include ../Make.dect |
|
${DIRLIB}/%.o: ${DIRSRC}/%.cpp |
|
|
# @(${EYELLOW} " C++ object ------------------------") |
|
|
@(${EGREEN} "Creating C++ object file: "${WHITE} "$@"; ${RESET}) |
|
|
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.cpp -I${DIRTOP}/${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ `root-config --cflags` |
|
167 |
|
|
168 |
${DIRLIB}/%.o : ${DIRSRC}/F77/%.f |
${DIRLIB}/%.o : ${DIRSRC}/F77/%.f |
169 |
# @(${EYELLOW} " F77 object ------------------------") |
@(${EGREEN} "Creating tracker F77 object file: "${WHITE} "$@"; ${RESET}) |
|
@(${EGREEN} "Creating F77 object file: "${WHITE} "$@"; ${RESET}) |
|
170 |
@${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/F77/`basename ${@} .o`.f -I${DIRTOP}/${DIRINC}/F77 -I${NROOTINC} ${SUBINC} -I${PAM_YODA}/include/yoda -I${PAM_INC}/ |
@${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/F77/`basename ${@} .o`.f -I${DIRTOP}/${DIRINC}/F77 -I${NROOTINC} ${SUBINC} -I${PAM_YODA}/include/yoda -I${PAM_INC}/ |
171 |
|
|
|
# .so from .o fortran |
|
|
${LIBF77LIBS}: ${LIBF77OBJS} |
|
|
@(${EYELLOW} " F77 shared library --------------------------") |
|
|
@(${EGREEN} "Creating library: "${WHITE} "$@"; ${RESET}) |
|
|
# @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $^ `cernlib mathlib` /usr/lib/libg2c.so.0 |
|
|
## @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^ `cernlib mathlib` |
|
|
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^ |
|
|
|
|
|
${LIBROOTLIBS}: ${LIBROOTSRCS} ${FOBJS} |
|
|
@(${EYELLOW} " ROOT library ------------------------") |
|
|
@(${EGREEN} "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 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 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} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ -I${NROOTINC}; |
|
|
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
|
|
# |
|
|
# create .so |
|
|
# |
|
|
@(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET}) |
|
|
## @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda -I${PAM_INC} ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.o ${LIBROOTOBJS} `cernlib mathlib` 1>/dev/null |
|
|
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda -I${PAM_INC} ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.o ${LIBROOTOBJS} 1>/dev/null |
|
|
# ${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ ${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)) |
|
|
@(${EYELLOW} " -------------------------------------") |
|
|
|
|
|
${LIBCPPLIBS}: ${LIBCPPSRCS} |
|
|
# |
|
|
# create .o |
|
|
# |
|
|
@(${EGREEN} "Compiling 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_INC}/ -I${NROOTINC}; |
|
|
# |
|
|
# create .so |
|
|
# |
|
|
@(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET}) |
|
|
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${OTHERLIBS} ${FOBJS} 1>/dev/null |
|
|
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
|
|
|
|
|
|
|
|
${CXXEXELIBS}: ${COBJS} ${FOBJS} ${CXXEXEOBJS} |
|
|
@(${EVIOLET} "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *") |
|
|
@(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) |
|
|
# @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRLIB}/$@.o -I${DIRTOP}/${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ ${PAM_YODA}/lib/libyoda.so ${PAM_YODA}/lib/libutils.so ${FOBJS} ${COBJS} ${FULLLIBS} ${OTHERLIBS} -lThread `root-config --cflags --glibs` `cernlib mathlib` /usr/lib/libg2c.so.0; |
|
|
@${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRLIB}/$@.o -I${DIRTOP}/${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ ${PAM_YODA}/lib/libyoda.so ${FOBJS} ${COBJS} ${FULLLIBS} ${OTHERLIBS} -lThread -lg2c `root-config --cflags --glibs` `cernlib_noshift mathlib`; |
|
|
|
|
|
|
|
172 |
# A small target to check environmental variables |
# A small target to check environmental variables |
173 |
%_env: |
%_env: |
174 |
@${test_env} |
@${test_env} |
244 |
|
|
245 |
mkverpath: |
mkverpath: |
246 |
# @echo '#include <TSystem.h>' > ${DIRTOP}/${DIRSRC}/TrkVerl2.cpp; echo ' void info(){ printf("\nTracker Level2 flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); }' >> ${DIRTOP}/${DIRSRC}/TrkVerl2.cpp |
# @echo '#include <TSystem.h>' > ${DIRTOP}/${DIRSRC}/TrkVerl2.cpp; echo ' void info(){ printf("\nTracker Level2 flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); }' >> ${DIRTOP}/${DIRSRC}/TrkVerl2.cpp |
247 |
@echo '#include <TSystem.h>' > ${DIRTOP}/${DIRSRC}/TrkVerl2.cpp; echo ' char *TrkInfo(bool print){ if ( print ) printf("\nTracker Level2 flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> ${DIRTOP}/${DIRSRC}/TrkVerl2.cpp |
@echo '#include <TSystem.h>' > ${DIRTOP}/${DIRSRC}/TrkVerl2.cpp; echo ' const char *TrkInfo(bool print){ if ( print ) printf("\nTracker Level2 flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> ${DIRTOP}/${DIRSRC}/TrkVerl2.cpp |
248 |
@sleep 0.8 |
@sleep 0.8 |
249 |
|
|
250 |
|
|