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

Diff of /DarthVader/TrackerLevel2/Makefile

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by pam-fi, Tue Nov 7 15:55:10 2006 UTC revision 1.43 by mocchiut, Thu Jul 30 08:38:40 2009 UTC
# Line 1  Line 1 
1  # Tracker flight analysis software  # Tracker flight analysis software
2  # SOFTWARE VERSION  # SOFTWARE VERSION
3  VER= v2r00  VER= v6r02
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
7  RED='\E[1;31;40m'  RED='\E[1;31;40m'
8  GREEN='\E[1;32;40m'  GREEN='\E[1;32;40m'
9  YELLOW='\E[1;33;40m'  YELLOW='\E[1;33;40m'
10  BLUE='\E[1;34;40m'  BLUE='\E[1;34;40m'
11  WHITE='\E[1;37;40m'  WHITE='\E[1;37;40m'
12  VIOLET='\E[1;35;40m'  VIOLET='\E[1;35;40m'
13  CYAN='\E[1;36;40m'  CYAN='\E[1;36;40m'
14  # Here the echo definition to use them  # Here the echo definition to use them
15  EVIOLET=echo -e ${VIOLET}  EVIOLET=echo -e ${VIOLET}
16  ECYAN=echo -e ${CYAN}  ECYAN=echo -e ${CYAN}
17  ERED=echo -e ${RED}  ERED=echo -e ${RED}
18  EGREEN=echo -e ${GREEN}  EGREEN=echo -e ${GREEN}
19  EYELLOW=echo -e ${YELLOW}  EYELLOW=echo -e ${YELLOW}
20  EBLUE=echo -e ${BLUE}  EBLUE=echo -e ${BLUE}
21  EWHITE=echo -e ${WHITE}  EWHITE=echo -e ${WHITE}
22  # Reset the terminal  # Reset the terminal
23  RESET=tput sgr0  RESET=tput sgr0
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  # Enviroment:  CFLAGS=-Wall -O3 -funroll-loops -fPIC -pthread ${PAM_BIT}
30  GCCVER=`gcc --version | head -1`  #CFLAGS=-Wall -fPIC -pthread ${PAM_BIT}
31  UNAMEA=`uname -a`  # Enviroment:
32  TODAY=`date`  GCCVER=`gcc --version | head -1`
33  # F77  UNAMEA=`uname -a`
34  F77=g77  TODAY=`date`
35  #F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash  #
36  F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash  ifeq ($(PAM_BIT),"-m32")
37  # C++          MALIGN=-malign-double
38  CXX=g++  else
39  #CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=${DEBUG}'          MALIGN=
40  #CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=0'  endif
41  #CXXFLAGS=-Wall -O -fPIC -pthread -fpermissive  # F77
42  CXXFLAGS=-Wall -O -fPIC -pthread  F77=g77
43  # ROOTCINT  #F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash  ${PAM_BIT}
44  ROOTCINT=rootcint  #F77FLAGS=  -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
45  # Here the variables definig the local directories  #F77FLAGS=  -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
46  DIRTOP=${shell pwd}  F77FLAGS=  -O2 $(MALIGN) -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
47  #DIRLIB=lib/${ARCH}/  #F77FLAGS=  -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
48  #DIRBIN=bin/${ARCH}/  #F77FLAGS=   -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
49  DIRLIB=../lib/${ARCH}/  #F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
50  DIRBIN=../bin/${ARCH}/  # C++
51  DIRSRC=src  CXX=g++
52  DIRINC=inc  #CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=${DEBUG}' ${PAM_BIT}
53  DIRDOC=doc  #CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=0' ${PAM_BIT}
54  DIRMACROS=macros  #CXXFLAGS=-Wall -O -fPIC -pthread -fpermissive ${PAM_BIT}
55  DIRCALIB=calib  #CXXFLAGS=-Wall -O4 -fPIC -pthread ${PAM_BIT}
56  # Here the  PAMELA environmental variables to be checked  CXXFLAGS=-Wall -O3 -funroll-loops -fPIC -pthread ${PAM_BIT}
57  PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env PAM_YODA_env  #CXXFLAGS=-Wall -fPIC -pthread ${PAM_BIT}
58  # Here the local variables used to build the targets  # ROOTCINT
59  #-------------------------------------------------  ROOTCINT=rootcint
60  FSRCS=${DIRSRC}/F77/fillpedsig.f   \  # Here the variables definig the local directories
61          ${DIRSRC}/F77/readallparam.f \  DIRTOP=${shell pwd}
62          ${DIRSRC}/F77/functions.f    \  #DIRLIB=lib/${ARCH}/
63          ${DIRSRC}/F77/cncomp.f    \  #DIRBIN=bin/${ARCH}/
64          ${DIRSRC}/F77/filladc.f    \  DIRLIB=../lib/${ARCH}/
65          ${DIRSRC}/F77/reductionflight.f \  DIRBIN=../bin/${ARCH}/
66          ${DIRSRC}/F77/functionspfa.f    \  DIRSRC=src
67          ${DIRSRC}/F77/mini.f \  DIRINC=inc
68          ${DIRSRC}/F77/tricircle.f \  DIRDOC=doc
69          ${DIRSRC}/F77/analysissubroutines.f \  DIRMACROS=macros
70          ${DIRSRC}/F77/analysisflight.f \  DIRCALIB=calib
71          ${DIRSRC}/F77/readB.f \  # Here the  PAMELA environmental variables to be checked
72          ${DIRSRC}/F77/interB.f \  PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env PAM_YODA_env
73          ${DIRSRC}/F77/track.f \  # Here the local variables used to build the targets
74          ${DIRSRC}/F77/grkuta.f  #-------------------------------------------------
75    FSRCS=${DIRSRC}/F77/fillpedsig.f   \
76  FOBJS=$(FSRCS:${DIRSRC}/F77/%.f=${DIRLIB}/%.o)          ${DIRSRC}/F77/readallparam.f \
77  #-------------------------------------------------          ${DIRSRC}/F77/functions.f    \
78  CSRCS=          ${DIRSRC}/F77/cncomp.f    \
79  COBJS=$(CSRCS:${DIRSRC}%.cpp=${DIRLIB}/%.o)          ${DIRSRC}/F77/filladc.f    \
80  #-------------------------------------------------          ${DIRSRC}/F77/reductionflight.f \
81  # librerie utilizzabili da root (ci deve essere anche il ***LinkDef.h )          ${DIRSRC}/F77/functionspfa.f    \
82  LIBROOTSRCS=    ${DIRSRC}/TrkLevel2.cpp  \          ${DIRSRC}/F77/mini.f \
83                                  ${DIRSRC}/TrkLevel1.cpp          ${DIRSRC}/F77/tricircle.f \
84  #LIBROOTSRCS=            ${DIRSRC}/F77/analysissubroutines.f \
85  LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)          ${DIRSRC}/F77/analysisflight.f \
86  LIBROOTOBJS=${DIRLIB}/readB.o ${DIRLIB}/interB.o ${DIRLIB}/track.o ${DIRLIB}/grkuta.o ${DIRLIB}/functionspfa.o ${DIRLIB}/readallparam.o ${DIRLIB}/functions.o ${DIRLIB}/mini.o          ${DIRSRC}/F77/readB.f \
87  LIBROOTCLIBS=libTrkLevel2 libTrkLevel1          ${DIRSRC}/F77/interB.f \
88  #LIBROOTCLIBS=          ${DIRSRC}/F77/track.f \
89  FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so)          ${DIRSRC}/F77/grkuta.f \
90  #-------------------------------------------------          ${DIRSRC}/F77/bdll.f      # ***PP***
91  # librerie C++ NON utilizzabili da root  
92  #LIBCPPSRCS=  ${DIRSRC}/TrkLevel2.cpp \  FOBJS=$(FSRCS:${DIRSRC}/F77/%.f=${DIRLIB}/%.o)
93  #               ${DIRSRC}/TrkLevel0.cpp  #-------------------------------------------------
94  LIBCPPSRCS=${DIRSRC}/TrkLevel0.cpp \  CSRCS=
95             ${DIRSRC}/TrkStruct.cpp \  COBJS=$(CSRCS:${DIRSRC}%.cpp=${DIRLIB}/%.o)
96             ${DIRSRC}/TrkProcess.cpp \  #-------------------------------------------------
97             ${DIRSRC}/TrkVerl2.cpp \  # librerie utilizzabili da root (ci deve essere anche il ***LinkDef.h )
98             ${DIRSRC}/TrkCore.cpp    LIBROOTSRCS=${DIRSRC}/TrkParams.cpp \
99  LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)          ${DIRSRC}/TrkLevel2.cpp  \
100  #LIBCPPCLIBS=libTrkLevel2 libTrkLevel0          ${DIRSRC}/TrkLevel1.cpp \
101  LIBCPPCLIBS=libTrkLevel0 libTrkStruct libTrkProcess libTrkCore libTrkVerl2          ${DIRSRC}/TrkLevel0.cpp \
102  FULLCPPCLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so)          ${DIRSRC}/TrkHough.cpp \
103  #-------------------------------------------------          ${DIRSRC}/TrkCalib.cpp
104  # librerie F77 NON utilizzabili da root  
105  LIBF77SRCS=  #LIBROOTSRCS=  
106  LIBF77OBJS= $(LIBF77SRCS:${DIRSRC}/F77/%.f=${DIRLIB}/%.o)  LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
107  LIBF77LIBS= $(LIBF77SRCS:${DIRSRC}/F77/%.f=${DIRLIB}/lib%_${VER}.so)  LIBROOTOBJS=${DIRLIB}/readB.o \
108  LIBF77CLIBS=          ${DIRLIB}/interB.o \
109  FULLF77CLIBS=$(LIBF77CLIBS:%=${DIRLIB}/%_${VER}.so)          ${DIRLIB}/track.o \
110  #-------------------------------------------------          ${DIRLIB}/grkuta.o \
111  FULLLIBS=${FULLROOTCLIBS} ${FULLCPPCLIBS} ${FULLF77CLIBS}          ${DIRLIB}/bdll.o \
112            ${DIRLIB}/functionspfa.o \
113  #-------------------------------------------------          ${DIRLIB}/readallparam.o \
114  # eseguibile          ${DIRLIB}/functions.o  \
115  CXXEXESRCS=${DIRSRC}/TrackerLevel2.cpp          ${DIRLIB}/mini.o  \
116  CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=${DIRLIB}%.o)          ${DIRLIB}/tricircle.o  \
117  CXXEXELIBS:=TrackerLevel2          ${DIRLIB}/analysisflight.o  \
118            ${DIRLIB}/analysissubroutines.o  \
119  OTHERLIBS=${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so          ${DIRLIB}/fillpedsig.o  \
120  SUBDIR=../RunInfo          ${DIRLIB}/cncomp.o  \
121  SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done)          ${DIRLIB}/filladc.o  \
122            ${DIRLIB}/reductionflight.o
123  #-------------------------------------------------  LIBROOTCLIBS= libTrkParams libTrkLevel2 libTrkLevel1 libTrkLevel0 libTrkHough libTrkCalib
124  # variabili per l'installazione  
125  EXESRCS=${DIRBIN}/TrackerLevel2  #LIBROOTCLIBS=
126  INCSRCS= \  FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so)
127          ${DIRINC}/TrkLevel2.h \  #-------------------------------------------------
128          ${DIRINC}/TrkLevel1.h \  # librerie C++ NON utilizzabili da root
129          ${DIRINC}/TrkLevel0.h \  #LIBCPPSRCS=  ${DIRSRC}/TrkLevel2.cpp \
130          ${DIRINC}/TrkStruct.h \  #               ${DIRSRC}/TrkLevel0.cpp
131          ${DIRINC}/TrkProcess.h \  LIBCPPSRCS=${DIRSRC}/TrkStruct.cpp \
132          ${DIRINC}/TrkCore.h \             ${DIRSRC}/TrkProcess.cpp \
133          ${DIRINC}/TrkVerl2.h             ${DIRSRC}/TrkVerl2.cpp \
134  MACROSSRCS=             ${DIRSRC}/TrkCore.cpp \
135  CALIBFILES=  #          ${DIRSRC}/TrkLevel0.cpp
136  DOCFILES=  
137  # Here the Variables used for info target  LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
138  PACKAGE=Tracker flight software  #LIBCPPCLIBS=libTrkLevel2 libTrkLevel0
139  EXECUTABLES=${EXESRCS}  LIBCPPCLIBS= libTrkStruct libTrkProcess libTrkCore libTrkVerl2 #libTrkLevel0
140  LIBS= ${FULLLIBS} ${OTHERLIBS}  FULLCPPCLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so)
141  DOCS=  #-------------------------------------------------
142  SRCS=  # librerie F77 NON utilizzabili da root
143  MACROS= ${MACROSSRCS}  LIBF77SRCS=
144  INCLUDE= ${INCSRCS}  LIBF77OBJS= $(LIBF77SRCS:${DIRSRC}/F77/%.f=${DIRLIB}/%.o)
145  #  LIBF77LIBS= $(LIBF77SRCS:${DIRSRC}/F77/%.f=${DIRLIB}/lib%_${VER}.so)
146  TOBEDEL = junk  LIBF77CLIBS=
147  ROOTINC=$$${shell root-config --incdir}  FULLF77CLIBS=$(LIBF77CLIBS:%=${DIRLIB}/%_${VER}.so)
148  NROOTINC=${shell root-config --incdir}  #-------------------------------------------------
149  # Let's start  FULLLIBS=${FULLROOTCLIBS} ${FULLCPPCLIBS} ${FULLF77CLIBS}
150  #all : test mkbindir mklibdir mkverpath ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${FOBJS} ${COBJS} ${CXXEXELIBS}  
151  all : test mkbindir mklibdir mkverpath ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS}  #-------------------------------------------------
152  all:  # eseguibile
153          @echo -e ${GREEN} ""  CXXEXESRCS=${DIRSRC}/TrackerLevel2.cpp
154          @(${EGREEN} " Finished, now you can install the package \n  (use: make install or make upgrade or make forceinstall) "; ${RESET})  CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=${DIRLIB}%.o)
155          @echo -e ${GREEN} ""  CXXEXELIBS:=TrackerLevel2
156          @${RESET}  
157    OTHERLIBS=${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so
158  standalone: all ${CXXEXELIBS}  SUBDIR=../RunInfo
159    SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done)
160  # Here some general rules to produce objects in our local dir  
161  ${DIRLIB}/%.o: ${DIRSRC}/%.cpp  #-------------------------------------------------
162  #       @(${EYELLOW} " C++ object ------------------------")  # variabili per l'installazione
163          @(${EGREEN} "Creating C++ object file: "${WHITE} "$@"; ${RESET})  EXESRCS=${DIRBIN}/TrackerLevel2
164          @${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.cpp -I${DIRTOP}/${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ `root-config --cflags`  INCSRCS= \
165            ${DIRINC}/TrkLevel2.h \
166  ${DIRLIB}/%.o : ${DIRSRC}/F77/%.f          ${DIRINC}/TrkLevel1.h \
167  #       @(${EYELLOW} " F77 object ------------------------")          ${DIRINC}/TrkLevel0.h \
168          @(${EGREEN} "Creating F77 object file: "${WHITE} "$@"; ${RESET})          ${DIRINC}/TrkHough.h \
169          @${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/F77/`basename ${@} .o`.f -I${DIRTOP}/${DIRINC}/F77 -I${NROOTINC} ${SUBINC} -I${PAM_YODA}/include/yoda -I${PAM_INC}/          ${DIRINC}/TrkCalib.h \
170            ${DIRINC}/TrkParams.h \
171  # .so from .o fortran          ${DIRINC}/TrkStruct.h \
172  ${LIBF77LIBS}: ${LIBF77OBJS}          ${DIRINC}/TrkProcess.h \
173          @(${EYELLOW} " F77 shared library --------------------------")          ${DIRINC}/TrkCore.h \
174          @(${EGREEN} "Creating library: "${WHITE} "$@"; ${RESET})          ${DIRINC}/TrkVerl2.h
175  #       @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $^ `cernlib mathlib` /usr/lib/libg2c.so.0  MACROSSRCS=
176  ##      @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^ `cernlib mathlib`  CALIBFILES=
177          @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^  DOCFILES=
178    # Here the Variables used for info target
179  ${LIBROOTLIBS}: ${LIBROOTSRCS} ${FOBJS}  PACKAGE=Tracker flight software
180          @(${EYELLOW} " ROOT library ------------------------")  EXECUTABLES=${EXESRCS}
181          @(${EGREEN} "Creating file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})  LIBS= ${FULLLIBS} ${OTHERLIBS}
182  #  DOCS=
183  #       Create *Dict.cpp and *Dict.h  SRCS=
184  #  MACROS= ${MACROSSRCS}
185          @${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  INCLUDE= ${INCSRCS}
186  #  #
187  #       create .o  TOBEDEL = junk
188  #  ROOTINC=$$${shell root-config --incdir}
189          @(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})  NROOTINC=${shell root-config --incdir}
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} -I${DIRTOP} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ -I${NROOTINC};  # Let's start
191          @(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})  #all : test mkbindir mklibdir mkverpath ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${FOBJS} ${COBJS} ${CXXEXELIBS}
192          @${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};  all : test mkbindir mklibdir mkverpath ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS}
193          @ln -sf  ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))  all:
194  #          @echo -e ${GREEN} ""
195  #       create .so          @(${EGREEN} " Finished, now you can install the package \n  (use: make install or make upgrade or make forceinstall) "; ${RESET})
196  #          @echo -e ${GREEN} ""
197          @(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET})          @${RESET}
198  ##      @${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          
199          @${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    standalone: all ${CXXEXELIBS}
200  #       ${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  
201          @ln -sf  ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))  # Here some general rules to produce objects in our local dir
202          @(${EYELLOW} " -------------------------------------")  ${DIRLIB}/%.o: ${DIRSRC}/%.cpp
203    #       @(${EYELLOW} " C++ object ------------------------")
204  ${LIBCPPLIBS}: ${LIBCPPSRCS}          @(${EGREEN} "Creating C++ object file: "${WHITE} "$@"; ${RESET})
205  #          @${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.cpp -I${DIRTOP}/${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ `root-config --cflags`
206  #       create .o  
207  #  ${DIRLIB}/%.o : ${DIRSRC}/F77/%.f
208          @(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})  #       @(${EYELLOW} " F77 object ------------------------")
209          @${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};          @(${EGREEN} "Creating F77 object file: "${WHITE} "$@"; ${RESET})
210  #          @${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/F77/`basename ${@} .o`.f -I${DIRTOP}/${DIRINC}/F77 -I${NROOTINC} ${SUBINC} -I${PAM_YODA}/include/yoda -I${PAM_INC}/
211  #       create .so  
212  #  # .so from .o fortran
213          @(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET})  ${LIBF77LIBS}: ${LIBF77OBJS}
214          @${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  #       @(${EYELLOW} " F77 shared library --------------------------")
215          @ln -sf  ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))          @(${EGREEN} "Creating library: "${WHITE} "$@"; ${RESET})
216    #       @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $^ `cernlib mathlib` /usr/lib/libg2c.so.0
217    ##      @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^ `cernlib mathlib`
218  ${CXXEXELIBS}: ${COBJS} ${FOBJS} ${CXXEXEOBJS}          @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^
219          @(${EVIOLET} "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *")  
220          @(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET})  ${LIBROOTLIBS}: ${LIBROOTSRCS} ${FOBJS}
221  #       @${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;  #       @(${EYELLOW} " ROOT library ------------------------")
222          @${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`;          @(${EGREEN} "Creating file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})
223    #
224    #       Create *Dict.cpp and *Dict.h
225  # A small target to check environmental variables  #
226  %_env:          @${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
227          @${test_env}  #
228    #       create .o
229  .PHONY: install installdoc installlib installmacros installinc installexe installcmacro  #
230  .PHONY: clean depclean info mkbindir mklibdir testcern testpamenv test          @(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})
231            @${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};
232  mkbindir: ${DIRBIN}          @(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})
233  ${DIRBIN}:          @${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};
234          @${test_and_mk}          @ln -sf  ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))
235    #
236  mklibdir: ${DIRLIB}  #       create .so
237  ${DIRLIB}:  #
238          @${test_and_mk}          @(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET})
239    ##      @${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        
240  # Here what has to be deleted in clean target          @${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  
241  clean: TOBEDEL= ${DIRSRC}/*.o ${DIRSRC}/*Dict.cpp ${DIRSRC}/*Dict.h ${FOBJS} ${FULLLIBS} ${DIRBIN}/${CXXEXELIBS} ${COBJS} ${CXXEXEOBJS} ${DIRSRC}/TrkVerl2.cpp  #       ${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
242  clean:          @ln -sf  ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))
243          @${test_and_rm}  #       @(${EYELLOW} " -------------------------------------")
244    
245  distclean: clean  ${LIBCPPLIBS}: ${LIBCPPSRCS}
246  distclean: TOBEDEL= ${DIRBIN} ${DIRLIB}  #
247  distclean:  #       create .o
248          @${test_and_rm}  #
249            @(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})
250  forceinstall: FORCE=-f          @${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};
251  forceinstall: install  #
252    #       create .so
253  upgrade: FORCE=-u  #
254  upgrade: install          @(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET})
255  upgradestandalone: FORCE=-u          @${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
256  upgradestandalone: installstandalone          @ln -sf  ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))
257    
258  install: installlib installinc installmacros installcalib installdoc installcmacro  
259  installstandalone: install installexe  ${CXXEXELIBS}: ${COBJS} ${FOBJS} ${CXXEXEOBJS}
260            @(${EVIOLET} "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *")
261  installlib: LINK=y          @(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET})
262  installlib: TOBEMOVED= $(FULLLIBS:${DIRLIB}%=${PAM_LIB}%)  #       @${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;
263  installlib: ORIGIN=${DIRLIB}          @${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`;
264  installlib:  
265          @${test_and_cp}  
266    # A small target to check environmental variables
267  installcmacro: LINK=y  %_env:
268  installcmacro: TOBEMOVED= $(FULLMACROCLIBS:${DIRLIB}%=${PAM_LIB}%)          @${test_env}
269  installcmacro: ORIGIN=${DIRLIB}  
270  installcmacro:  .PHONY: install installdoc installlib installmacros installinc installexe installcmacro
271          @${test_and_cp}  .PHONY: clean depclean info mkbindir mklibdir testcern testpamenv test
272    
273  installinc: TOBEMOVED= $(INCSRCS:${DIRINC}/%=${PAM_INC}/%)  mkbindir: ${DIRBIN}
274  installinc: ORIGIN=${DIRINC}  ${DIRBIN}:
275  installinc:          @${test_and_mk}
276          @${test_and_cp}  
277    mklibdir: ${DIRLIB}
278  installexe: TOBEMOVED= $(EXESRCS:${DIRBIN}/%=${PAM_BIN}/%)  ${DIRLIB}:
279  installexe: ORIGIN=${DIRBIN}          @${test_and_mk}
280  installexe:  
281          @${test_and_cp}  # Here what has to be deleted in clean target
282    clean: TOBEDEL= ${DIRSRC}/*.o ${DIRSRC}/*Dict.cpp ${DIRSRC}/*Dict.h ${FOBJS} ${FULLLIBS} ${DIRBIN}/${CXXEXELIBS} ${COBJS} ${CXXEXEOBJS} ${DIRSRC}/TrkVerl2.cpp
283  installmacros: TOBEMOVED= $(MACROSSRCS:${DIRMACROS}/%=${PAM_MACROS}/%)  clean:
284  installmacros: ORIGIN=${DIRMACROS}          @${test_and_rm}
285  installmacros:  
286          @${test_and_cp}  distclean: clean
287    distclean: TOBEDEL= ${DIRBIN} ${DIRLIB}
288  installcalib: TOBEMOVED= $(CALIBFILES:${DIRCALIB}/%=${PAM_CALIB}/%)  distclean:
289  installcalib: ORIGIN=${DIRCALIB}          @${test_and_rm}
290  installcalib:  
291          @${test_and_cp}  forceinstall: FORCE=-f
292    forceinstall: install
293  installdoc: TOBEMOVED= $(DOCFILES:${DIRDOC}/%=${PAM_DOC}/%)  
294  installdoc: ORIGIN=${DIRDOC}  upgrade: FORCE=-u
295  installdoc:  upgrade: install
296          @${test_and_cp}  upgradestandalone: FORCE=-u
297    upgradestandalone: installstandalone
298  mkverpath:  
299  #       @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  install: installlib installinc installmacros installcalib installdoc installcmacro
300          @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  installstandalone: install installexe
301          @sleep 0.8  
302    installlib: LINK=y
303    installlib: TOBEMOVED= $(FULLLIBS:${DIRLIB}%=${PAM_LIB}%)
304    installlib: ORIGIN=${DIRLIB}
305  info:  installlib:
306          @echo " "          @${test_and_cp}
307          @${EGREEN} "Infos for package :" ${WHITE} ${PACKAGE}  
308          @${EGREEN} "          VERSION :" ${WHITE} ${VER}  installcmacro: LINK=y
309          @${EGREEN} "      EXECUTABLES :" ${WHITE} ${EXECUTABLES}  installcmacro: TOBEMOVED= $(FULLMACROCLIBS:${DIRLIB}%=${PAM_LIB}%)
310          @${EGREEN} "         INCLUDES :" ${WHITE} ${INCLUDE}  installcmacro: ORIGIN=${DIRLIB}
311          @${EGREEN} "             LIBS :" ${WHITE} ${LIBS}  installcmacro:
312          @${EGREEN} "             DOCS :" ${WHITE} ${DOCS}          @${test_and_cp}
313          @${EGREEN} "             SRCS :" ${WHITE} ${SRCS}  
314          @${EGREEN} "           MACROS :" ${WHITE} ${MACROS}  installinc: TOBEMOVED= $(INCSRCS:${DIRINC}/%=${PAM_INC}/%)
315          @echo " "  installinc: ORIGIN=${DIRINC}
316          @${RESET}  installinc:
317            @${test_and_cp}
318  test: testpamenv  
319    installexe: TOBEMOVED= $(EXESRCS:${DIRBIN}/%=${PAM_BIN}/%)
320  testpamenv: ${PAM_ENV}  installexe: ORIGIN=${DIRBIN}
321    installexe:
322  root-config: OPT=--cflags          @${test_and_cp}
323  root-config:  
324          @${test_cmd}  installmacros: TOBEMOVED= $(MACROSSRCS:${DIRMACROS}/%=${PAM_MACROS}/%)
325    installmacros: ORIGIN=${DIRMACROS}
326  # Here follows some usefull macros  installmacros:
327  define  test_and_cp          @${test_and_cp}
328  wd=`pwd`;\  
329  for i in ${TOBEMOVED} ; do \  installcalib: TOBEMOVED= $(CALIBFILES:${DIRCALIB}/%=${PAM_CALIB}/%)
330  wv=$${i##/*/}; \  installcalib: ORIGIN=${DIRCALIB}
331  dest=$${i/$${wv}/}; \  installcalib:
332  ${EGREEN} "Testing for :" ${WHITE} "$${i}" ; ${RESET}; \          @${test_and_cp}
333  if [ ! "${FORCE}" ] ; then \  
334   if [ ! -f $${i} ]; then  \  installdoc: TOBEMOVED= $(DOCFILES:${DIRDOC}/%=${PAM_DOC}/%)
335    ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\  installdoc: ORIGIN=${DIRDOC}
336    ${EGREEN} "      to: "${WHITE} $${i} ; ${RESET}; \  installdoc:
337    cp ${ORIGIN}/$${i##/*/} $${i}; \          @${test_and_cp}
338   else \  
339     ${ERED} "File already exist !!!! Please delete it " ${WHITE}; ${RESET}; \  mkverpath:
340   fi;\  #       @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
341  else \          @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
342     if [ "${FORCE}" == "-u" ] ; then \          @sleep 0.8
343       if [ "`basename $${i}`" != "`basename $${i} _${VER}.so`" ]; then \  
344         ${EYELLOW} "Removing: "${WHITE} ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so; ${RESET}; \  
345         rm -f ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so ; \  
346         ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\  info:
347         ${EGREEN} "      to: "${WHITE} $${i} ; ${RESET}; \          @echo " "
348         cp ${ORIGIN}/$${i##/*/} $${i}; \          @${EGREEN} "Infos for package :" ${WHITE} ${PACKAGE}
349       else \          @${EGREEN} "          VERSION :" ${WHITE} ${VER}
350         ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\          @${EGREEN} "      EXECUTABLES :" ${WHITE} ${EXECUTABLES}
351         ${EYELLOW} "          to: "${WHITE} $${i} ; ${RESET}; \          @${EGREEN} "         INCLUDES :" ${WHITE} ${INCLUDE}
352         cp -f ${ORIGIN}/$${i##/*/} $${i}; \          @${EGREEN} "             LIBS :" ${WHITE} ${LIBS}
353       fi; \          @${EGREEN} "             DOCS :" ${WHITE} ${DOCS}
354     else \          @${EGREEN} "             SRCS :" ${WHITE} ${SRCS}
355       ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\          @${EGREEN} "           MACROS :" ${WHITE} ${MACROS}
356       ${EYELLOW} "          to: "${WHITE} $${i} ; ${RESET}; \          @echo " "
357       cp ${FORCE} ${ORIGIN}/$${i##/*/} $${i}; \          @${RESET}
358     fi;\  
359  fi ;\  test: testpamenv
360  if [ ! -z ${LINK} ] ; then \  
361    ${EGREEN} "Creating symlink from : "${WHITE} $${wv/_${VER}/} ;\  testpamenv: ${PAM_ENV}
362    ${EGREEN} "                   to : "${WHITE} $${i##/*/} ; ${RESET}; \  
363    cd $${dest}; \  root-config: OPT=--cflags
364    ln -sf $${wv} $${wv/_${VER}/}; \  root-config:
365    cd $${wd}; \          @${test_cmd}
366  fi \  
367  done  # Here follows some usefull macros
368  endef  define  test_and_cp
369    wd=`pwd`;\
370  define  test_and_mk  for i in ${TOBEMOVED} ; do \
371  ${EGREEN} "Testing for :" ${WHITE} "$@"; ${RESET}  wv=$${i##/*/}; \
372  test -d "$@" || \  dest=$${i/$${wv}/}; \
373  (${EGREEN} "Creating : "${WHITE} "$@"; ${RESET}; mkdir -p $@)  ${EGREEN} "Testing for :" ${WHITE} "$${i}" ; ${RESET}; \
374  endef  if [ ! "${FORCE}" ] ; then \
375     if [ ! -f $${i} ]; then  \
376  define  test_env    ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\
377  ${EGREEN} "Testing for env:" ${WHITE} $(patsubst %_env,%,$@); ${RESET}    ${EGREEN} "      to: "${WHITE} $${i} ; ${RESET}; \
378  printenv $(patsubst %_env,%,$@) 1>/dev/null || \    cp ${ORIGIN}/$${i##/*/} $${i}; \
379  (${ERED} "ERROR, variable : "${WHITE} $(patsubst %_env,%,$@) \   else \
380  ${RED} "not defined !!! Check your env. settings"; \     ${ERED} "File already exist !!!! Please delete it " ${WHITE}; ${RESET}; \
381  ${RESET}; exit 1)   fi;\
382  ${EGREEN} " Defined:" ${WHITE} $${$(patsubst %_env,%,$@)}; ${RESET}  else \
383  endef     if [ "${FORCE}" == "-u" ] ; then \
384         if [ "`basename $${i}`" != "`basename $${i} _${VER}.so`" ]; then \
385  define  test_cmd         ${EYELLOW} "Removing: "${WHITE} ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so; ${RESET}; \
386  ${EGREEN} "Testing for cmd:" ${WHITE} $@ ${OPT}; ${RESET}         rm -f ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so ; \
387  $@ ${OPT} 1>/dev/null 2>&1 || \         ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\
388  (${ERED} "ERROR, command : "${WHITE} $@ ${OPT}\         ${EGREEN} "      to: "${WHITE} $${i} ; ${RESET}; \
389  ${RED} "not found !!! Check your installation"; \         cp ${ORIGIN}/$${i##/*/} $${i}; \
390  ${RESET}; exit 1)       else \
391  ${EGREEN} " Present:" ${WHITE} $@ ${OPT}; ${RESET}         ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
392  endef         ${EYELLOW} "          to: "${WHITE} $${i} ; ${RESET}; \
393           cp -f ${ORIGIN}/$${i##/*/} $${i}; \
394  define  test_and_rm       fi; \
395  for i in ${TOBEDEL}; do \     else \
396  test -d $${i} || (${ERED} "Removing file :"${WHITE} $${i}; ${RESET}; \       ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
397  rm -f $${i} ); \       ${EYELLOW} "          to: "${WHITE} $${i} ; ${RESET}; \
398  test ! -d $${i} || (${ERED} "Removing dir :"${WHITE} $${i}; ${RESET}; \       cp ${FORCE} ${ORIGIN}/$${i##/*/} $${i}; \
399  rm -rf $${i} ); \     fi;\
400  done  fi ;\
401  endef  if [ ! -z ${LINK} ] ; then \
402      ${EGREEN} "Creating symlink from : "${WHITE} $${wv/_${VER}/} ;\
403      ${EGREEN} "                   to : "${WHITE} $${i##/*/} ; ${RESET}; \
404      cd $${dest}; \
405      ln -sf $${wv} $${wv/_${VER}/}; \
406      cd $${wd}; \
407    fi \
408    done
409    endef
410    
411    define  test_and_mk
412    ${EGREEN} "Testing for :" ${WHITE} "$@"; ${RESET}
413    test -d "$@" || \
414    (${EGREEN} "Creating : "${WHITE} "$@"; ${RESET}; mkdir -p $@)
415    endef
416    
417    define  test_env
418    ${EGREEN} "Testing for env:" ${WHITE} $(patsubst %_env,%,$@); ${RESET}
419    printenv $(patsubst %_env,%,$@) 1>/dev/null || \
420    (${ERED} "ERROR, variable : "${WHITE} $(patsubst %_env,%,$@) \
421    ${RED} "not defined !!! Check your env. settings"; \
422    ${RESET}; exit 1)
423    ${EGREEN} " Defined:" ${WHITE} $${$(patsubst %_env,%,$@)}; ${RESET}
424    endef
425    
426    define  test_cmd
427    ${EGREEN} "Testing for cmd:" ${WHITE} $@ ${OPT}; ${RESET}
428    $@ ${OPT} 1>/dev/null 2>&1 || \
429    (${ERED} "ERROR, command : "${WHITE} $@ ${OPT}\
430    ${RED} "not found !!! Check your installation"; \
431    ${RESET}; exit 1)
432    ${EGREEN} " Present:" ${WHITE} $@ ${OPT}; ${RESET}
433    endef
434    
435    define  test_and_rm
436    for i in ${TOBEDEL}; do \
437    test -d $${i} || (${ERED} "Removing file :"${WHITE} $${i}; ${RESET}; \
438    rm -f $${i} ); \
439    test ! -d $${i} || (${ERED} "Removing dir :"${WHITE} $${i}; ${RESET}; \
440    rm -rf $${i} ); \
441    done
442    endef

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.43

  ViewVC Help
Powered by ViewVC 1.1.23