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

Contents of /DarthVader/TrackerLevel2/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Mon Sep 4 15:43:53 2006 UTC (18 years, 3 months ago) by mocchiut
Branch: MAIN
Changes since 1.3: +11 -11 lines
THIS VERSION IS NOT COMPILING, start the adapting to the new profiler

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

  ViewVC Help
Powered by ViewVC 1.1.23