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