/[PAMELA software]/DarthVader/TrackerLevel2/Makefile
ViewVC logotype

Annotation of /DarthVader/TrackerLevel2/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.56 - (hide annotations) (download)
Thu Feb 27 11:24:42 2014 UTC (10 years, 9 months ago) by pam-fi
Branch: MAIN
Changes since 1.55: +7 -3 lines
Added new tracking algorythm

1 mocchiut 1.10 # Tracker flight analysis software
2     # SOFTWARE VERSION
3 mocchiut 1.55 VER= v6r11
4 mocchiut 1.10 DEBUG=0
5 mocchiut 1.43 #
6 mocchiut 1.44 include ../Make.def
7 mocchiut 1.43 ifeq ($(PAM_BIT),"-m32")
8     MALIGN=-malign-double
9     else
10     MALIGN=
11     endif
12 mocchiut 1.45 ifeq ($(GCC4),0)
13 mocchiut 1.44 EXTRAOPT=-Wno-globals -fvxt
14     else
15     EXTRAOPT=
16     endif
17 mocchiut 1.35 #F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash ${PAM_BIT}
18 mocchiut 1.39 #F77FLAGS= -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
19 mocchiut 1.40 #F77FLAGS= -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
20 mocchiut 1.45 export F77FLAGS= -O2 $(MALIGN) -Wall -funroll-loops $(EXTRAOPT) -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
21 mocchiut 1.39 #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 mocchiut 1.36 #F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
24 mocchiut 1.10 ROOTCINT=rootcint
25     # Here the variables definig the local directories
26     DIRTOP=${shell pwd}
27     #DIRLIB=lib/${ARCH}/
28     #DIRBIN=bin/${ARCH}/
29     DIRLIB=../lib/${ARCH}/
30     DIRBIN=../bin/${ARCH}/
31     DIRSRC=src
32     DIRINC=inc
33     DIRDOC=doc
34     DIRMACROS=macros
35     DIRCALIB=calib
36 mocchiut 1.50
37 mocchiut 1.10 # Here the PAMELA environmental variables to be checked
38     PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env PAM_YODA_env
39     # Here the local variables used to build the targets
40     #-------------------------------------------------
41     FSRCS=${DIRSRC}/F77/fillpedsig.f \
42     ${DIRSRC}/F77/readallparam.f \
43     ${DIRSRC}/F77/functions.f \
44     ${DIRSRC}/F77/cncomp.f \
45     ${DIRSRC}/F77/filladc.f \
46     ${DIRSRC}/F77/reductionflight.f \
47     ${DIRSRC}/F77/functionspfa.f \
48     ${DIRSRC}/F77/mini.f \
49     ${DIRSRC}/F77/tricircle.f \
50     ${DIRSRC}/F77/analysissubroutines.f \
51     ${DIRSRC}/F77/analysisflight.f \
52     ${DIRSRC}/F77/readB.f \
53     ${DIRSRC}/F77/interB.f \
54     ${DIRSRC}/F77/track.f \
55 pam-fi 1.24 ${DIRSRC}/F77/grkuta.f \
56     ${DIRSRC}/F77/bdll.f # ***PP***
57 mocchiut 1.10
58     FOBJS=$(FSRCS:${DIRSRC}/F77/%.f=${DIRLIB}/%.o)
59     #-------------------------------------------------
60     CSRCS=
61     COBJS=$(CSRCS:${DIRSRC}%.cpp=${DIRLIB}/%.o)
62     #-------------------------------------------------
63     # librerie utilizzabili da root (ci deve essere anche il ***LinkDef.h )
64 pam-fi 1.22 LIBROOTSRCS=${DIRSRC}/TrkParams.cpp \
65     ${DIRSRC}/TrkLevel2.cpp \
66     ${DIRSRC}/TrkLevel1.cpp \
67     ${DIRSRC}/TrkLevel0.cpp \
68     ${DIRSRC}/TrkHough.cpp \
69 pam-fi 1.56 ${DIRSRC}/TrkCalib.cpp \
70     ${DIRSRC}/ExtTrack.cpp
71 pam-fi 1.16
72 mocchiut 1.10 #LIBROOTSRCS=
73     LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
74 pam-fi 1.22 LIBROOTOBJS=${DIRLIB}/readB.o \
75     ${DIRLIB}/interB.o \
76     ${DIRLIB}/track.o \
77     ${DIRLIB}/grkuta.o \
78 pam-fi 1.24 ${DIRLIB}/bdll.o \
79 pam-fi 1.22 ${DIRLIB}/functionspfa.o \
80     ${DIRLIB}/readallparam.o \
81     ${DIRLIB}/functions.o \
82     ${DIRLIB}/mini.o \
83     ${DIRLIB}/tricircle.o \
84     ${DIRLIB}/analysisflight.o \
85     ${DIRLIB}/analysissubroutines.o \
86     ${DIRLIB}/fillpedsig.o \
87     ${DIRLIB}/cncomp.o \
88     ${DIRLIB}/filladc.o \
89     ${DIRLIB}/reductionflight.o
90 pam-fi 1.56 LIBROOTCLIBS= libTrkParams libTrkLevel2 libTrkLevel1 libTrkLevel0 libTrkHough libTrkCalib libExtTrack
91 pam-fi 1.13
92 mocchiut 1.10 #LIBROOTCLIBS=
93     FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so)
94     #-------------------------------------------------
95     # librerie C++ NON utilizzabili da root
96     #LIBCPPSRCS= ${DIRSRC}/TrkLevel2.cpp \
97     # ${DIRSRC}/TrkLevel0.cpp
98 pam-fi 1.22 LIBCPPSRCS=${DIRSRC}/TrkStruct.cpp \
99 mocchiut 1.10 ${DIRSRC}/TrkProcess.cpp \
100     ${DIRSRC}/TrkVerl2.cpp \
101 pam-fi 1.22 ${DIRSRC}/TrkCore.cpp \
102 pam-fi 1.56 ${DIRSRC}/ExtTrkingAlg.cpp \
103 pam-fi 1.22 # ${DIRSRC}/TrkLevel0.cpp
104    
105 mocchiut 1.54 LIBCPPLIBSTRK=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
106 mocchiut 1.10 #LIBCPPCLIBS=libTrkLevel2 libTrkLevel0
107 pam-fi 1.56 LIBCPPCLIBS= libTrkStruct libTrkProcess libTrkCore libTrkVerl2 libExtTrkingAlg #libTrkLevel0
108 mocchiut 1.10 FULLCPPCLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so)
109     #-------------------------------------------------
110     # librerie F77 NON utilizzabili da root
111     LIBF77SRCS=
112     LIBF77OBJS= $(LIBF77SRCS:${DIRSRC}/F77/%.f=${DIRLIB}/%.o)
113     LIBF77LIBS= $(LIBF77SRCS:${DIRSRC}/F77/%.f=${DIRLIB}/lib%_${VER}.so)
114     LIBF77CLIBS=
115     FULLF77CLIBS=$(LIBF77CLIBS:%=${DIRLIB}/%_${VER}.so)
116     #-------------------------------------------------
117     FULLLIBS=${FULLROOTCLIBS} ${FULLCPPCLIBS} ${FULLF77CLIBS}
118    
119     #-------------------------------------------------
120     # eseguibile
121     CXXEXESRCS=${DIRSRC}/TrackerLevel2.cpp
122     CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=${DIRLIB}%.o)
123     CXXEXELIBS:=TrackerLevel2
124    
125 mocchiut 1.33 OTHERLIBS=${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so
126 mocchiut 1.10 SUBDIR=../RunInfo
127     SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done)
128    
129     #-------------------------------------------------
130     # variabili per l'installazione
131     EXESRCS=${DIRBIN}/TrackerLevel2
132     INCSRCS= \
133 pam-fi 1.56 ${DIRINC}/ExtTrack.h \
134     ${DIRINC}/ExtTrkingAlg.h \
135 mocchiut 1.10 ${DIRINC}/TrkLevel2.h \
136     ${DIRINC}/TrkLevel1.h \
137     ${DIRINC}/TrkLevel0.h \
138 pam-fi 1.13 ${DIRINC}/TrkHough.h \
139 pam-fi 1.16 ${DIRINC}/TrkCalib.h \
140 pam-fi 1.22 ${DIRINC}/TrkParams.h \
141 mocchiut 1.10 ${DIRINC}/TrkStruct.h \
142     ${DIRINC}/TrkProcess.h \
143     ${DIRINC}/TrkCore.h \
144     ${DIRINC}/TrkVerl2.h
145     MACROSSRCS=
146     CALIBFILES=
147     DOCFILES=
148     # Here the Variables used for info target
149     PACKAGE=Tracker flight software
150     EXECUTABLES=${EXESRCS}
151     LIBS= ${FULLLIBS} ${OTHERLIBS}
152     DOCS=
153     SRCS=
154     MACROS= ${MACROSSRCS}
155     INCLUDE= ${INCSRCS}
156     #
157     TOBEDEL = junk
158     ROOTINC=$$${shell root-config --incdir}
159     NROOTINC=${shell root-config --incdir}
160     # Let's start
161     #all : test mkbindir mklibdir mkverpath ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${FOBJS} ${COBJS} ${CXXEXELIBS}
162 mocchiut 1.54 all : test mkbindir mklibdir mkverpath ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBSTRK}
163 mocchiut 1.10 all:
164 mocchiut 1.44 # @echo -e ${GREEN} ""
165     # @(${EGREEN} " Finished, now you can install the package \n (use: make install or make upgrade or make forceinstall) "; ${RESET})
166 mocchiut 1.10 @echo -e ${GREEN} ""
167     @${RESET}
168    
169     standalone: all ${CXXEXELIBS}
170    
171 mocchiut 1.44 include ../Make.dect
172 mocchiut 1.10
173     ${DIRLIB}/%.o : ${DIRSRC}/F77/%.f
174 mocchiut 1.44 @(${EGREEN} "Creating tracker F77 object file: "${WHITE} "$@"; ${RESET})
175 mocchiut 1.10 @${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/F77/`basename ${@} .o`.f -I${DIRTOP}/${DIRINC}/F77 -I${NROOTINC} ${SUBINC} -I${PAM_YODA}/include/yoda -I${PAM_INC}/
176    
177 mocchiut 1.54
178     ${LIBCPPLIBSTRK}: ${LIBSRCS} ${COBJS} ${FOBJS}
179     #
180     # create .o
181     #
182     @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})
183     @${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} -I${DIRTOP}/../CalorimeterLevel2/inc -I${DIRTOP}/../ToFLevel2/inc -I${DIRTOP}/../TriggerLevel2/inc -I${DIRTOP}/../OrbitalInfo/inc
184     #
185     # create .so
186     #
187     @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET})
188     @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $(LG2C) ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${FOBJS} ${COBJS} 1>/dev/null
189     @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))
190    
191 mocchiut 1.10 # A small target to check environmental variables
192     %_env:
193     @${test_env}
194    
195     .PHONY: install installdoc installlib installmacros installinc installexe installcmacro
196     .PHONY: clean depclean info mkbindir mklibdir testcern testpamenv test
197    
198     mkbindir: ${DIRBIN}
199     ${DIRBIN}:
200     @${test_and_mk}
201    
202     mklibdir: ${DIRLIB}
203     ${DIRLIB}:
204     @${test_and_mk}
205    
206     # Here what has to be deleted in clean target
207     clean: TOBEDEL= ${DIRSRC}/*.o ${DIRSRC}/*Dict.cpp ${DIRSRC}/*Dict.h ${FOBJS} ${FULLLIBS} ${DIRBIN}/${CXXEXELIBS} ${COBJS} ${CXXEXEOBJS} ${DIRSRC}/TrkVerl2.cpp
208     clean:
209     @${test_and_rm}
210    
211     distclean: clean
212     distclean: TOBEDEL= ${DIRBIN} ${DIRLIB}
213     distclean:
214     @${test_and_rm}
215    
216     forceinstall: FORCE=-f
217     forceinstall: install
218    
219     upgrade: FORCE=-u
220     upgrade: install
221     upgradestandalone: FORCE=-u
222     upgradestandalone: installstandalone
223    
224     install: installlib installinc installmacros installcalib installdoc installcmacro
225     installstandalone: install installexe
226    
227     installlib: LINK=y
228     installlib: TOBEMOVED= $(FULLLIBS:${DIRLIB}%=${PAM_LIB}%)
229     installlib: ORIGIN=${DIRLIB}
230     installlib:
231     @${test_and_cp}
232    
233     installcmacro: LINK=y
234     installcmacro: TOBEMOVED= $(FULLMACROCLIBS:${DIRLIB}%=${PAM_LIB}%)
235     installcmacro: ORIGIN=${DIRLIB}
236     installcmacro:
237     @${test_and_cp}
238    
239     installinc: TOBEMOVED= $(INCSRCS:${DIRINC}/%=${PAM_INC}/%)
240     installinc: ORIGIN=${DIRINC}
241     installinc:
242     @${test_and_cp}
243    
244     installexe: TOBEMOVED= $(EXESRCS:${DIRBIN}/%=${PAM_BIN}/%)
245     installexe: ORIGIN=${DIRBIN}
246     installexe:
247     @${test_and_cp}
248    
249     installmacros: TOBEMOVED= $(MACROSSRCS:${DIRMACROS}/%=${PAM_MACROS}/%)
250     installmacros: ORIGIN=${DIRMACROS}
251     installmacros:
252     @${test_and_cp}
253    
254     installcalib: TOBEMOVED= $(CALIBFILES:${DIRCALIB}/%=${PAM_CALIB}/%)
255     installcalib: ORIGIN=${DIRCALIB}
256     installcalib:
257     @${test_and_cp}
258    
259     installdoc: TOBEMOVED= $(DOCFILES:${DIRDOC}/%=${PAM_DOC}/%)
260     installdoc: ORIGIN=${DIRDOC}
261     installdoc:
262     @${test_and_cp}
263    
264     mkverpath:
265     # @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
266 pam-fi 1.46 @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
267 mocchiut 1.10 @sleep 0.8
268    
269    
270    
271     info:
272     @echo " "
273     @${EGREEN} "Infos for package :" ${WHITE} ${PACKAGE}
274     @${EGREEN} " VERSION :" ${WHITE} ${VER}
275     @${EGREEN} " EXECUTABLES :" ${WHITE} ${EXECUTABLES}
276     @${EGREEN} " INCLUDES :" ${WHITE} ${INCLUDE}
277     @${EGREEN} " LIBS :" ${WHITE} ${LIBS}
278     @${EGREEN} " DOCS :" ${WHITE} ${DOCS}
279     @${EGREEN} " SRCS :" ${WHITE} ${SRCS}
280     @${EGREEN} " MACROS :" ${WHITE} ${MACROS}
281     @echo " "
282     @${RESET}
283    
284     test: testpamenv
285    
286     testpamenv: ${PAM_ENV}
287    
288     root-config: OPT=--cflags
289     root-config:
290     @${test_cmd}
291    
292     # Here follows some usefull macros
293     define test_and_cp
294     wd=`pwd`;\
295     for i in ${TOBEMOVED} ; do \
296     wv=$${i##/*/}; \
297     dest=$${i/$${wv}/}; \
298     ${EGREEN} "Testing for :" ${WHITE} "$${i}" ; ${RESET}; \
299     if [ ! "${FORCE}" ] ; then \
300     if [ ! -f $${i} ]; then \
301     ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\
302     ${EGREEN} " to: "${WHITE} $${i} ; ${RESET}; \
303     cp ${ORIGIN}/$${i##/*/} $${i}; \
304     else \
305     ${ERED} "File already exist !!!! Please delete it " ${WHITE}; ${RESET}; \
306     fi;\
307     else \
308     if [ "${FORCE}" == "-u" ] ; then \
309     if [ "`basename $${i}`" != "`basename $${i} _${VER}.so`" ]; then \
310     ${EYELLOW} "Removing: "${WHITE} ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so; ${RESET}; \
311     rm -f ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so ; \
312     ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\
313     ${EGREEN} " to: "${WHITE} $${i} ; ${RESET}; \
314     cp ${ORIGIN}/$${i##/*/} $${i}; \
315     else \
316     ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
317     ${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \
318     cp -f ${ORIGIN}/$${i##/*/} $${i}; \
319     fi; \
320     else \
321     ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
322     ${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \
323     cp ${FORCE} ${ORIGIN}/$${i##/*/} $${i}; \
324     fi;\
325     fi ;\
326     if [ ! -z ${LINK} ] ; then \
327     ${EGREEN} "Creating symlink from : "${WHITE} $${wv/_${VER}/} ;\
328     ${EGREEN} " to : "${WHITE} $${i##/*/} ; ${RESET}; \
329     cd $${dest}; \
330     ln -sf $${wv} $${wv/_${VER}/}; \
331     cd $${wd}; \
332     fi \
333     done
334     endef
335    
336     define test_and_mk
337     ${EGREEN} "Testing for :" ${WHITE} "$@"; ${RESET}
338     test -d "$@" || \
339     (${EGREEN} "Creating : "${WHITE} "$@"; ${RESET}; mkdir -p $@)
340     endef
341    
342     define test_env
343     ${EGREEN} "Testing for env:" ${WHITE} $(patsubst %_env,%,$@); ${RESET}
344     printenv $(patsubst %_env,%,$@) 1>/dev/null || \
345     (${ERED} "ERROR, variable : "${WHITE} $(patsubst %_env,%,$@) \
346     ${RED} "not defined !!! Check your env. settings"; \
347     ${RESET}; exit 1)
348     ${EGREEN} " Defined:" ${WHITE} $${$(patsubst %_env,%,$@)}; ${RESET}
349     endef
350    
351     define test_cmd
352     ${EGREEN} "Testing for cmd:" ${WHITE} $@ ${OPT}; ${RESET}
353     $@ ${OPT} 1>/dev/null 2>&1 || \
354     (${ERED} "ERROR, command : "${WHITE} $@ ${OPT}\
355     ${RED} "not found !!! Check your installation"; \
356     ${RESET}; exit 1)
357     ${EGREEN} " Present:" ${WHITE} $@ ${OPT}; ${RESET}
358     endef
359    
360     define test_and_rm
361     for i in ${TOBEDEL}; do \
362     test -d $${i} || (${ERED} "Removing file :"${WHITE} $${i}; ${RESET}; \
363     rm -f $${i} ); \
364     test ! -d $${i} || (${ERED} "Removing dir :"${WHITE} $${i}; ${RESET}; \
365     rm -rf $${i} ); \
366     done
367     endef

  ViewVC Help
Powered by ViewVC 1.1.23