1 |
# Tracker flight analysis software |
# Tracker flight analysis software |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v2r00 |
VER= v6r01 |
4 |
DEBUG=0 |
DEBUG=0 |
5 |
# An almost general purpouse Makefile for PAMELA repository |
# An almost general purpouse Makefile for PAMELA repository |
6 |
# Let's start with some usefull definition for colorize the echo |
# Let's start with some usefull definition for colorize the echo |
24 |
# Here the variables used to override the standard make flags |
# Here the variables used to override the standard make flags |
25 |
# C |
# C |
26 |
CC=gcc |
CC=gcc |
27 |
#CFLAGS=-Wall -O -fPIC -pthread -g |
#CFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT} |
28 |
CFLAGS=-Wall -O -fPIC -pthread |
#CFLAGS=-Wall -O -fPIC -pthread ${PAM_BIT} |
29 |
|
CFLAGS=-Wall -O3 -funroll-loops -fPIC -pthread ${PAM_BIT} |
30 |
|
#CFLAGS=-Wall -fPIC -pthread ${PAM_BIT} |
31 |
# Enviroment: |
# Enviroment: |
32 |
GCCVER=`gcc --version | head -1` |
GCCVER=`gcc --version | head -1` |
33 |
UNAMEA=`uname -a` |
UNAMEA=`uname -a` |
34 |
TODAY=`date` |
TODAY=`date` |
35 |
# F77 |
# F77 |
36 |
F77=g77 |
F77=g77 |
37 |
#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} |
38 |
F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash |
#F77FLAGS= -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT} |
39 |
|
#F77FLAGS= -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT} |
40 |
|
F77FLAGS= -O2 -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT} |
41 |
|
#F77FLAGS= -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT} |
42 |
|
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT} |
43 |
|
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT} |
44 |
# C++ |
# C++ |
45 |
CXX=g++ |
CXX=g++ |
46 |
#CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=${DEBUG}' |
#CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=${DEBUG}' ${PAM_BIT} |
47 |
#CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=0' |
#CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=0' ${PAM_BIT} |
48 |
#CXXFLAGS=-Wall -O -fPIC -pthread -fpermissive |
#CXXFLAGS=-Wall -O -fPIC -pthread -fpermissive ${PAM_BIT} |
49 |
CXXFLAGS=-Wall -O -fPIC -pthread |
#CXXFLAGS=-Wall -O4 -fPIC -pthread ${PAM_BIT} |
50 |
|
CXXFLAGS=-Wall -O3 -funroll-loops -fPIC -pthread ${PAM_BIT} |
51 |
|
#CXXFLAGS=-Wall -fPIC -pthread ${PAM_BIT} |
52 |
# ROOTCINT |
# ROOTCINT |
53 |
ROOTCINT=rootcint |
ROOTCINT=rootcint |
54 |
# Here the variables definig the local directories |
# Here the variables definig the local directories |
80 |
${DIRSRC}/F77/readB.f \ |
${DIRSRC}/F77/readB.f \ |
81 |
${DIRSRC}/F77/interB.f \ |
${DIRSRC}/F77/interB.f \ |
82 |
${DIRSRC}/F77/track.f \ |
${DIRSRC}/F77/track.f \ |
83 |
${DIRSRC}/F77/grkuta.f |
${DIRSRC}/F77/grkuta.f \ |
84 |
|
${DIRSRC}/F77/bdll.f # ***PP*** |
85 |
|
|
86 |
FOBJS=$(FSRCS:${DIRSRC}/F77/%.f=${DIRLIB}/%.o) |
FOBJS=$(FSRCS:${DIRSRC}/F77/%.f=${DIRLIB}/%.o) |
87 |
#------------------------------------------------- |
#------------------------------------------------- |
89 |
COBJS=$(CSRCS:${DIRSRC}%.cpp=${DIRLIB}/%.o) |
COBJS=$(CSRCS:${DIRSRC}%.cpp=${DIRLIB}/%.o) |
90 |
#------------------------------------------------- |
#------------------------------------------------- |
91 |
# librerie utilizzabili da root (ci deve essere anche il ***LinkDef.h ) |
# librerie utilizzabili da root (ci deve essere anche il ***LinkDef.h ) |
92 |
LIBROOTSRCS= ${DIRSRC}/TrkLevel2.cpp \ |
LIBROOTSRCS=${DIRSRC}/TrkParams.cpp \ |
93 |
${DIRSRC}/TrkLevel1.cpp |
${DIRSRC}/TrkLevel2.cpp \ |
94 |
|
${DIRSRC}/TrkLevel1.cpp \ |
95 |
|
${DIRSRC}/TrkLevel0.cpp \ |
96 |
|
${DIRSRC}/TrkHough.cpp \ |
97 |
|
${DIRSRC}/TrkCalib.cpp |
98 |
|
|
99 |
#LIBROOTSRCS= |
#LIBROOTSRCS= |
100 |
LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) |
LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) |
101 |
LIBROOTOBJS=${DIRLIB}/readB.o ${DIRLIB}/interB.o ${DIRLIB}/track.o ${DIRLIB}/grkuta.o |
LIBROOTOBJS=${DIRLIB}/readB.o \ |
102 |
LIBROOTCLIBS=libTrkLevel2 libTrkLevel1 |
${DIRLIB}/interB.o \ |
103 |
|
${DIRLIB}/track.o \ |
104 |
|
${DIRLIB}/grkuta.o \ |
105 |
|
${DIRLIB}/bdll.o \ |
106 |
|
${DIRLIB}/functionspfa.o \ |
107 |
|
${DIRLIB}/readallparam.o \ |
108 |
|
${DIRLIB}/functions.o \ |
109 |
|
${DIRLIB}/mini.o \ |
110 |
|
${DIRLIB}/tricircle.o \ |
111 |
|
${DIRLIB}/analysisflight.o \ |
112 |
|
${DIRLIB}/analysissubroutines.o \ |
113 |
|
${DIRLIB}/fillpedsig.o \ |
114 |
|
${DIRLIB}/cncomp.o \ |
115 |
|
${DIRLIB}/filladc.o \ |
116 |
|
${DIRLIB}/reductionflight.o |
117 |
|
LIBROOTCLIBS= libTrkParams libTrkLevel2 libTrkLevel1 libTrkLevel0 libTrkHough libTrkCalib |
118 |
|
|
119 |
#LIBROOTCLIBS= |
#LIBROOTCLIBS= |
120 |
FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so) |
FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so) |
121 |
#------------------------------------------------- |
#------------------------------------------------- |
122 |
# librerie C++ NON utilizzabili da root |
# librerie C++ NON utilizzabili da root |
123 |
#LIBCPPSRCS= ${DIRSRC}/TrkLevel2.cpp \ |
#LIBCPPSRCS= ${DIRSRC}/TrkLevel2.cpp \ |
124 |
# ${DIRSRC}/TrkLevel0.cpp |
# ${DIRSRC}/TrkLevel0.cpp |
125 |
LIBCPPSRCS=${DIRSRC}/TrkLevel0.cpp \ |
LIBCPPSRCS=${DIRSRC}/TrkStruct.cpp \ |
|
${DIRSRC}/TrkStruct.cpp \ |
|
126 |
${DIRSRC}/TrkProcess.cpp \ |
${DIRSRC}/TrkProcess.cpp \ |
127 |
${DIRSRC}/TrkVerl2.cpp \ |
${DIRSRC}/TrkVerl2.cpp \ |
128 |
${DIRSRC}/TrkCore.cpp |
${DIRSRC}/TrkCore.cpp \ |
129 |
|
# ${DIRSRC}/TrkLevel0.cpp |
130 |
|
|
131 |
LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) |
LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) |
132 |
#LIBCPPCLIBS=libTrkLevel2 libTrkLevel0 |
#LIBCPPCLIBS=libTrkLevel2 libTrkLevel0 |
133 |
LIBCPPCLIBS=libTrkLevel0 libTrkStruct libTrkProcess libTrkCore libTrkVerl2 |
LIBCPPCLIBS= libTrkStruct libTrkProcess libTrkCore libTrkVerl2 #libTrkLevel0 |
134 |
FULLCPPCLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so) |
FULLCPPCLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so) |
135 |
#------------------------------------------------- |
#------------------------------------------------- |
136 |
# librerie F77 NON utilizzabili da root |
# librerie F77 NON utilizzabili da root |
148 |
CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=${DIRLIB}%.o) |
CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=${DIRLIB}%.o) |
149 |
CXXEXELIBS:=TrackerLevel2 |
CXXEXELIBS:=TrackerLevel2 |
150 |
|
|
151 |
OTHERLIBS=${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so |
OTHERLIBS=${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so |
152 |
SUBDIR=../RunInfo |
SUBDIR=../RunInfo |
153 |
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) |
154 |
|
|
159 |
${DIRINC}/TrkLevel2.h \ |
${DIRINC}/TrkLevel2.h \ |
160 |
${DIRINC}/TrkLevel1.h \ |
${DIRINC}/TrkLevel1.h \ |
161 |
${DIRINC}/TrkLevel0.h \ |
${DIRINC}/TrkLevel0.h \ |
162 |
|
${DIRINC}/TrkHough.h \ |
163 |
|
${DIRINC}/TrkCalib.h \ |
164 |
|
${DIRINC}/TrkParams.h \ |
165 |
${DIRINC}/TrkStruct.h \ |
${DIRINC}/TrkStruct.h \ |
166 |
${DIRINC}/TrkProcess.h \ |
${DIRINC}/TrkProcess.h \ |
167 |
${DIRINC}/TrkCore.h \ |
${DIRINC}/TrkCore.h \ |
208 |
@(${EYELLOW} " F77 shared library --------------------------") |
@(${EYELLOW} " F77 shared library --------------------------") |
209 |
@(${EGREEN} "Creating library: "${WHITE} "$@"; ${RESET}) |
@(${EGREEN} "Creating library: "${WHITE} "$@"; ${RESET}) |
210 |
# @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $^ `cernlib mathlib` /usr/lib/libg2c.so.0 |
# @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $^ `cernlib mathlib` /usr/lib/libg2c.so.0 |
211 |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^ `cernlib mathlib` |
## @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^ `cernlib mathlib` |
212 |
|
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^ |
213 |
|
|
214 |
${LIBROOTLIBS}: ${LIBROOTSRCS} ${FOBJS} |
${LIBROOTLIBS}: ${LIBROOTSRCS} ${FOBJS} |
215 |
@(${EYELLOW} " ROOT library ------------------------") |
@(${EYELLOW} " ROOT library ------------------------") |
217 |
# |
# |
218 |
# Create *Dict.cpp and *Dict.h |
# Create *Dict.cpp and *Dict.h |
219 |
# |
# |
220 |
@${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} -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 |
221 |
# |
# |
222 |
# create .o |
# create .o |
223 |
# |
# |
230 |
# create .so |
# create .so |
231 |
# |
# |
232 |
@(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET}) |
@(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET}) |
233 |
@${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} `cernlib mathlib` 1>/dev/null |
234 |
|
@${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 |
235 |
# ${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} ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.o 1>/dev/null |
236 |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
237 |
@(${EYELLOW} " -------------------------------------") |
@(${EYELLOW} " -------------------------------------") |
246 |
# create .so |
# create .so |
247 |
# |
# |
248 |
@(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET}) |
@(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET}) |
249 |
@${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} 1>/dev/null |
@${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 |
250 |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
251 |
|
|
252 |
|
|
254 |
@(${EVIOLET} "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *") |
@(${EVIOLET} "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *") |
255 |
@(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) |
@(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) |
256 |
# @${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_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; |
257 |
@${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 mathlib`; |
@${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`; |
258 |
|
|
259 |
|
|
260 |
# A small target to check environmental variables |
# A small target to check environmental variables |