1 |
# ToF flight analysis software |
# ToF flight analysis software |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v1r05 |
VER= v3r00 |
4 |
# An almost general purpouse Makefile for PAMELA repository |
# An almost general purpouse Makefile for PAMELA repository |
5 |
# Let's start with some usefull definition for colorize the echo |
# Let's start with some usefull definition for colorize the echo |
6 |
RED='\E[1;31;40m' |
RED='\E[1;31;40m' |
23 |
# Here the variables used to override the standard make flags |
# Here the variables used to override the standard make flags |
24 |
# C |
# C |
25 |
CC=gcc |
CC=gcc |
26 |
#CFLAGS=-Wall -O -fPIC -pthread -g |
#CFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT} |
27 |
CFLAGS=-Wall -O -fPIC -pthread |
CFLAGS=-Wall -O3 -funroll-loops -fPIC -pthread ${PAM_BIT} |
28 |
# Enviroment: |
# Enviroment: |
29 |
GCCVER=`gcc --version | head -1` |
GCCVER=`gcc --version | head -1` |
30 |
UNAMEA=`uname -a` |
UNAMEA=`uname -a` |
31 |
TODAY=`date` |
TODAY=`date` |
32 |
# F77 |
# F77 |
33 |
F77=g77 |
F77=g77 |
34 |
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash |
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash ${PAM_BIT} |
35 |
F77FLAGS= -Wall -Wno-globals -fPIC -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash |
F77FLAGS= -Wall -funroll-loops -Wno-globals -fPIC -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT} |
36 |
# C++ |
# C++ |
37 |
CXX=g++ |
CXX=g++ |
38 |
#CXXFLAGS=-Wall -O -fPIC -pthread -g |
#CXXFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT} |
39 |
CXXFLAGS=-Wall -O4 -fPIC -pthread |
CXXFLAGS=-Wall -O3 -funroll-loops -fPIC -pthread ${PAM_BIT} |
40 |
# ROOTCINT |
# ROOTCINT |
41 |
ROOTCINT=rootcint |
ROOTCINT=rootcint |
42 |
# Here the variables definig the local directories |
# Here the variables definig the local directories |
72 |
LIBROOTSRCS=${DIRSRC}/ToFLevel2.cpp |
LIBROOTSRCS=${DIRSRC}/ToFLevel2.cpp |
73 |
|
|
74 |
LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) |
LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) |
75 |
|
LIBROOTOBJS=${FOBJS} |
76 |
LIBROOTCLIBS=libToFLevel2 |
LIBROOTCLIBS=libToFLevel2 |
77 |
FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so) |
FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so) |
78 |
|
|
91 |
# -- list of tracker objects needed to link |
# -- list of tracker objects needed to link |
92 |
TRKOBJS=${DIRLIB}/libTrkLevel2.so ${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so |
TRKOBJS=${DIRLIB}/libTrkLevel2.so ${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so |
93 |
# -- directory where to find tracker headers needed to compile |
# -- directory where to find tracker headers needed to compile |
94 |
SUBDIR=../TrackerLevel2 ../RunInfo |
SUBDIR=../TrackerLevel2 ../RunInfo ../OrbitalInfo ../TriggerLevel2 |
95 |
SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done) |
SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done) |
96 |
|
|
97 |
# List of all libraries we want to install |
# List of all libraries we want to install |
100 |
# Other objects to install |
# Other objects to install |
101 |
EXESRCS=${DIRBIN}/TimeOfFlightLevel2 |
EXESRCS=${DIRBIN}/TimeOfFlightLevel2 |
102 |
|
|
103 |
INCSRCS=${DIRINC}/ToFLevel2.h ${DIRINC}/ToFStruct.h |
INCSRCS=${DIRINC}/ToFLevel2.h ${DIRINC}/ToFStruct.h ${DIRINC}/ToFCore.h |
104 |
|
|
105 |
MACROSSRCS= |
MACROSSRCS= |
106 |
|
|
151 |
@(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET}) |
152 |
@${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.for -I${DIRINC} |
@${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.for -I${DIRINC} |
153 |
|
|
154 |
${LIBROOTLIBS}: ${LIBROOTSRCS} |
${LIBROOTLIBS}: ${LIBROOTSRCS} ${FOBJS} |
155 |
@(${EGREEN} "ROOTCINT - creating file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) |
@(${EGREEN} "ROOTCINT - creating file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) |
156 |
# |
# |
157 |
# Create *Dict.cpp and *Dict.h |
# Create *Dict.cpp and *Dict.h |
158 |
# |
# |
159 |
@${ROOTCINT} -f ${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -c -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 |
@${ROOTCINT} -f ${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -c -I${DIRINC} ${SUBINC} -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 |
160 |
# |
# |
161 |
# create .o |
# create .o |
162 |
# |
# |
168 |
# create .so |
# create .so |
169 |
# |
# |
170 |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
171 |
@${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 |
@${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 ${LIBROOTOBJS} 1>/dev/null |
172 |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
173 |
|
|
174 |
${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS} |
${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS} |