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

Contents of /DarthVader/TrackerLevel2/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (show annotations) (download)
Mon Nov 20 13:14:01 2006 UTC (18 years ago) by pam-fi
Branch: MAIN
Changes since 1.13: +1 -1 lines
modified to be compiled on 64-bit machines

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

  ViewVC Help
Powered by ViewVC 1.1.23