1 |
# Calorimeter flight analysis software |
# Calorimeter flight analysis software |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v3r03 |
VER= v3r06 |
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' |
99 |
CXXEXELIBS:=CalorimeterLevel2 |
CXXEXELIBS:=CalorimeterLevel2 |
100 |
|
|
101 |
# -- list of tracker objects needed to link |
# -- list of tracker objects needed to link |
102 |
TRKOBJS=${DIRLIB}/libTrkLevel2.so ${DIRLIB}/libGLTables.so ${DIRLIB}/libRunInfo.so |
TRKOBJS=${DIRLIB}/libTrkLevel2.so ${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so |
103 |
|
|
104 |
# -- directory where to find tracker headers needed to compile |
# -- directory where to find tracker headers needed to compile |
105 |
SUBDIR=../GLTables ../RunInfo ../TrackerLevel2 |
SUBDIR=../RunInfo ../TrackerLevel2 |
106 |
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) |
107 |
|
|
108 |
# List of all libraries we want to install |
# List of all libraries we want to install |
111 |
# Other objects to install |
# Other objects to install |
112 |
EXESRCS=${DIRBIN}/CalorimeterLevel2 |
EXESRCS=${DIRBIN}/CalorimeterLevel2 |
113 |
|
|
114 |
INCSRCS=${DIRINC}/CaloLevel2.h ${DIRINC}/CaloProcessing.h ${DIRINC}/CaloCore.h |
INCSRCS=${DIRINC}/CaloLevel2.h ${DIRINC}/CaloStruct.h ${DIRINC}/CaloProcessing.h ${DIRINC}/CaloCore.h |
115 |
|
|
116 |
MACROSSRCS= |
MACROSSRCS= |
117 |
|
|
152 |
# Here some general rules to produce objects in our local dir |
# Here some general rules to produce objects in our local dir |
153 |
${DIRLIB}/%.o: ${DIRSRC}/%.cpp |
${DIRLIB}/%.o: ${DIRSRC}/%.cpp |
154 |
@(${EGREEN} "Creating CPP object file: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating CPP object file: "${WHITE} "`basename $@`"; ${RESET}) |
155 |
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.cpp -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ `root-config --cflags` |
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.cpp -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ `root-config --cflags` |
156 |
|
|
157 |
${DIRLIB}/%.o: ${DIRSRC}/%.c |
${DIRLIB}/%.o: ${DIRSRC}/%.c |
158 |
@(${EGREEN} "Creating C object file: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating C object file: "${WHITE} "`basename $@`"; ${RESET}) |
159 |
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.c -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ `root-config --cflags` |
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.c -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ `root-config --cflags` |
160 |
|
|
161 |
${DIRLIB}/%.o: ${DIRSRC}/%.for |
${DIRLIB}/%.o: ${DIRSRC}/%.for |
162 |
@(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET}) |
167 |
# |
# |
168 |
# Create *Dict.cpp and *Dict.h |
# Create *Dict.cpp and *Dict.h |
169 |
# |
# |
170 |
@${ROOTCINT} -f ${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -c -I${ROOTINC} -I${PAM_YODA}/include/yoda/ ${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${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 |
171 |
# |
# |
172 |
# create .o |
# create .o |
173 |
# |
# |
174 |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) |
175 |
@${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${NROOTINC}; |
@${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}; |
176 |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) |
177 |
@${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${NROOTINC}; |
@${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_INC}/ -I${NROOTINC}; |
178 |
# |
# |
179 |
# create .so |
# create .so |
180 |
# |
# |
181 |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
182 |
@${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 |
@${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 |
183 |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
184 |
|
|
185 |
${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS} |
${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS} |
187 |
# create .o |
# create .o |
188 |
# |
# |
189 |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) |
190 |
@${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${NROOTINC}; |
@${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}; |
191 |
# |
# |
192 |
# create .so |
# create .so |
193 |
# |
# |
194 |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
195 |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${SUBINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${FOBJS} ${COBJS} 1>/dev/null |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${SUBINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${FOBJS} ${COBJS} 1>/dev/null |
196 |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
197 |
|
|
198 |
${CXXEXELIBS}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS} |
${CXXEXELIBS}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS} |