/[PAMELA software]/DarthVader/Makefile
ViewVC logotype

Annotation of /DarthVader/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.46 - (hide annotations) (download)
Tue Feb 3 10:31:50 2009 UTC (15 years, 10 months ago) by mocchiut
Branch: MAIN
CVS Tags: v6r01
Changes since 1.45: +1 -1 lines
Version v6r01 - ROOT 5.20.00 TRef compatible

1 mocchiut 1.1 # DarthVader flight analysis software
2 mocchiut 1.15 # SOFTWARE VERSION IS
3 mocchiut 1.46 VER= v6r01
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 mocchiut 1.41 #CFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT}
29 mocchiut 1.44 CFLAGS=-Wall -O3 -funroll-loops -fPIC -pthread ${PAM_BIT}
30 mocchiut 1.1 # Enviroment:
31     GCCVER=`gcc --version | head -1`
32     UNAMEA=`uname -a`
33     TODAY=`date`
34     # F77
35     F77=g77
36 mocchiut 1.41 #F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash ${PAM_BIT}
37 mocchiut 1.44 F77FLAGS= -Wall -funroll-loops -Wno-globals -fPIC -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT}
38 mocchiut 1.1 # C++
39     CXX=g++
40 mocchiut 1.41 #CXXFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT}
41 mocchiut 1.44 CXXFLAGS=-Wall -O3 -funroll-loops -fPIC -pthread ${PAM_BIT}
42 mocchiut 1.1 # ROOTCINT
43     ROOTCINT=rootcint
44 mocchiut 1.21 #CERNLIB
45     CERNLIB=./docs/cernlib_pam
46     #CERNLIB=cernlib
47    
48 mocchiut 1.1 # Here the variables definig the local directories
49     DIRTOP=${shell pwd}
50     #DIRLIB=../lib/${ARCH}
51     #DIRBIN=../bin/${ARCH}
52     DIRLIB=lib/${ARCH}
53     DIRBIN=bin/${ARCH}
54     DIRSRC=src
55     DIRINC=inc
56     DIRDOC=doc
57     DIRMACROS=macros
58     DIRCALIB=param
59     # Here the PAMELA environmental variables to be checked
60     PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env PAM_CALIB_env PAM_YODA_env
61    
62     # Here the local variables used to build the targets
63     # -- F77 - no libraries --
64     FSRCS=
65     FOBJS=$(FSRCS:${DIRSRC}%.for=${DIRLIB}%.o)
66    
67     # -- CPP - no libraries --
68     CPPSRCS=${DIRSRC}/DarthVaderVerl2.cpp
69     CPPOBJS=$(CPPSRCS:${DIRSRC}%.cpp=${DIRLIB}%.o)
70    
71     # -- C - no libraries --
72     CSRCS=
73     COBJS=$(CSRCS:${DIRSRC}%.c=${DIRLIB}%.o)
74    
75     # -- CPP - ROOT libraries --
76     LIBROOTSRCS=
77    
78     LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
79     LIBROOTCLIBS=
80     FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so)
81    
82     # -- CPP - NON-ROOT libraries --
83     LIBCPPSRCS=
84     LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
85     LIBCPPCLIBS=
86     FULLLIBCPPLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so)
87    
88     # -- CPP - Executables --
89 mocchiut 1.18 CXXEXESRCS=${DIRSRC}/DarthVader.cpp
90 mocchiut 1.1 CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=${DIRLIB}%.o)
91 mocchiut 1.18 CXXEXELIBS:=DarthVader
92 mocchiut 1.1
93 mocchiut 1.19 # -- list of objects needed to link
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     OBJS=$(shell cd ${DIRLIB}&>/dev/null;for file in `ls lib*.so`; do if [ $${file} != "" ]; then echo ${DIRLIB}/$${file}; fi; done) ${CPPOBJS}
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.18 EXESRCS=${DIRBIN}/DarthVader
111 mocchiut 1.1
112     INCSRCS=
113    
114     MACROSSRCS=
115    
116 mocchiut 1.27 CALIBFILES=${DIRCALIB}/trk-param ${DIRCALIB}/cal-param ${DIRCALIB}/tof-param ${DIRCALIB}/orb-param
117 mocchiut 1.1
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.19 @(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET})
212 mocchiut 1.21 @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${OBJS} ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libsgp4.so ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` `${CERNLIB} mathlib`
213 mocchiut 1.43 @(${EGREEN} "Creating libDarthVader.so library: "${WHITE} "libDarthVader_${VER}.so"; ${RESET})
214     @${CXX} ${CXXFLAGS} -Xlinker -soname=libDarthVader_${VER}.so -shared -o ${DIRTOP}/${DIRLIB}/libDarthVader_${VER}.so -lg2c ${DIRTOP}/${DIRLIB}/libAcLevel2.so ${DIRTOP}/${DIRLIB}/libCaloLevel0.so ${DIRTOP}/${DIRLIB}/libCaloLevel1.so ${DIRTOP}/${DIRLIB}/libCaloLevel2.so ${PAM_LIB}/libsgp4.so ${DIRTOP}/${DIRLIB}/libNDLevel2.so ${DIRTOP}/${DIRLIB}/libS4Level2.so ${DIRTOP}/${DIRLIB}/libToFLevel2.so ${DIRTOP}/${DIRLIB}/libTrigLevel2.so ${DIRTOP}/${DIRLIB}/libTrkLevel2.so ${DIRTOP}/${DIRLIB}/libTrkLevel1.so ${DIRTOP}/${DIRLIB}/libTrkLevel0.so ${DIRTOP}/${DIRLIB}/libTrkHough.so ${DIRTOP}/${DIRLIB}/libTrkCalib.so ${DIRTOP}/${DIRLIB}/libTrkParams.so ${PAM_LIB}/libGLTables.so ${DIRTOP}/${DIRLIB}/libRunInfo.so ${DIRTOP}/${DIRLIB}/libOrbitalInfo.so ${DIRTOP}/${DIRLIB}/libOrientationInfo.so ${DIRTOP}/${DIRLIB}/libInclinationInfo.so `root-config --glibs` `${CERNLIB} mathlib`
215 pam-fi 1.23
216 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`
217 mocchiut 1.1
218     # A small target to check environmental variables
219     %_env:
220     @${test_env}
221    
222     .PHONY: install installdoc installlib installmacros installinc installexe installcmacro
223     .PHONY: clean depclean info mkbindir mklibdir testcern testpamenv test
224    
225     mkbindir: ${DIRBIN}
226     ${DIRBIN}:
227     @${test_and_mk}
228    
229     mklibdir: ${DIRLIB}
230     ${DIRLIB}:
231     @${test_and_mk}
232    
233     # Here what has to be deleted in clean target
234     clean:
235     @for dir in `echo ${SUBDIR}`; do \
236     echo "Making clean in $${dir}"; \
237     (cd $${dir} && ${MAKE} clean); \
238     done; make locclean
239    
240     locclean: TOBEDEL= ${DIRSRC}/*.o ${DIRSRC}/*Dict.cpp ${DIRSRC}/*Dict.h ${FOBJS} ${FULLLIBS} ${DIRBIN}/${CXXEXELIBS} ${CPPOBJS} ${CXXEXEOBJS} ${FULLLINKCLIBS} ${FULLMACROCLIBS} ${FULLLINKMACROCLIBS} ${DIRSRC}/DarthVaderVerl2.cpp
241     locclean:
242     @${test_and_rm}
243    
244     distclean:
245     @for dir in `echo ${SUBDIR}`; do \
246     echo "Making distclean in $${dir}"; \
247     (cd $${dir} && ${MAKE} distclean); \
248     done; make locdistclean
249    
250     locdistclean: clean
251     locdistclean: TOBEDEL= ${DIRBIN} ${DIRLIB}
252     locdistclean:
253     @${test_and_rm}
254    
255    
256     forceinstall:
257     @for dir in `echo ${SUBDIR}`; do \
258     echo "Making forceinstall in $${dir}"; \
259     (cd $${dir} && ${MAKE} forceinstall); \
260     done; make locforceinstall
261    
262     locforceinstall: FORCE=-f
263     locforceinstall: install
264    
265     upgrade:
266     @for dir in `echo ${SUBDIR}`; do \
267     echo "Making upgrade in $${dir}"; \
268     (cd $${dir} && ${MAKE} upgrade); \
269     done; make locupgrade
270    
271     locupgrade: FORCE=-u
272     locupgrade: locinstall
273    
274 mocchiut 1.22 upgradenc:
275     @for dir in `echo ${SUBDIR}`; do \
276     echo "Making upgrade in $${dir}"; \
277     (cd $${dir} && ${MAKE} upgrade); \
278     done; make locupgradenc
279    
280     locupgradenc: FORCE=-u
281     locupgradenc: locinstallnc
282    
283 mocchiut 1.1 install:
284     @for dir in `echo ${SUBDIR}`; do \
285     echo "Making install in $${dir}"; \
286     (cd $${dir} && ${MAKE} install); \
287     done; make locinstall
288    
289     locinstall: installlib installinc installmacros installcalib installdoc installexe installcmacro
290    
291 mocchiut 1.22 locinstallnc: installlib installinc installmacros installdoc installexe installcmacro
292    
293 mocchiut 1.1 installlib: LINK=y
294     installlib: TOBEMOVED= $(FULLLIBS:${DIRLIB}%=${PAM_LIB}%)
295     installlib: ORIGIN=${DIRLIB}
296     installlib:
297     @${test_and_cp}
298    
299     installcmacro: LINK=y
300     installcmacro: TOBEMOVED= $(FULLMACROCLIBS:${DIRLIB}%=${PAM_LIB}%)
301     installcmacro: ORIGIN=${DIRLIB}
302     installcmacro:
303     @${test_and_cp}
304    
305     installinc: TOBEMOVED= $(INCSRCS:${DIRINC}/%=${PAM_INC}/%)
306     installinc: ORIGIN=${DIRINC}
307     installinc:
308     @${test_and_cp}
309    
310     installexe: TOBEMOVED= $(EXESRCS:${DIRBIN}/%=${PAM_BIN}/%)
311     installexe: ORIGIN=${DIRBIN}
312     installexe:
313     @${test_and_cp}
314    
315     installmacros: TOBEMOVED= $(MACROSSRCS:${DIRMACROS}/%=${PAM_MACROS}/%)
316     installmacros: ORIGIN=${DIRMACROS}
317     installmacros:
318     @${test_and_cp}
319    
320     installcalib: TOBEMOVED= $(CALIBFILES:${DIRCALIB}/%=${PAM_CALIB}/%)
321     installcalib: ORIGIN=${DIRCALIB}
322     installcalib:
323     @${cp_dir}
324    
325     installdoc: TOBEMOVED= $(DOCFILES:${DIRDOC}/%=${PAM_DOC}/%)
326     installdoc: ORIGIN=${DIRDOC}
327     installdoc:
328     @${test_and_cp}
329    
330     mkverpath:
331     @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
332     @sleep 0.8
333    
334    
335    
336     info:
337     @echo " "
338     @${EGREEN} "Infos for package :" ${WHITE} ${PACKAGE}
339     @${EGREEN} " VERSION :" ${WHITE} ${VER}
340     @${EGREEN} " EXECUTABLES :" ${WHITE} ${EXECUTABLES}
341     @${EGREEN} " LIBS :" ${WHITE} ${LIBS}
342     @${EGREEN} " DOCS :" ${WHITE} ${DOCS}
343     @${EGREEN} " SRCS :" ${WHITE} ${SRCS}
344     @${EGREEN} " MACROS :" ${WHITE} ${MACROS}
345     @${EGREEN} " INCLUDE :" ${WHITE} ${INCLUDE}
346     @echo " "
347     @${RESET}
348    
349     test: testpamenv
350    
351     testpamenv: ${PAM_ENV}
352    
353     root-config: OPT=--cflags
354     root-config:
355     @${test_cmd}
356    
357     # Here follows some usefull macros
358     define test_and_cp
359     wd=`pwd`;\
360     for i in ${TOBEMOVED} ; do \
361     wv=$${i##/*/}; \
362     dest=$${i/$${wv}/}; \
363     ${EGREEN} "Testing for :" ${WHITE} "$${i}" ; ${RESET}; \
364     if [ ! "${FORCE}" ] ; then \
365     if [ ! -f $${i} ]; then \
366     ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\
367     ${EGREEN} " to: "${WHITE} $${i} ; ${RESET}; \
368     cp ${ORIGIN}/$${i##/*/} $${i}; \
369     else \
370     ${ERED} "File already exist !!!! Please delete it " ${WHITE}; ${RESET}; \
371     fi;\
372     else \
373     if [ "${FORCE}" == "-u" ] ; then \
374     if [ "`basename $${i}`" != "`basename $${i} _${VER}.so`" ]; then \
375     ${EYELLOW} "Removing: "${WHITE} ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so; ${RESET}; \
376     rm -f ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so ; \
377     ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\
378     ${EGREEN} " to: "${WHITE} $${i} ; ${RESET}; \
379     cp ${ORIGIN}/$${i##/*/} $${i}; \
380     else \
381     ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
382     ${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \
383     cp -f ${ORIGIN}/$${i##/*/} $${i}; \
384     fi; \
385     else \
386     ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
387     ${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \
388     cp ${FORCE} ${ORIGIN}/$${i##/*/} $${i}; \
389     fi;\
390     fi ;\
391     if [ ! -z ${LINK} ] ; then \
392     ${EGREEN} "Creating symlink from : "${WHITE} $${wv/_${VER}/} ;\
393     ${EGREEN} " to : "${WHITE} $${i##/*/} ; ${RESET}; \
394     cd $${dest}; \
395     ln -sf $${wv} $${wv/_${VER}/}; \
396     cd $${wd}; \
397     fi \
398     done
399     endef
400    
401     define cp_dir
402     wd=`pwd`;\
403     for i in ${TOBEMOVED} ; do \
404     wv=$${i##/*/}; \
405     dest=$${i/$${wv}/}; \
406     ${EYELLOW} " Copying directory: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
407 mocchiut 1.3 ${EYELLOW} " to: "${WHITE} ${PAM_CALIB} ; ${RESET}; \
408     cp -rf ${ORIGIN}/$${i##/*/} ${PAM_CALIB}; \
409 mocchiut 1.1 done
410     endef
411    
412     define test_and_mk
413     ${EGREEN} "Testing for :" ${WHITE} "$@"; ${RESET}
414     test -d "$@" || \
415     (${EGREEN} "Creating : "${WHITE} "$@"; ${RESET}; mkdir -p $@)
416     endef
417    
418     define test_env
419     ${EGREEN} "Testing for env:" ${WHITE} $(patsubst %_env,%,$@); ${RESET}
420     printenv $(patsubst %_env,%,$@) 1>/dev/null || \
421     (${ERED} "ERROR, variable : "${WHITE} $(patsubst %_env,%,$@) \
422     ${RED} "not defined !!! Check your env. settings"; \
423     ${RESET}; exit 1)
424     ${EGREEN} " Defined:" ${WHITE} $${$(patsubst %_env,%,$@)}; ${RESET}
425     endef
426    
427     define test_cmd
428     ${EGREEN} "Testing for cmd:" ${WHITE} $@ ${OPT}; ${RESET}
429     $@ ${OPT} 1>/dev/null 2>&1 || \
430     (${ERED} "ERROR, command : "${WHITE} $@ ${OPT}\
431     ${RED} "not found !!! Check your installation"; \
432     ${RESET}; exit 1)
433     ${EGREEN} " Present:" ${WHITE} $@ ${OPT}; ${RESET}
434     endef
435    
436     define test_and_rm
437     for i in ${TOBEDEL}; do \
438     test -d $${i} || (${ERED} "Removing file :"${WHITE} $${i}; ${RESET}; \
439     rm -f $${i} ); \
440     test ! -d $${i} || (${ERED} "Removing dir :"${WHITE} $${i}; ${RESET}; \
441     rm -rf $${i} ); \
442     done
443     endef

  ViewVC Help
Powered by ViewVC 1.1.23