1 |
# Trigger flight analysis software |
# DarthVader flight analysis software |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v3r00 |
VER= v1r00 |
4 |
# An almost general purpouse Makefile for PAMELA repository |
# An almost general purpouse Makefile for PAMELA repository |
5 |
# Let's start with some usefull definition for colorize the echo |
# Let's start with some usefull definition for colorize the echo |
6 |
RED='\E[1;31;40m' |
RED='\E[1;31;40m' |
21 |
# Reset the terminal |
# Reset the terminal |
22 |
RESET=tput sgr0 |
RESET=tput sgr0 |
23 |
# Here the variables used to override the standard make flags |
# Here the variables used to override the standard make flags |
24 |
|
#MAKE |
25 |
|
MAKE=make |
26 |
# C |
# C |
27 |
CC=gcc |
CC=gcc |
28 |
#CFLAGS=-Wall -O -fPIC -pthread -g |
#CFLAGS=-Wall -O -fPIC -pthread -g |
43 |
ROOTCINT=rootcint |
ROOTCINT=rootcint |
44 |
# Here the variables definig the local directories |
# Here the variables definig the local directories |
45 |
DIRTOP=${shell pwd} |
DIRTOP=${shell pwd} |
46 |
DIRLIB=../lib/${ARCH} |
#DIRLIB=../lib/${ARCH} |
47 |
DIRBIN=../bin/${ARCH} |
#DIRBIN=../bin/${ARCH} |
48 |
#DIRLIB=lib/${ARCH} |
DIRLIB=lib/${ARCH} |
49 |
#DIRBIN=bin/${ARCH} |
DIRBIN=bin/${ARCH} |
50 |
DIRSRC=src |
DIRSRC=src |
51 |
DIRINC=inc |
DIRINC=inc |
52 |
DIRDOC=doc |
DIRDOC=doc |
53 |
DIRMACROS=macros |
DIRMACROS=macros |
54 |
DIRCALIB=calib |
DIRCALIB=param |
55 |
# Here the PAMELA environmental variables to be checked |
# Here the PAMELA environmental variables to be checked |
56 |
PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env PAM_YODA_env |
PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env PAM_CALIB_env PAM_YODA_env |
57 |
|
|
58 |
# Here the local variables used to build the targets |
# Here the local variables used to build the targets |
59 |
# -- F77 - no libraries -- |
# -- F77 - no libraries -- |
61 |
FOBJS=$(FSRCS:${DIRSRC}%.for=${DIRLIB}%.o) |
FOBJS=$(FSRCS:${DIRSRC}%.for=${DIRLIB}%.o) |
62 |
|
|
63 |
# -- CPP - no libraries -- |
# -- CPP - no libraries -- |
64 |
CPPSRCS= |
CPPSRCS=${DIRSRC}/DarthVaderVerl2.cpp |
65 |
CPPOBJS=$(CPPSRCS:${DIRSRC}%.cpp=${DIRLIB}%.o) |
CPPOBJS=$(CPPSRCS:${DIRSRC}%.cpp=${DIRLIB}%.o) |
66 |
|
|
67 |
# -- C - no libraries -- |
# -- C - no libraries -- |
68 |
CSRCS= |
CSRCS= |
69 |
COBJS=$(CSRCS:${DIRSRC}%.c=${DIRLIB}%.o) |
COBJS=$(CSRCS:${DIRSRC}%.c=${DIRLIB}%.o) |
70 |
|
|
71 |
# -- CPP - ROOT libraries -- |
# -- CPP - ROOT libraries -- |
72 |
LIBROOTSRCS=${DIRSRC}/TrigLevel2.cpp |
LIBROOTSRCS= |
73 |
|
|
74 |
LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) |
LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) |
75 |
LIBROOTCLIBS=libTrigLevel2 |
LIBROOTCLIBS= |
76 |
FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so) |
FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so) |
77 |
|
|
78 |
# -- CPP - NON-ROOT libraries -- |
# -- CPP - NON-ROOT libraries -- |
79 |
LIBCPPSRCS= ${DIRSRC}/TrigCore.cpp \ |
LIBCPPSRCS= |
|
${DIRSRC}/TrigVerl2.cpp |
|
80 |
LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) |
LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) |
81 |
LIBCPPCLIBS=libTrigCore libTrigVerl2 |
LIBCPPCLIBS= |
82 |
FULLLIBCPPLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so) |
FULLLIBCPPLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so) |
83 |
|
|
84 |
# -- CPP - Executables -- |
# -- CPP - Executables -- |
85 |
CXXEXESRCS=${DIRSRC}/TriggerLevel2.cpp |
CXXEXESRCS=${DIRSRC}/DarthVader.cpp \ |
86 |
|
${DIRSRC}/R2-D2.cpp |
87 |
CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=${DIRLIB}%.o) |
CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=${DIRLIB}%.o) |
88 |
CXXEXELIBS:=TriggerLevel2 |
CXXEXELIBS:=DarthVader R2-D2 |
89 |
|
|
90 |
# -- list of tracker objects needed to link |
# -- list of tracker objects needed to link |
91 |
TRKOBJS=${DIRLIB}/libGLTables.so ${DIRLIB}/libRunInfo.so |
#TRKOBJS=${DIRTOP}/../lib2/libTrkLevel2.so ${DIRTOP}/../lib2/libtrack.so |
92 |
|
#TRKOBJS=$(shell for lib in `ls ${DIRLIB}`; do echo ${lib}; done) |
93 |
|
#OBJS=${DIRLIB}/*.* |
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 |
|
#TRKOBJS= |
96 |
|
|
97 |
# -- directory where to find tracker headers needed to compile |
# -- directory where to find tracker headers needed to compile |
98 |
SUBDIR=../GLTables ../RunInfo |
#TRKHEAD=${DIRTOP}/../tracker/inc |
99 |
|
#TRKHEAD=-I${PAM_INC} -ITrackerLevel2/inc/ -IRunInfo/inc/ -IGLTables/inc/ |
100 |
|
|
101 |
|
# |
102 |
|
SUBDIR=./GLTables ./RunInfo ./S4Level2 ./NDLevel2 ./TrackerLevel2 ./TriggerLevel2 ./ToFLevel2 ./CalorimeterLevel2 ./AnticounterLevel2 ./OrbitalInfo |
103 |
SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done) |
SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done) |
104 |
|
|
105 |
# List of all libraries we want to install |
# List of all libraries we want to install |
106 |
FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} |
FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} |
107 |
|
|
108 |
# Other objects to install |
# Other objects to install |
109 |
EXESRCS=${DIRBIN}/TriggerLevel2 |
EXESRCS=${DIRBIN}/DarthVader ${DIRBIN}/R2-D2 |
110 |
|
|
111 |
INCSRCS=${DIRINC}/TrigLevel2.h |
INCSRCS= |
112 |
|
|
113 |
MACROSSRCS= |
MACROSSRCS= |
114 |
|
|
115 |
CALIBFILES= |
CALIBFILES=${DIRCALIB}/trk-param ${DIRCALIB}/cal-param ${DIRCALIB}/tof-param |
116 |
|
|
117 |
DOCFILES= |
DOCFILES= |
118 |
|
|
119 |
# Here the Variables used for info target |
# Here the Variables used for info target |
120 |
PACKAGE=Trigger analysis flight software |
PACKAGE=PAMELA analysis flight software |
121 |
EXECUTABLES= ${EXESRCS} |
EXECUTABLES= ${EXESRCS} |
122 |
LIBS= ${FULLLIBS} |
LIBS= ${FULLLIBS} |
123 |
DOCS= |
DOCS= |
129 |
TOBEDEL = junk |
TOBEDEL = junk |
130 |
ROOTINC=$$${shell root-config --incdir} |
ROOTINC=$$${shell root-config --incdir} |
131 |
NROOTINC=${shell root-config --incdir} |
NROOTINC=${shell root-config --incdir} |
132 |
|
# Directories where you place detectors software |
133 |
|
#SUBDIR=./GLTables ./RunInfo ./TrackerLevel2 ./CalorimeterLevel2 |
134 |
|
|
135 |
# Let's start |
# Let's start |
136 |
#all: test mkbindir mklibdir mkverpath ${FOBJS} ${CPPOBJS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS} |
#all: test mkbindir mklibdir mkverpath ${FOBJS} ${CPPOBJS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS} |
137 |
all: prepare libs |
|
138 |
all: |
all: |
139 |
|
@for dir in `echo ${SUBDIR}`; do \ |
140 |
|
echo "Making all in $${dir}"; \ |
141 |
|
(cd $${dir} && ${MAKE} all); \ |
142 |
|
done; make locall |
143 |
|
|
144 |
|
locall: prepare libs exe |
145 |
|
locall: |
146 |
@echo -e ${GREEN} "" |
@echo -e ${GREEN} "" |
147 |
@(${EGREEN} " Finished, now you can install the package \n (use: make install or make upgrade or make forceinstall) "; ${RESET}) |
@(${EGREEN} " Finished, now you can install the package \n (use: make install or make upgrade or make forceinstall) "; ${RESET}) |
148 |
@echo -e ${GREEN} "" |
@echo -e ${GREEN} "" |
149 |
@${RESET} |
@${RESET} |
150 |
|
|
151 |
standalone: all exe |
#subdir: |
152 |
|
# @for dir in `echo ${SUBDIR}`; do \ |
153 |
|
# echo "Making ${target} in $${dir}"; \ |
154 |
|
# (cd $${dir} && ${MAKE} ${target}); \ |
155 |
|
# done; |
156 |
|
|
157 |
prepare: test mkbindir mklibdir mkverpath |
prepare: test mkbindir mklibdir mkverpath |
158 |
|
|
163 |
# Here some general rules to produce objects in our local dir |
# Here some general rules to produce objects in our local dir |
164 |
${DIRLIB}/%.o: ${DIRSRC}/%.cpp |
${DIRLIB}/%.o: ${DIRSRC}/%.cpp |
165 |
@(${EGREEN} "Creating CPP object file: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating CPP object file: "${WHITE} "`basename $@`"; ${RESET}) |
166 |
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.cpp -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ `root-config --cflags` |
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.cpp -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ `root-config --cflags` |
167 |
|
|
168 |
${DIRLIB}/%.o: ${DIRSRC}/%.c |
${DIRLIB}/%.o: ${DIRSRC}/%.c |
169 |
@(${EGREEN} "Creating C object file: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating C object file: "${WHITE} "`basename $@`"; ${RESET}) |
170 |
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.c -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ `root-config --cflags` |
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.c -I${DIRINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ `root-config --cflags` |
171 |
|
|
172 |
${DIRLIB}/%.o: ${DIRSRC}/%.for |
${DIRLIB}/%.o: ${DIRSRC}/%.for |
173 |
@(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET}) |
178 |
# |
# |
179 |
# Create *Dict.cpp and *Dict.h |
# Create *Dict.cpp and *Dict.h |
180 |
# |
# |
181 |
@${ROOTCINT} -f ${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -c -I${ROOTINC} -I${PAM_YODA}/include/yoda/ ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`.h ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`LinkDef.h |
@${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 |
182 |
# |
# |
183 |
# create .o |
# create .o |
184 |
# |
# |
185 |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) |
186 |
@${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${NROOTINC}; |
@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_YODA}/include/utils/ -I${NROOTINC}; |
187 |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) |
188 |
@${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${NROOTINC}; |
@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_YODA}/include/utils/ -I${NROOTINC}; |
189 |
# |
# |
190 |
# create .so |
# create .so |
191 |
# |
# |
192 |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
193 |
@${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 |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.o 1>/dev/null |
194 |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
195 |
|
|
196 |
${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS} |
${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS} |
198 |
# create .o |
# create .o |
199 |
# |
# |
200 |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) |
201 |
@${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${NROOTINC}; |
@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_YODA}/include/utils/ -I${NROOTINC} ${SUBINC}; |
202 |
# |
# |
203 |
# create .so |
# create .so |
204 |
# |
# |
205 |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
206 |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${SUBINC} -I${PAM_YODA}/include/yoda/ ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${FOBJS} ${COBJS} 1>/dev/null |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${FOBJS} ${COBJS} 1>/dev/null |
207 |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
208 |
|
|
209 |
${CXXEXELIBS}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS} |
${CXXEXELIBS}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS} |
210 |
@(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) |
@(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) |
211 |
@${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRLIB}/$@.o ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} ${TRKOBJS} ${CPPOBJS} ${COBJS} ${FOBJS} ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` `cernlib mathlib` |
@${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` |
212 |
|
|
213 |
# A small target to check environmental variables |
# A small target to check environmental variables |
214 |
%_env: |
%_env: |
226 |
@${test_and_mk} |
@${test_and_mk} |
227 |
|
|
228 |
# Here what has to be deleted in clean target |
# Here what has to be deleted in clean target |
229 |
clean: TOBEDEL= ${DIRSRC}/*.o ${DIRSRC}/*Dict.cpp ${DIRSRC}/*Dict.h ${FOBJS} ${FULLLIBS} ${DIRBIN}/${CXXEXELIBS} ${CPPOBJS} ${CXXEXEOBJS} ${FULLLINKCLIBS} ${FULLMACROCLIBS} ${FULLLINKMACROCLIBS} ${DIRSRC}/TrigVerl2.cpp |
clean: |
230 |
clean: |
@for dir in `echo ${SUBDIR}`; do \ |
231 |
@${test_and_rm} |
echo "Making clean in $${dir}"; \ |
232 |
|
(cd $${dir} && ${MAKE} clean); \ |
233 |
|
done; make locclean |
234 |
|
|
235 |
distclean: clean |
locclean: TOBEDEL= ${DIRSRC}/*.o ${DIRSRC}/*Dict.cpp ${DIRSRC}/*Dict.h ${FOBJS} ${FULLLIBS} ${DIRBIN}/${CXXEXELIBS} ${CPPOBJS} ${CXXEXEOBJS} ${FULLLINKCLIBS} ${FULLMACROCLIBS} ${FULLLINKMACROCLIBS} ${DIRSRC}/DarthVaderVerl2.cpp |
236 |
distclean: TOBEDEL= ${DIRBIN} ${DIRLIB} |
locclean: |
|
distclean: |
|
237 |
@${test_and_rm} |
@${test_and_rm} |
238 |
|
|
239 |
|
distclean: |
240 |
|
@for dir in `echo ${SUBDIR}`; do \ |
241 |
|
echo "Making distclean in $${dir}"; \ |
242 |
|
(cd $${dir} && ${MAKE} distclean); \ |
243 |
|
done; make locdistclean |
244 |
|
|
245 |
|
locdistclean: clean |
246 |
|
locdistclean: TOBEDEL= ${DIRBIN} ${DIRLIB} |
247 |
|
locdistclean: |
248 |
|
@${test_and_rm} |
249 |
|
|
|
forceinstall: FORCE=-f |
|
|
forceinstall: install |
|
|
|
|
|
forceinstallstandalone: FORCE=-f |
|
|
forceinstallstandalone: installstandalone |
|
|
|
|
|
upgrade: FORCE=-u |
|
|
upgrade: install |
|
|
|
|
|
upgradestandalone: FORCE=-u |
|
|
upgradestandalone: installstandalone |
|
250 |
|
|
251 |
install: installlib installinc installmacros installcalib installdoc installcmacro |
forceinstall: |
252 |
|
@for dir in `echo ${SUBDIR}`; do \ |
253 |
|
echo "Making forceinstall in $${dir}"; \ |
254 |
|
(cd $${dir} && ${MAKE} forceinstall); \ |
255 |
|
done; make locforceinstall |
256 |
|
|
257 |
|
locforceinstall: FORCE=-f |
258 |
|
locforceinstall: install |
259 |
|
|
260 |
|
upgrade: |
261 |
|
@for dir in `echo ${SUBDIR}`; do \ |
262 |
|
echo "Making upgrade in $${dir}"; \ |
263 |
|
(cd $${dir} && ${MAKE} upgrade); \ |
264 |
|
done; make locupgrade |
265 |
|
|
266 |
|
locupgrade: FORCE=-u |
267 |
|
locupgrade: locinstall |
268 |
|
|
269 |
|
install: |
270 |
|
@for dir in `echo ${SUBDIR}`; do \ |
271 |
|
echo "Making install in $${dir}"; \ |
272 |
|
(cd $${dir} && ${MAKE} install); \ |
273 |
|
done; make locinstall |
274 |
|
|
275 |
installstandalone: install installexe |
locinstall: installlib installinc installmacros installcalib installdoc installexe installcmacro |
276 |
|
|
277 |
installlib: LINK=y |
installlib: LINK=y |
278 |
installlib: TOBEMOVED= $(FULLLIBS:${DIRLIB}%=${PAM_LIB}%) |
installlib: TOBEMOVED= $(FULLLIBS:${DIRLIB}%=${PAM_LIB}%) |
304 |
installcalib: TOBEMOVED= $(CALIBFILES:${DIRCALIB}/%=${PAM_CALIB}/%) |
installcalib: TOBEMOVED= $(CALIBFILES:${DIRCALIB}/%=${PAM_CALIB}/%) |
305 |
installcalib: ORIGIN=${DIRCALIB} |
installcalib: ORIGIN=${DIRCALIB} |
306 |
installcalib: |
installcalib: |
307 |
@${test_and_cp} |
@${cp_dir} |
308 |
|
|
309 |
installdoc: TOBEMOVED= $(DOCFILES:${DIRDOC}/%=${PAM_DOC}/%) |
installdoc: TOBEMOVED= $(DOCFILES:${DIRDOC}/%=${PAM_DOC}/%) |
310 |
installdoc: ORIGIN=${DIRDOC} |
installdoc: ORIGIN=${DIRDOC} |
312 |
@${test_and_cp} |
@${test_and_cp} |
313 |
|
|
314 |
mkverpath: |
mkverpath: |
315 |
@echo '#include <TSystem.h>' > ${DIRTOP}/${DIRSRC}/TrigVerl2.cpp; echo ' char *TrigInfo(bool print){ if ( print ) printf("\nTrigger Level2 flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> ${DIRTOP}/${DIRSRC}/TrigVerl2.cpp |
@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 |
316 |
@sleep 0.8 |
@sleep 0.8 |
317 |
|
|
318 |
|
|
382 |
done |
done |
383 |
endef |
endef |
384 |
|
|
385 |
|
define cp_dir |
386 |
|
wd=`pwd`;\ |
387 |
|
for i in ${TOBEMOVED} ; do \ |
388 |
|
wv=$${i##/*/}; \ |
389 |
|
dest=$${i/$${wv}/}; \ |
390 |
|
${EYELLOW} " Copying directory: "${WHITE} ${ORIGIN}/$${i##/*/} ;\ |
391 |
|
${EYELLOW} " to: "${WHITE} ${PAM_CALIB} ; ${RESET}; \ |
392 |
|
cp -rf ${ORIGIN}/$${i##/*/} ${PAM_CALIB}; \ |
393 |
|
done |
394 |
|
endef |
395 |
|
|
396 |
define test_and_mk |
define test_and_mk |
397 |
${EGREEN} "Testing for :" ${WHITE} "$@"; ${RESET} |
${EGREEN} "Testing for :" ${WHITE} "$@"; ${RESET} |
398 |
test -d "$@" || \ |
test -d "$@" || \ |