/[PAMELA software]/DarthVader/Makefile
ViewVC logotype

Annotation of /DarthVader/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.47 - (hide annotations) (download)
Tue Aug 4 14:01:14 2009 UTC (15 years, 3 months ago) by mocchiut
Branch: MAIN
Changes since 1.46: +25 -62 lines
Changed to work with GCC 4.x (gfortran) + ROOT >= 5.24

1 mocchiut 1.1 # DarthVader flight analysis software
2 mocchiut 1.15 # SOFTWARE VERSION IS
3 mocchiut 1.46 VER= v6r01
4 mocchiut 1.47 #
5     include Make.def
6 mocchiut 1.21 #CERNLIB
7     CERNLIB=./docs/cernlib_pam
8     #CERNLIB=cernlib
9    
10 mocchiut 1.1 # Here the variables definig the local directories
11     DIRTOP=${shell pwd}
12     #DIRLIB=../lib/${ARCH}
13     #DIRBIN=../bin/${ARCH}
14     DIRLIB=lib/${ARCH}
15     DIRBIN=bin/${ARCH}
16     DIRSRC=src
17     DIRINC=inc
18     DIRDOC=doc
19     DIRMACROS=macros
20     DIRCALIB=param
21     # Here the PAMELA environmental variables to be checked
22     PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env PAM_CALIB_env PAM_YODA_env
23    
24     # Here the local variables used to build the targets
25     # -- F77 - no libraries --
26     FSRCS=
27     FOBJS=$(FSRCS:${DIRSRC}%.for=${DIRLIB}%.o)
28    
29     # -- CPP - no libraries --
30     CPPSRCS=${DIRSRC}/DarthVaderVerl2.cpp
31     CPPOBJS=$(CPPSRCS:${DIRSRC}%.cpp=${DIRLIB}%.o)
32    
33     # -- C - no libraries --
34     CSRCS=
35     COBJS=$(CSRCS:${DIRSRC}%.c=${DIRLIB}%.o)
36    
37     # -- CPP - ROOT libraries --
38     LIBROOTSRCS=
39    
40     LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
41     LIBROOTCLIBS=
42     FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so)
43    
44     # -- CPP - NON-ROOT libraries --
45     LIBCPPSRCS=
46     LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
47     LIBCPPCLIBS=
48     FULLLIBCPPLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so)
49    
50     # -- CPP - Executables --
51 mocchiut 1.18 CXXEXESRCS=${DIRSRC}/DarthVader.cpp
52 mocchiut 1.1 CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=${DIRLIB}%.o)
53 mocchiut 1.18 CXXEXELIBS:=DarthVader
54 mocchiut 1.1
55 mocchiut 1.19 # -- list of objects needed to link
56     ##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)
57     OBJS=$(shell cd ${DIRLIB}&>/dev/null;for file in `ls lib*.so`; do if [ $${file} != "" ]; then echo ${DIRLIB}/$${file}; fi; done) ${CPPOBJS}
58 mocchiut 1.8 DARTHVLIB=${DIRLIB}/libDarthVader_${VER}.so
59 mocchiut 1.1
60     # -- directory where to find tracker headers needed to compile
61     #TRKHEAD=${DIRTOP}/../tracker/inc
62     #TRKHEAD=-I${PAM_INC} -ITrackerLevel2/inc/ -IRunInfo/inc/ -IGLTables/inc/
63    
64     #
65 mocchiut 1.11 SUBDIR=./RunInfo ./S4Level2 ./NDLevel2 ./TrackerLevel2 ./TriggerLevel2 ./ToFLevel2 ./CalorimeterLevel2 ./AnticounterLevel2 ./OrbitalInfo
66 mocchiut 1.1 SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done)
67    
68     # List of all libraries we want to install
69 mocchiut 1.8 FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} ${DARTHVLIB}
70 mocchiut 1.1
71     # Other objects to install
72 mocchiut 1.18 EXESRCS=${DIRBIN}/DarthVader
73 mocchiut 1.1
74     INCSRCS=
75    
76     MACROSSRCS=
77    
78 mocchiut 1.27 CALIBFILES=${DIRCALIB}/trk-param ${DIRCALIB}/cal-param ${DIRCALIB}/tof-param ${DIRCALIB}/orb-param
79 mocchiut 1.1
80     DOCFILES=
81    
82     # Here the Variables used for info target
83     PACKAGE=PAMELA analysis flight software
84     EXECUTABLES= ${EXESRCS}
85     LIBS= ${FULLLIBS}
86     DOCS=
87     SRCS=
88     #SRCS= ${FSRCS} ${CRSCS} ${CXXEXESRCS} ${LIBROOTSRCS} ${LIBCPPSRCS}
89     MACROS= ${MACROSSRCS}
90     INCLUDE= ${INCSRCS}
91     #
92     TOBEDEL = junk
93     ROOTINC=$$${shell root-config --incdir}
94     NROOTINC=${shell root-config --incdir}
95     # Directories where you place detectors software
96     #SUBDIR=./GLTables ./RunInfo ./TrackerLevel2 ./CalorimeterLevel2
97    
98     # Let's start
99     #all: test mkbindir mklibdir mkverpath ${FOBJS} ${CPPOBJS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS}
100    
101     all:
102     @for dir in `echo ${SUBDIR}`; do \
103 mocchiut 1.47 (${EBLUE} "Making all in $${dir}"; ${RESET});\
104     (cd $${dir} &>/dev/null && ${MAKE} -s all); \
105     # (cd $${dir} &>/dev/null && ${MAKE} all); \
106 mocchiut 1.1 done; make locall
107    
108     locall: prepare libs exe
109     locall:
110     @echo -e ${GREEN} ""
111     @(${EGREEN} " Finished, now you can install the package \n (use: make install or make upgrade or make forceinstall) "; ${RESET})
112     @echo -e ${GREEN} ""
113     @${RESET}
114    
115     #subdir:
116     # @for dir in `echo ${SUBDIR}`; do \
117     # echo "Making ${target} in $${dir}"; \
118     # (cd $${dir} && ${MAKE} ${target}); \
119     # done;
120    
121     prepare: test mkbindir mklibdir mkverpath
122    
123     exe: prepare ${CXXEXELIBS}
124    
125     libs: prepare ${LIBROOTLIBS} ${LIBCPPLIBS}
126    
127     # Here some general rules to produce objects in our local dir
128     ${DIRLIB}/%.o: ${DIRSRC}/%.cpp
129     @(${EGREEN} "Creating CPP object file: "${WHITE} "`basename $@`"; ${RESET})
130 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`
131 mocchiut 1.1
132     ${DIRLIB}/%.o: ${DIRSRC}/%.c
133     @(${EGREEN} "Creating C object file: "${WHITE} "`basename $@`"; ${RESET})
134 mocchiut 1.11 @${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.c -I${DIRINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ `root-config --cflags`
135 mocchiut 1.1
136     ${DIRLIB}/%.o: ${DIRSRC}/%.for
137     @(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET})
138     @${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.for -I${DIRINC}
139    
140     ${LIBROOTLIBS}: ${LIBROOTSRCS}
141     @(${EGREEN} "ROOTCINT - creating file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})
142     #
143     # Create *Dict.cpp and *Dict.h
144     #
145 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
146 mocchiut 1.1 #
147     # create .o
148     #
149     @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})
150 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};
151 mocchiut 1.1 @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})
152 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};
153 mocchiut 1.1 #
154     # create .so
155     #
156     @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET})
157 mocchiut 1.47 @${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
158 mocchiut 1.1 @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))
159    
160     ${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS}
161     #
162     # create .o
163     #
164     @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})
165 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};
166 mocchiut 1.1 #
167     # create .so
168     #
169     @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET})
170 mocchiut 1.47 @${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
171 mocchiut 1.1 @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))
172    
173     ${CXXEXELIBS}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS}
174 mocchiut 1.19 @(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET})
175 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`
176 mocchiut 1.43 @(${EGREEN} "Creating libDarthVader.so library: "${WHITE} "libDarthVader_${VER}.so"; ${RESET})
177 mocchiut 1.47 @${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`
178 pam-fi 1.23
179 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`
180 mocchiut 1.1
181     # A small target to check environmental variables
182     %_env:
183     @${test_env}
184    
185     .PHONY: install installdoc installlib installmacros installinc installexe installcmacro
186     .PHONY: clean depclean info mkbindir mklibdir testcern testpamenv test
187    
188     mkbindir: ${DIRBIN}
189     ${DIRBIN}:
190     @${test_and_mk}
191    
192     mklibdir: ${DIRLIB}
193     ${DIRLIB}:
194     @${test_and_mk}
195    
196     # Here what has to be deleted in clean target
197     clean:
198     @for dir in `echo ${SUBDIR}`; do \
199 mocchiut 1.47 (${EBLUE} "Making clean in $${dir}"; ${RESET});\
200     (cd $${dir} &>/dev/null && ${MAKE} -s clean); \
201     done; make -s locclean
202 mocchiut 1.1
203     locclean: TOBEDEL= ${DIRSRC}/*.o ${DIRSRC}/*Dict.cpp ${DIRSRC}/*Dict.h ${FOBJS} ${FULLLIBS} ${DIRBIN}/${CXXEXELIBS} ${CPPOBJS} ${CXXEXEOBJS} ${FULLLINKCLIBS} ${FULLMACROCLIBS} ${FULLLINKMACROCLIBS} ${DIRSRC}/DarthVaderVerl2.cpp
204     locclean:
205     @${test_and_rm}
206    
207     distclean:
208     @for dir in `echo ${SUBDIR}`; do \
209 mocchiut 1.47 (${EBLUE} "Making distclean in $${dir}"; ${RESET});\
210     (cd $${dir} &>/dev/null && ${MAKE} -s distclean); \
211     done; make -s locdistclean
212 mocchiut 1.1
213     locdistclean: clean
214     locdistclean: TOBEDEL= ${DIRBIN} ${DIRLIB}
215     locdistclean:
216     @${test_and_rm}
217    
218    
219     forceinstall:
220     @for dir in `echo ${SUBDIR}`; do \
221 mocchiut 1.47 (${EBLUE} "Making forceinstall in $${dir}"; ${RESET});\
222     (cd $${dir} &>/dev/null && ${MAKE} -s forceinstall); \
223 mocchiut 1.1 done; make locforceinstall
224    
225     locforceinstall: FORCE=-f
226     locforceinstall: install
227    
228     upgrade:
229     @for dir in `echo ${SUBDIR}`; do \
230 mocchiut 1.47 (${EBLUE} "Making upgrade in $${dir}"; ${RESET});\
231     (cd $${dir}&>/dev/null && ${MAKE} -s upgrade); \
232     done; make -s locupgrade
233 mocchiut 1.1
234     locupgrade: FORCE=-u
235     locupgrade: locinstall
236    
237 mocchiut 1.22 upgradenc:
238     @for dir in `echo ${SUBDIR}`; do \
239 mocchiut 1.47 (${EBLUE} "Making upgradenc in $${dir}"; ${RESET});\
240     (cd $${dir}&>/dev/null && ${MAKE} -s upgrade); \
241     done; make -s locupgradenc
242 mocchiut 1.22
243     locupgradenc: FORCE=-u
244     locupgradenc: locinstallnc
245    
246 mocchiut 1.1 install:
247     @for dir in `echo ${SUBDIR}`; do \
248 mocchiut 1.47 (${EBLUE} "Making install in $${dir}"; ${RESET});\
249     (cd $${dir} &>/dev/null && ${MAKE} -s install); \
250     done; make -s locinstall
251 mocchiut 1.1
252     locinstall: installlib installinc installmacros installcalib installdoc installexe installcmacro
253    
254 mocchiut 1.22 locinstallnc: installlib installinc installmacros installdoc installexe installcmacro
255    
256 mocchiut 1.1 installlib: LINK=y
257     installlib: TOBEMOVED= $(FULLLIBS:${DIRLIB}%=${PAM_LIB}%)
258     installlib: ORIGIN=${DIRLIB}
259     installlib:
260     @${test_and_cp}
261    
262     installcmacro: LINK=y
263     installcmacro: TOBEMOVED= $(FULLMACROCLIBS:${DIRLIB}%=${PAM_LIB}%)
264     installcmacro: ORIGIN=${DIRLIB}
265     installcmacro:
266     @${test_and_cp}
267    
268     installinc: TOBEMOVED= $(INCSRCS:${DIRINC}/%=${PAM_INC}/%)
269     installinc: ORIGIN=${DIRINC}
270     installinc:
271     @${test_and_cp}
272    
273     installexe: TOBEMOVED= $(EXESRCS:${DIRBIN}/%=${PAM_BIN}/%)
274     installexe: ORIGIN=${DIRBIN}
275     installexe:
276     @${test_and_cp}
277    
278     installmacros: TOBEMOVED= $(MACROSSRCS:${DIRMACROS}/%=${PAM_MACROS}/%)
279     installmacros: ORIGIN=${DIRMACROS}
280     installmacros:
281     @${test_and_cp}
282    
283     installcalib: TOBEMOVED= $(CALIBFILES:${DIRCALIB}/%=${PAM_CALIB}/%)
284     installcalib: ORIGIN=${DIRCALIB}
285     installcalib:
286     @${cp_dir}
287    
288     installdoc: TOBEMOVED= $(DOCFILES:${DIRDOC}/%=${PAM_DOC}/%)
289     installdoc: ORIGIN=${DIRDOC}
290     installdoc:
291     @${test_and_cp}
292    
293     mkverpath:
294     @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
295     @sleep 0.8
296    
297    
298    
299     info:
300     @echo " "
301     @${EGREEN} "Infos for package :" ${WHITE} ${PACKAGE}
302     @${EGREEN} " VERSION :" ${WHITE} ${VER}
303     @${EGREEN} " EXECUTABLES :" ${WHITE} ${EXECUTABLES}
304     @${EGREEN} " LIBS :" ${WHITE} ${LIBS}
305     @${EGREEN} " DOCS :" ${WHITE} ${DOCS}
306     @${EGREEN} " SRCS :" ${WHITE} ${SRCS}
307     @${EGREEN} " MACROS :" ${WHITE} ${MACROS}
308     @${EGREEN} " INCLUDE :" ${WHITE} ${INCLUDE}
309     @echo " "
310     @${RESET}
311    
312     test: testpamenv
313    
314     testpamenv: ${PAM_ENV}
315    
316     root-config: OPT=--cflags
317     root-config:
318     @${test_cmd}
319    
320     # Here follows some usefull macros
321     define test_and_cp
322     wd=`pwd`;\
323     for i in ${TOBEMOVED} ; do \
324     wv=$${i##/*/}; \
325     dest=$${i/$${wv}/}; \
326     ${EGREEN} "Testing for :" ${WHITE} "$${i}" ; ${RESET}; \
327     if [ ! "${FORCE}" ] ; then \
328     if [ ! -f $${i} ]; then \
329     ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\
330     ${EGREEN} " to: "${WHITE} $${i} ; ${RESET}; \
331     cp ${ORIGIN}/$${i##/*/} $${i}; \
332     else \
333     ${ERED} "File already exist !!!! Please delete it " ${WHITE}; ${RESET}; \
334     fi;\
335     else \
336     if [ "${FORCE}" == "-u" ] ; then \
337     if [ "`basename $${i}`" != "`basename $${i} _${VER}.so`" ]; then \
338     ${EYELLOW} "Removing: "${WHITE} ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so; ${RESET}; \
339     rm -f ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so ; \
340     ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\
341     ${EGREEN} " to: "${WHITE} $${i} ; ${RESET}; \
342     cp ${ORIGIN}/$${i##/*/} $${i}; \
343     else \
344     ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
345     ${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \
346     cp -f ${ORIGIN}/$${i##/*/} $${i}; \
347     fi; \
348     else \
349     ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
350     ${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \
351     cp ${FORCE} ${ORIGIN}/$${i##/*/} $${i}; \
352     fi;\
353     fi ;\
354     if [ ! -z ${LINK} ] ; then \
355     ${EGREEN} "Creating symlink from : "${WHITE} $${wv/_${VER}/} ;\
356     ${EGREEN} " to : "${WHITE} $${i##/*/} ; ${RESET}; \
357     cd $${dest}; \
358     ln -sf $${wv} $${wv/_${VER}/}; \
359     cd $${wd}; \
360     fi \
361     done
362     endef
363    
364     define cp_dir
365     wd=`pwd`;\
366     for i in ${TOBEMOVED} ; do \
367     wv=$${i##/*/}; \
368     dest=$${i/$${wv}/}; \
369     ${EYELLOW} " Copying directory: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
370 mocchiut 1.3 ${EYELLOW} " to: "${WHITE} ${PAM_CALIB} ; ${RESET}; \
371     cp -rf ${ORIGIN}/$${i##/*/} ${PAM_CALIB}; \
372 mocchiut 1.1 done
373     endef
374    
375     define test_and_mk
376     ${EGREEN} "Testing for :" ${WHITE} "$@"; ${RESET}
377     test -d "$@" || \
378     (${EGREEN} "Creating : "${WHITE} "$@"; ${RESET}; mkdir -p $@)
379     endef
380    
381     define test_env
382     ${EGREEN} "Testing for env:" ${WHITE} $(patsubst %_env,%,$@); ${RESET}
383     printenv $(patsubst %_env,%,$@) 1>/dev/null || \
384     (${ERED} "ERROR, variable : "${WHITE} $(patsubst %_env,%,$@) \
385     ${RED} "not defined !!! Check your env. settings"; \
386     ${RESET}; exit 1)
387     ${EGREEN} " Defined:" ${WHITE} $${$(patsubst %_env,%,$@)}; ${RESET}
388     endef
389    
390     define test_cmd
391     ${EGREEN} "Testing for cmd:" ${WHITE} $@ ${OPT}; ${RESET}
392     $@ ${OPT} 1>/dev/null 2>&1 || \
393     (${ERED} "ERROR, command : "${WHITE} $@ ${OPT}\
394     ${RED} "not found !!! Check your installation"; \
395     ${RESET}; exit 1)
396     ${EGREEN} " Present:" ${WHITE} $@ ${OPT}; ${RESET}
397     endef
398    
399     define test_and_rm
400     for i in ${TOBEDEL}; do \
401     test -d $${i} || (${ERED} "Removing file :"${WHITE} $${i}; ${RESET}; \
402     rm -f $${i} ); \
403     test ! -d $${i} || (${ERED} "Removing dir :"${WHITE} $${i}; ${RESET}; \
404     rm -rf $${i} ); \
405     done
406     endef

  ViewVC Help
Powered by ViewVC 1.1.23