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