/[PAMELA software]/DarthVader/Makefile
ViewVC logotype

Annotation of /DarthVader/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (hide annotations) (download)
Mon Sep 4 15:44:59 2006 UTC (18 years, 2 months ago) by mocchiut
Branch: MAIN
Changes since 1.11: +1 -1 lines
THIS VERSION IS NOT COMPILING, start the adapting to the new profiler

1 mocchiut 1.1 # DarthVader flight analysis software
2     # SOFTWARE VERSION
3 mocchiut 1.12 VER= v2r00
4 mocchiut 1.1 # An almost general purpouse Makefile for PAMELA repository
5     # Let's start with some usefull definition for colorize the echo
6     RED='\E[1;31;40m'
7     GREEN='\E[1;32;40m'
8     YELLOW='\E[1;33;40m'
9     BLUE='\E[1;34;40m'
10     WHITE='\E[1;37;40m'
11     VIOLET='\E[1;35;40m'
12     CYAN='\E[1;36;40m'
13     # Here the echo definition to use them
14     EVIOLET=echo -e ${VIOLET}
15     ECYAN=echo -e ${CYAN}
16     ERED=echo -e ${RED}
17     EGREEN=echo -e ${GREEN}
18     EYELLOW=echo -e ${YELLOW}
19     EBLUE=echo -e ${BLUE}
20     EWHITE=echo -e ${WHITE}
21     # Reset the terminal
22     RESET=tput sgr0
23     # Here the variables used to override the standard make flags
24     #MAKE
25     MAKE=make
26     # C
27     CC=gcc
28     #CFLAGS=-Wall -O -fPIC -pthread -g
29     CFLAGS=-Wall -O -fPIC -pthread
30     # Enviroment:
31     GCCVER=`gcc --version | head -1`
32     UNAMEA=`uname -a`
33     TODAY=`date`
34     # F77
35     F77=g77
36     #F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash
37     F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash
38     # C++
39     CXX=g++
40     #CXXFLAGS=-Wall -O -fPIC -pthread -g
41     CXXFLAGS=-Wall -O -fPIC -pthread
42     # ROOTCINT
43     ROOTCINT=rootcint
44     # Here the variables definig the local directories
45     DIRTOP=${shell pwd}
46     #DIRLIB=../lib/${ARCH}
47     #DIRBIN=../bin/${ARCH}
48     DIRLIB=lib/${ARCH}
49     DIRBIN=bin/${ARCH}
50     DIRSRC=src
51     DIRINC=inc
52     DIRDOC=doc
53     DIRMACROS=macros
54     DIRCALIB=param
55     # Here the PAMELA environmental variables to be checked
56     PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env PAM_CALIB_env PAM_YODA_env
57    
58     # Here the local variables used to build the targets
59     # -- F77 - no libraries --
60     FSRCS=
61     FOBJS=$(FSRCS:${DIRSRC}%.for=${DIRLIB}%.o)
62    
63     # -- CPP - no libraries --
64     CPPSRCS=${DIRSRC}/DarthVaderVerl2.cpp
65     CPPOBJS=$(CPPSRCS:${DIRSRC}%.cpp=${DIRLIB}%.o)
66    
67     # -- C - no libraries --
68     CSRCS=
69     COBJS=$(CSRCS:${DIRSRC}%.c=${DIRLIB}%.o)
70    
71     # -- CPP - ROOT libraries --
72     LIBROOTSRCS=
73    
74     LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
75     LIBROOTCLIBS=
76     FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so)
77    
78     # -- CPP - NON-ROOT libraries --
79     LIBCPPSRCS=
80     LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
81     LIBCPPCLIBS=
82     FULLLIBCPPLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so)
83    
84     # -- CPP - Executables --
85 mocchiut 1.4 CXXEXESRCS=${DIRSRC}/DarthVader.cpp \
86     ${DIRSRC}/R2-D2.cpp
87 mocchiut 1.1 CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=${DIRLIB}%.o)
88 mocchiut 1.4 CXXEXELIBS:=DarthVader R2-D2
89 mocchiut 1.1
90     # -- list of tracker objects needed to link
91     #TRKOBJS=${DIRTOP}/../lib2/libTrkLevel2.so ${DIRTOP}/../lib2/libtrack.so
92     #TRKOBJS=$(shell for lib in `ls ${DIRLIB}`; do echo ${lib}; done)
93 mocchiut 1.4 #OBJS=${DIRLIB}/*.*
94     OBJS=$(shell cd ${DIRLIB}&>/dev/null;for file in `ls *.*`; do if [ $${file} != "" ] && [ $${file} != "DarthVader.o" ] && [ $${file} != "R2-D2.o" ]; then echo ${DIRLIB}/$${file}; fi; done)
95 mocchiut 1.1 #TRKOBJS=
96 mocchiut 1.8 DARTHVLIB=${DIRLIB}/libDarthVader_${VER}.so
97 mocchiut 1.1
98     # -- directory where to find tracker headers needed to compile
99     #TRKHEAD=${DIRTOP}/../tracker/inc
100     #TRKHEAD=-I${PAM_INC} -ITrackerLevel2/inc/ -IRunInfo/inc/ -IGLTables/inc/
101    
102     #
103 mocchiut 1.11 SUBDIR=./RunInfo ./S4Level2 ./NDLevel2 ./TrackerLevel2 ./TriggerLevel2 ./ToFLevel2 ./CalorimeterLevel2 ./AnticounterLevel2 ./OrbitalInfo
104 mocchiut 1.1 SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done)
105    
106     # List of all libraries we want to install
107 mocchiut 1.8 FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} ${DARTHVLIB}
108 mocchiut 1.1
109     # Other objects to install
110 mocchiut 1.4 EXESRCS=${DIRBIN}/DarthVader ${DIRBIN}/R2-D2
111 mocchiut 1.1
112     INCSRCS=
113    
114     MACROSSRCS=
115    
116     CALIBFILES=${DIRCALIB}/trk-param ${DIRCALIB}/cal-param ${DIRCALIB}/tof-param
117    
118     DOCFILES=
119    
120     # Here the Variables used for info target
121     PACKAGE=PAMELA analysis flight software
122     EXECUTABLES= ${EXESRCS}
123     LIBS= ${FULLLIBS}
124     DOCS=
125     SRCS=
126     #SRCS= ${FSRCS} ${CRSCS} ${CXXEXESRCS} ${LIBROOTSRCS} ${LIBCPPSRCS}
127     MACROS= ${MACROSSRCS}
128     INCLUDE= ${INCSRCS}
129     #
130     TOBEDEL = junk
131     ROOTINC=$$${shell root-config --incdir}
132     NROOTINC=${shell root-config --incdir}
133     # Directories where you place detectors software
134     #SUBDIR=./GLTables ./RunInfo ./TrackerLevel2 ./CalorimeterLevel2
135    
136     # Let's start
137     #all: test mkbindir mklibdir mkverpath ${FOBJS} ${CPPOBJS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS}
138    
139     all:
140     @for dir in `echo ${SUBDIR}`; do \
141     echo "Making all in $${dir}"; \
142     (cd $${dir} && ${MAKE} all); \
143     done; make locall
144    
145     locall: prepare libs exe
146     locall:
147     @echo -e ${GREEN} ""
148     @(${EGREEN} " Finished, now you can install the package \n (use: make install or make upgrade or make forceinstall) "; ${RESET})
149     @echo -e ${GREEN} ""
150     @${RESET}
151    
152     #subdir:
153     # @for dir in `echo ${SUBDIR}`; do \
154     # echo "Making ${target} in $${dir}"; \
155     # (cd $${dir} && ${MAKE} ${target}); \
156     # done;
157    
158     prepare: test mkbindir mklibdir mkverpath
159    
160     exe: prepare ${CXXEXELIBS}
161    
162     libs: prepare ${LIBROOTLIBS} ${LIBCPPLIBS}
163    
164     # Here some general rules to produce objects in our local dir
165     ${DIRLIB}/%.o: ${DIRSRC}/%.cpp
166     @(${EGREEN} "Creating CPP object file: "${WHITE} "`basename $@`"; ${RESET})
167 mocchiut 1.11 @${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.cpp -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ `root-config --cflags`
168 mocchiut 1.1
169     ${DIRLIB}/%.o: ${DIRSRC}/%.c
170     @(${EGREEN} "Creating C object file: "${WHITE} "`basename $@`"; ${RESET})
171 mocchiut 1.11 @${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.c -I${DIRINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ `root-config --cflags`
172 mocchiut 1.1
173     ${DIRLIB}/%.o: ${DIRSRC}/%.for
174     @(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET})
175     @${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.for -I${DIRINC}
176    
177     ${LIBROOTLIBS}: ${LIBROOTSRCS}
178     @(${EGREEN} "ROOTCINT - creating file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})
179     #
180     # Create *Dict.cpp and *Dict.h
181     #
182 mocchiut 1.11 @${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 mocchiut 1.1 #
184     # create .o
185     #
186     @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})
187 mocchiut 1.11 @cd ${DIRSRC} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _${VER}.so | sed s/lib//`.cpp -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ -I${NROOTINC};
188 mocchiut 1.1 @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})
189 mocchiut 1.11 @cd ${DIRSRC} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ -I${NROOTINC};
190 mocchiut 1.1 #
191     # create .so
192     #
193     @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET})
194 mocchiut 1.11 @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.o 1>/dev/null
195 mocchiut 1.1 @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))
196    
197     ${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS}
198     #
199     # create .o
200     #
201     @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})
202 mocchiut 1.11 @cd ${DIRSRC} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _${VER}.so | sed s/lib//`.cpp -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ -I${NROOTINC};
203 mocchiut 1.1 #
204     # create .so
205     #
206     @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET})
207 mocchiut 1.11 @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${FOBJS} ${COBJS} 1>/dev/null
208 mocchiut 1.1 @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))
209    
210     ${CXXEXELIBS}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS}
211 mocchiut 1.11 @${CXX} ${CXXFLAGS} -Xlinker -soname=libDarthVader_${VER}.so -shared -o ${DIRTOP}/${DIRLIB}/libDarthVader_${VER}.so -lg2c ${DIRTOP}/${DIRLIB}/libAcLevel2.so ${DIRTOP}/${DIRLIB}/libCaloLevel2.so ${DIRTOP}/${DIRLIB}/libNDLevel2.so ${DIRTOP}/${DIRLIB}/libS4Level2.so ${DIRTOP}/${DIRLIB}/libToFLevel2.so ${DIRTOP}/${DIRLIB}/libTrigLevel2.so ${DIRTOP}/${DIRLIB}/libTrkLevel2.so ${PAM_LIB}/libGLTables.so ${DIRTOP}/${DIRLIB}/libRunInfo.so ${DIRTOP}/${DIRLIB}/libOrbitalInfo.so
212 mocchiut 1.1 @(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET})
213 mocchiut 1.11 @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${OBJS} ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` `cernlib mathlib`
214 mocchiut 1.8 # @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${OBJS} ${PAM_YODA}/lib/libyoda.so ${PAM_YODA}/lib/libutils.so -lThread `root-config --cflags --glibs` `cernlib mathlib`
215 mocchiut 1.1
216     # A small target to check environmental variables
217     %_env:
218     @${test_env}
219    
220     .PHONY: install installdoc installlib installmacros installinc installexe installcmacro
221     .PHONY: clean depclean info mkbindir mklibdir testcern testpamenv test
222    
223     mkbindir: ${DIRBIN}
224     ${DIRBIN}:
225     @${test_and_mk}
226    
227     mklibdir: ${DIRLIB}
228     ${DIRLIB}:
229     @${test_and_mk}
230    
231     # Here what has to be deleted in clean target
232     clean:
233     @for dir in `echo ${SUBDIR}`; do \
234     echo "Making clean in $${dir}"; \
235     (cd $${dir} && ${MAKE} clean); \
236     done; make locclean
237    
238     locclean: TOBEDEL= ${DIRSRC}/*.o ${DIRSRC}/*Dict.cpp ${DIRSRC}/*Dict.h ${FOBJS} ${FULLLIBS} ${DIRBIN}/${CXXEXELIBS} ${CPPOBJS} ${CXXEXEOBJS} ${FULLLINKCLIBS} ${FULLMACROCLIBS} ${FULLLINKMACROCLIBS} ${DIRSRC}/DarthVaderVerl2.cpp
239     locclean:
240     @${test_and_rm}
241    
242     distclean:
243     @for dir in `echo ${SUBDIR}`; do \
244     echo "Making distclean in $${dir}"; \
245     (cd $${dir} && ${MAKE} distclean); \
246     done; make locdistclean
247    
248     locdistclean: clean
249     locdistclean: TOBEDEL= ${DIRBIN} ${DIRLIB}
250     locdistclean:
251     @${test_and_rm}
252    
253    
254     forceinstall:
255     @for dir in `echo ${SUBDIR}`; do \
256     echo "Making forceinstall in $${dir}"; \
257     (cd $${dir} && ${MAKE} forceinstall); \
258     done; make locforceinstall
259    
260     locforceinstall: FORCE=-f
261     locforceinstall: install
262    
263     upgrade:
264     @for dir in `echo ${SUBDIR}`; do \
265     echo "Making upgrade in $${dir}"; \
266     (cd $${dir} && ${MAKE} upgrade); \
267     done; make locupgrade
268    
269     locupgrade: FORCE=-u
270     locupgrade: locinstall
271    
272     install:
273     @for dir in `echo ${SUBDIR}`; do \
274     echo "Making install in $${dir}"; \
275     (cd $${dir} && ${MAKE} install); \
276     done; make locinstall
277    
278     locinstall: installlib installinc installmacros installcalib installdoc installexe installcmacro
279    
280     installlib: LINK=y
281     installlib: TOBEMOVED= $(FULLLIBS:${DIRLIB}%=${PAM_LIB}%)
282     installlib: ORIGIN=${DIRLIB}
283     installlib:
284     @${test_and_cp}
285    
286     installcmacro: LINK=y
287     installcmacro: TOBEMOVED= $(FULLMACROCLIBS:${DIRLIB}%=${PAM_LIB}%)
288     installcmacro: ORIGIN=${DIRLIB}
289     installcmacro:
290     @${test_and_cp}
291    
292     installinc: TOBEMOVED= $(INCSRCS:${DIRINC}/%=${PAM_INC}/%)
293     installinc: ORIGIN=${DIRINC}
294     installinc:
295     @${test_and_cp}
296    
297     installexe: TOBEMOVED= $(EXESRCS:${DIRBIN}/%=${PAM_BIN}/%)
298     installexe: ORIGIN=${DIRBIN}
299     installexe:
300     @${test_and_cp}
301    
302     installmacros: TOBEMOVED= $(MACROSSRCS:${DIRMACROS}/%=${PAM_MACROS}/%)
303     installmacros: ORIGIN=${DIRMACROS}
304     installmacros:
305     @${test_and_cp}
306    
307     installcalib: TOBEMOVED= $(CALIBFILES:${DIRCALIB}/%=${PAM_CALIB}/%)
308     installcalib: ORIGIN=${DIRCALIB}
309     installcalib:
310     @${cp_dir}
311    
312     installdoc: TOBEMOVED= $(DOCFILES:${DIRDOC}/%=${PAM_DOC}/%)
313     installdoc: ORIGIN=${DIRDOC}
314     installdoc:
315     @${test_and_cp}
316    
317     mkverpath:
318     @echo '#include <TSystem.h>' > ${DIRTOP}/${DIRSRC}/DarthVaderVerl2.cpp; echo ' char *DarthVaderInfo(bool print){ if ( print ) printf("\nPAMELA Level2 flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> ${DIRTOP}/${DIRSRC}/DarthVaderVerl2.cpp
319     @sleep 0.8
320    
321    
322    
323     info:
324     @echo " "
325     @${EGREEN} "Infos for package :" ${WHITE} ${PACKAGE}
326     @${EGREEN} " VERSION :" ${WHITE} ${VER}
327     @${EGREEN} " EXECUTABLES :" ${WHITE} ${EXECUTABLES}
328     @${EGREEN} " LIBS :" ${WHITE} ${LIBS}
329     @${EGREEN} " DOCS :" ${WHITE} ${DOCS}
330     @${EGREEN} " SRCS :" ${WHITE} ${SRCS}
331     @${EGREEN} " MACROS :" ${WHITE} ${MACROS}
332     @${EGREEN} " INCLUDE :" ${WHITE} ${INCLUDE}
333     @echo " "
334     @${RESET}
335    
336     test: testpamenv
337    
338     testpamenv: ${PAM_ENV}
339    
340     root-config: OPT=--cflags
341     root-config:
342     @${test_cmd}
343    
344     # Here follows some usefull macros
345     define test_and_cp
346     wd=`pwd`;\
347     for i in ${TOBEMOVED} ; do \
348     wv=$${i##/*/}; \
349     dest=$${i/$${wv}/}; \
350     ${EGREEN} "Testing for :" ${WHITE} "$${i}" ; ${RESET}; \
351     if [ ! "${FORCE}" ] ; then \
352     if [ ! -f $${i} ]; then \
353     ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\
354     ${EGREEN} " to: "${WHITE} $${i} ; ${RESET}; \
355     cp ${ORIGIN}/$${i##/*/} $${i}; \
356     else \
357     ${ERED} "File already exist !!!! Please delete it " ${WHITE}; ${RESET}; \
358     fi;\
359     else \
360     if [ "${FORCE}" == "-u" ] ; then \
361     if [ "`basename $${i}`" != "`basename $${i} _${VER}.so`" ]; then \
362     ${EYELLOW} "Removing: "${WHITE} ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so; ${RESET}; \
363     rm -f ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so ; \
364     ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\
365     ${EGREEN} " to: "${WHITE} $${i} ; ${RESET}; \
366     cp ${ORIGIN}/$${i##/*/} $${i}; \
367     else \
368     ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
369     ${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \
370     cp -f ${ORIGIN}/$${i##/*/} $${i}; \
371     fi; \
372     else \
373     ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
374     ${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \
375     cp ${FORCE} ${ORIGIN}/$${i##/*/} $${i}; \
376     fi;\
377     fi ;\
378     if [ ! -z ${LINK} ] ; then \
379     ${EGREEN} "Creating symlink from : "${WHITE} $${wv/_${VER}/} ;\
380     ${EGREEN} " to : "${WHITE} $${i##/*/} ; ${RESET}; \
381     cd $${dest}; \
382     ln -sf $${wv} $${wv/_${VER}/}; \
383     cd $${wd}; \
384     fi \
385     done
386     endef
387    
388     define cp_dir
389     wd=`pwd`;\
390     for i in ${TOBEMOVED} ; do \
391     wv=$${i##/*/}; \
392     dest=$${i/$${wv}/}; \
393     ${EYELLOW} " Copying directory: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
394 mocchiut 1.3 ${EYELLOW} " to: "${WHITE} ${PAM_CALIB} ; ${RESET}; \
395     cp -rf ${ORIGIN}/$${i##/*/} ${PAM_CALIB}; \
396 mocchiut 1.1 done
397     endef
398    
399     define test_and_mk
400     ${EGREEN} "Testing for :" ${WHITE} "$@"; ${RESET}
401     test -d "$@" || \
402     (${EGREEN} "Creating : "${WHITE} "$@"; ${RESET}; mkdir -p $@)
403     endef
404    
405     define test_env
406     ${EGREEN} "Testing for env:" ${WHITE} $(patsubst %_env,%,$@); ${RESET}
407     printenv $(patsubst %_env,%,$@) 1>/dev/null || \
408     (${ERED} "ERROR, variable : "${WHITE} $(patsubst %_env,%,$@) \
409     ${RED} "not defined !!! Check your env. settings"; \
410     ${RESET}; exit 1)
411     ${EGREEN} " Defined:" ${WHITE} $${$(patsubst %_env,%,$@)}; ${RESET}
412     endef
413    
414     define test_cmd
415     ${EGREEN} "Testing for cmd:" ${WHITE} $@ ${OPT}; ${RESET}
416     $@ ${OPT} 1>/dev/null 2>&1 || \
417     (${ERED} "ERROR, command : "${WHITE} $@ ${OPT}\
418     ${RED} "not found !!! Check your installation"; \
419     ${RESET}; exit 1)
420     ${EGREEN} " Present:" ${WHITE} $@ ${OPT}; ${RESET}
421     endef
422    
423     define test_and_rm
424     for i in ${TOBEDEL}; do \
425     test -d $${i} || (${ERED} "Removing file :"${WHITE} $${i}; ${RESET}; \
426     rm -f $${i} ); \
427     test ! -d $${i} || (${ERED} "Removing dir :"${WHITE} $${i}; ${RESET}; \
428     rm -rf $${i} ); \
429     done
430     endef

  ViewVC Help
Powered by ViewVC 1.1.23