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

Annotation of /DarthVader/TrackerLevel2/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Wed Oct 11 06:53:01 2006 UTC (18 years, 2 months ago) by pam-fi
Branch: MAIN
Changes since 1.6: +1 -1 lines
some new methods

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

  ViewVC Help
Powered by ViewVC 1.1.23