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

Annotation of /eventviewer/flight/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.17 - (hide annotations) (download)
Tue Aug 4 13:58:35 2009 UTC (15 years, 3 months ago) by mocchiut
Branch: MAIN
Changes since 1.16: +16 -4 lines
Changed to work with GCC 4.x (gfortran) + ROOT >= 5.24

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

  ViewVC Help
Powered by ViewVC 1.1.23