/[PAMELA software]/eventviewer/flight/Makefile
ViewVC logotype

Annotation of /eventviewer/flight/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Tue Nov 28 14:05:50 2006 UTC (18 years ago) by mocchiut
Branch: MAIN
Changes since 1.6: +5 -3 lines
Adapted to latest snapshot of DV/PamLevel2 software

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

  ViewVC Help
Powered by ViewVC 1.1.23