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

Annotation of /eventviewer/flight/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (hide annotations) (download)
Wed Apr 11 13:28:39 2007 UTC (17 years, 7 months ago) by mocchiut
Branch: MAIN
CVS Tags: v2r01
Changes since 1.9: +6 -2 lines
Small update

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 mocchiut 1.9 LIBCPPSRCS=${DIRSRC}/color.cpp \
77     ${DIRSRC}/FEVdetector.cpp
78 mocchiut 1.4 LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
79 mocchiut 1.9 LIBCPPCLIBS=libcolor libFEVdetector
80 mocchiut 1.4 FULLLIBCPPLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so)
81    
82     # -- CPP - Executables --
83     CXXEXESRCS=${DIRSRC}/FEventViewer.cpp
84     CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=${DIRLIB}%.o)
85 mocchiut 1.1 CXXEXELIBS:=FEventViewer
86    
87 mocchiut 1.10 NUCLEI=${PAM_LIB}/libCaloNuclei.so
88    
89 mocchiut 1.4 # -- list of tracker objects needed to link
90 mocchiut 1.10 TRKOBJS=${PAM_LIB}/libDarthVader.so ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libsgp4.so
91 mocchiut 1.7 #${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
92 mocchiut 1.4 # -- directory where to find tracker headers needed to compile
93     SUBDIR=
94     SUBINC=-I${PAM_INC}
95     #SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done)
96    
97     # List of all libraries we want to install
98     FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPPLIBS}
99 mocchiut 1.1
100 mocchiut 1.4 # Other objects to install
101     EXESRCS=${DIRBIN}/FEventViewer
102 mocchiut 1.1
103 mocchiut 1.9 INCSRCS=${DIRINC}/FEventViewer.h ${DIRINC}/FEVpamevcontrol.h ${DIRINC}/FEVpathtoc.h ${DIRINC}/feventvstruct.h ${DIRINC}/color.h
104 mocchiut 1.1
105 mocchiut 1.4 MACROSSRCS=
106 mocchiut 1.1
107     CALIBFILES=
108    
109 mocchiut 1.4 DOCFILES=
110 mocchiut 1.1
111     # Here the Variables used for info target
112 mocchiut 1.4 PACKAGE=
113     EXECUTABLES= ${EXESRCS}
114     LIBS= ${FULLLIBS}
115 mocchiut 1.1 DOCS=
116 mocchiut 1.4 SRCS=
117     #SRCS= ${FSRCS} ${CRSCS} ${CXXEXESRCS} ${LIBROOTSRCS} ${LIBCPPSRCS}
118 mocchiut 1.1 MACROS= ${MACROSSRCS}
119 mocchiut 1.4 INCLUDE= ${INCSRCS}
120 mocchiut 1.1 #
121     TOBEDEL = junk
122     ROOTINC=$$${shell root-config --incdir}
123     NROOTINC=${shell root-config --incdir}
124     # Let's start
125 mocchiut 1.4 #all: test mkbindir mklibdir mkverpath ${FOBJS} ${CPPOBJS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS}
126     all: prepare libs exe
127 mocchiut 1.1 all:
128     @echo -e ${GREEN} ""
129     @(${EGREEN} " Finished, now you can install the package \n (use: make install or make upgrade or make forceinstall) "; ${RESET})
130     @echo -e ${GREEN} ""
131     @${RESET}
132    
133 mocchiut 1.4 prepare: test mkbindir mklibdir mkverpath mkpathtoc
134    
135     exe: prepare ${CXXEXELIBS}
136    
137     libs: prepare ${LIBROOTLIBS} ${LIBCPPLIBS}
138    
139 mocchiut 1.1 # Here some general rules to produce objects in our local dir
140 mocchiut 1.4 ${DIRLIB}/%.o: ${DIRSRC}/%.cpp
141     @(${EGREEN} "Creating CPP object file: "${WHITE} "`basename $@`"; ${RESET})
142     @${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.cpp -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ `root-config --cflags`
143    
144     ${DIRLIB}/%.o: ${DIRSRC}/%.c
145     @(${EGREEN} "Creating C object file: "${WHITE} "`basename $@`"; ${RESET})
146     @${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.c -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ `root-config --cflags`
147    
148     ${DIRLIB}/%.o: ${DIRSRC}/%.for
149     @(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET})
150     @${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.for -I${DIRINC}
151 mocchiut 1.1
152 mocchiut 1.4 ${LIBROOTLIBS}: ${LIBROOTSRCS}
153     @(${EGREEN} "ROOTCINT - creating file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})
154 mocchiut 1.1 #
155 mocchiut 1.4 # Create *Dict.cpp and *Dict.h
156 mocchiut 1.1 #
157 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
158 mocchiut 1.1 #
159     # create .o
160     #
161 mocchiut 1.4 @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})
162     @${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};
163     @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})
164     @${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};
165 mocchiut 1.1 #
166     # create .so
167     #
168 mocchiut 1.4 @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET})
169     @${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
170     @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))
171    
172 mocchiut 1.9 ${LIBCPPLIBS}: ${LIBCPPSRCS} ${LIBSRCS} ${COBJS} ${FOBJS}
173 mocchiut 1.4 #
174     # create .o
175     #
176     @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})
177     @${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};
178     #
179     # create .so
180 mocchiut 1.1 #
181 mocchiut 1.4 @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET})
182     @${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
183     @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))
184 mocchiut 1.1
185 mocchiut 1.9 ${CXXEXELIBS}: ${LIBROOTSRCS} ${CPPOBJS} ${COBJS} ${CXXEXEOBJS}
186 mocchiut 1.1 @(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET})
187 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`
188 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`
189 mocchiut 1.10 # echo 'nuclei is ${NUCLEI}'
190     @if [ -f ${NUCLEI} ]; then ${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRLIB}/$@.o ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} ${TRKOBJS} ${NUCLEI} ${CPPOBJS} ${COBJS} ${FOBJS} ${PAM_YODA}/lib/libyoda.so ${PAM_LIB}/libPamLevel2.so -lThread `root-config --cflags --glibs` `doc/cernlib_pam mathlib`; else ${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` `doc/cernlib_pam mathlib`; fi
191 mocchiut 1.1
192     # A small target to check environmental variables
193     %_env:
194     @${test_env}
195    
196 mocchiut 1.4 .PHONY: install installdoc installlib installmacros installinc installexe installcmacro
197     .PHONY: clean depclean info mkbindir mklibdir testcern testpamenv test
198 mocchiut 1.1
199     mkbindir: ${DIRBIN}
200     ${DIRBIN}:
201     @${test_and_mk}
202    
203     mklibdir: ${DIRLIB}
204     ${DIRLIB}:
205     @${test_and_mk}
206    
207     # Here what has to be deleted in clean target
208 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
209 mocchiut 1.1 clean:
210     @${test_and_rm}
211    
212     distclean: clean
213     distclean: TOBEDEL= ${DIRBIN} ${DIRLIB}
214     distclean:
215     @${test_and_rm}
216    
217     forceinstall: FORCE=-f
218     forceinstall: install
219    
220     upgrade: FORCE=-u
221     upgrade: install
222    
223 mocchiut 1.4 install: installlib installinc installmacros installcalib installdoc installcmacro installexe
224 mocchiut 1.1
225     installlib: LINK=y
226     installlib: TOBEMOVED= $(FULLLIBS:${DIRLIB}%=${PAM_LIB}%)
227     installlib: ORIGIN=${DIRLIB}
228     installlib:
229     @${test_and_cp}
230    
231     installcmacro: LINK=y
232     installcmacro: TOBEMOVED= $(FULLMACROCLIBS:${DIRLIB}%=${PAM_LIB}%)
233     installcmacro: ORIGIN=${DIRLIB}
234     installcmacro:
235     @${test_and_cp}
236    
237     installinc: TOBEMOVED= $(INCSRCS:${DIRINC}/%=${PAM_INC}/%)
238     installinc: ORIGIN=${DIRINC}
239     installinc:
240     @${test_and_cp}
241    
242     installexe: TOBEMOVED= $(EXESRCS:${DIRBIN}/%=${PAM_BIN}/%)
243     installexe: ORIGIN=${DIRBIN}
244     installexe:
245     @${test_and_cp}
246    
247     installmacros: TOBEMOVED= $(MACROSSRCS:${DIRMACROS}/%=${PAM_MACROS}/%)
248     installmacros: ORIGIN=${DIRMACROS}
249     installmacros:
250     @${test_and_cp}
251    
252     installcalib: TOBEMOVED= $(CALIBFILES:${DIRCALIB}/%=${PAM_CALIB}/%)
253     installcalib: ORIGIN=${DIRCALIB}
254     installcalib:
255     @${test_and_cp}
256    
257     installdoc: TOBEMOVED= $(DOCFILES:${DIRDOC}/%=${PAM_DOC}/%)
258     installdoc: ORIGIN=${DIRDOC}
259     installdoc:
260     @${test_and_cp}
261    
262 mocchiut 1.4 mkverpath:
263     @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
264     @sleep 0.8
265    
266     mkpathtoc:
267     @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
268     @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
269     @sleep 0.5
270    
271    
272    
273    
274    
275 mocchiut 1.1 info:
276     @echo " "
277     @${EGREEN} "Infos for package :" ${WHITE} ${PACKAGE}
278     @${EGREEN} " VERSION :" ${WHITE} ${VER}
279     @${EGREEN} " EXECUTABLES :" ${WHITE} ${EXECUTABLES}
280     @${EGREEN} " LIBS :" ${WHITE} ${LIBS}
281     @${EGREEN} " DOCS :" ${WHITE} ${DOCS}
282     @${EGREEN} " SRCS :" ${WHITE} ${SRCS}
283     @${EGREEN} " MACROS :" ${WHITE} ${MACROS}
284 mocchiut 1.4 @${EGREEN} " INCLUDE :" ${WHITE} ${INCLUDE}
285 mocchiut 1.1 @echo " "
286     @${RESET}
287    
288     test: testpamenv
289    
290     testpamenv: ${PAM_ENV}
291    
292 mocchiut 1.10
293 mocchiut 1.1 root-config: OPT=--cflags
294     root-config:
295     @${test_cmd}
296    
297     # Here follows some usefull macros
298     define test_and_cp
299     wd=`pwd`;\
300     for i in ${TOBEMOVED} ; do \
301     wv=$${i##/*/}; \
302     dest=$${i/$${wv}/}; \
303     ${EGREEN} "Testing for :" ${WHITE} "$${i}" ; ${RESET}; \
304     if [ ! "${FORCE}" ] ; then \
305     if [ ! -f $${i} ]; then \
306     ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\
307     ${EGREEN} " to: "${WHITE} $${i} ; ${RESET}; \
308     cp ${ORIGIN}/$${i##/*/} $${i}; \
309     else \
310     ${ERED} "File already exist !!!! Please delete it " ${WHITE}; ${RESET}; \
311     fi;\
312     else \
313     if [ "${FORCE}" == "-u" ] ; then \
314     if [ "`basename $${i}`" != "`basename $${i} _${VER}.so`" ]; then \
315     ${EYELLOW} "Removing: "${WHITE} ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so; ${RESET}; \
316     rm -f ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so ; \
317     ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\
318     ${EGREEN} " to: "${WHITE} $${i} ; ${RESET}; \
319     cp ${ORIGIN}/$${i##/*/} $${i}; \
320     else \
321     ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
322     ${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \
323     cp -f ${ORIGIN}/$${i##/*/} $${i}; \
324     fi; \
325     else \
326     ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
327     ${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \
328     cp ${FORCE} ${ORIGIN}/$${i##/*/} $${i}; \
329     fi;\
330     fi ;\
331     if [ ! -z ${LINK} ] ; then \
332     ${EGREEN} "Creating symlink from : "${WHITE} $${wv/_${VER}/} ;\
333     ${EGREEN} " to : "${WHITE} $${i##/*/} ; ${RESET}; \
334     cd $${dest}; \
335     ln -sf $${wv} $${wv/_${VER}/}; \
336     cd $${wd}; \
337     fi \
338     done
339     endef
340    
341     define test_and_mk
342     ${EGREEN} "Testing for :" ${WHITE} "$@"; ${RESET}
343     test -d "$@" || \
344     (${EGREEN} "Creating : "${WHITE} "$@"; ${RESET}; mkdir -p $@)
345     endef
346    
347     define test_env
348     ${EGREEN} "Testing for env:" ${WHITE} $(patsubst %_env,%,$@); ${RESET}
349     printenv $(patsubst %_env,%,$@) 1>/dev/null || \
350     (${ERED} "ERROR, variable : "${WHITE} $(patsubst %_env,%,$@) \
351     ${RED} "not defined !!! Check your env. settings"; \
352     ${RESET}; exit 1)
353     ${EGREEN} " Defined:" ${WHITE} $${$(patsubst %_env,%,$@)}; ${RESET}
354     endef
355    
356     define test_cmd
357     ${EGREEN} "Testing for cmd:" ${WHITE} $@ ${OPT}; ${RESET}
358     $@ ${OPT} 1>/dev/null 2>&1 || \
359     (${ERED} "ERROR, command : "${WHITE} $@ ${OPT}\
360     ${RED} "not found !!! Check your installation"; \
361     ${RESET}; exit 1)
362     ${EGREEN} " Present:" ${WHITE} $@ ${OPT}; ${RESET}
363     endef
364    
365     define test_and_rm
366     for i in ${TOBEDEL}; do \
367     test -d $${i} || (${ERED} "Removing file :"${WHITE} $${i}; ${RESET}; \
368     rm -f $${i} ); \
369     test ! -d $${i} || (${ERED} "Removing dir :"${WHITE} $${i}; ${RESET}; \
370     rm -rf $${i} ); \
371     done
372     endef

  ViewVC Help
Powered by ViewVC 1.1.23