/[PAMELA software]/DarthVader/TrackerLevel2/Makefile
ViewVC logotype

Diff of /DarthVader/TrackerLevel2/Makefile

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by pam-fi, Tue Nov 7 15:55:10 2006 UTC revision 1.47 by pamelats, Wed Dec 30 14:36:50 2009 UTC
# Line 1  Line 1 
1  # Tracker flight analysis software  # Tracker flight analysis software
2  # SOFTWARE VERSION  # SOFTWARE VERSION
3  VER= v2r00  VER= v6r03
4  DEBUG=0  DEBUG=0
5  # An almost general purpouse Makefile for PAMELA repository  #
6  # Let's start with some usefull definition for colorize the echo  include ../Make.def
7  RED='\E[1;31;40m'  ifeq ($(PAM_BIT),"-m32")
8  GREEN='\E[1;32;40m'          MALIGN=-malign-double
9  YELLOW='\E[1;33;40m'  else
10  BLUE='\E[1;34;40m'          MALIGN=
11  WHITE='\E[1;37;40m'  endif
12  VIOLET='\E[1;35;40m'  ifeq ($(GCC4),0)
13  CYAN='\E[1;36;40m'          EXTRAOPT=-Wno-globals -fvxt
14  # Here the echo definition to use them  else
15  EVIOLET=echo -e ${VIOLET}          EXTRAOPT=
16  ECYAN=echo -e ${CYAN}  endif
17  ERED=echo -e ${RED}  #F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash  ${PAM_BIT}
18  EGREEN=echo -e ${GREEN}  #F77FLAGS=  -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
19  EYELLOW=echo -e ${YELLOW}  #F77FLAGS=  -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
20  EBLUE=echo -e ${BLUE}  export F77FLAGS=  -O2 $(MALIGN) -Wall -funroll-loops $(EXTRAOPT) -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
21  EWHITE=echo -e ${WHITE}  #F77FLAGS=  -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
22  # Reset the terminal  #F77FLAGS=   -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
23  RESET=tput sgr0  #F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}
24  # Here the variables used to override the standard make flags  ROOTCINT=rootcint
25  # C  # Here the variables definig the local directories
26  CC=gcc  DIRTOP=${shell pwd}
27  #CFLAGS=-Wall -O -fPIC -pthread -g  #DIRLIB=lib/${ARCH}/
28  CFLAGS=-Wall -O -fPIC -pthread  #DIRBIN=bin/${ARCH}/
29  # Enviroment:  DIRLIB=../lib/${ARCH}/
30  GCCVER=`gcc --version | head -1`  DIRBIN=../bin/${ARCH}/
31  UNAMEA=`uname -a`  DIRSRC=src
32  TODAY=`date`  DIRINC=inc
33  # F77  DIRDOC=doc
34  F77=g77  DIRMACROS=macros
35  #F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash  DIRCALIB=calib
36  F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash  # Here the  PAMELA environmental variables to be checked
37  # C++  PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env PAM_YODA_env
38  CXX=g++  # Here the local variables used to build the targets
39  #CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=${DEBUG}'  #-------------------------------------------------
40  #CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=0'  FSRCS=${DIRSRC}/F77/fillpedsig.f   \
41  #CXXFLAGS=-Wall -O -fPIC -pthread -fpermissive          ${DIRSRC}/F77/readallparam.f \
42  CXXFLAGS=-Wall -O -fPIC -pthread          ${DIRSRC}/F77/functions.f    \
43  # ROOTCINT          ${DIRSRC}/F77/cncomp.f    \
44  ROOTCINT=rootcint          ${DIRSRC}/F77/filladc.f    \
45  # Here the variables definig the local directories          ${DIRSRC}/F77/reductionflight.f \
46  DIRTOP=${shell pwd}          ${DIRSRC}/F77/functionspfa.f    \
47  #DIRLIB=lib/${ARCH}/          ${DIRSRC}/F77/mini.f \
48  #DIRBIN=bin/${ARCH}/          ${DIRSRC}/F77/tricircle.f \
49  DIRLIB=../lib/${ARCH}/          ${DIRSRC}/F77/analysissubroutines.f \
50  DIRBIN=../bin/${ARCH}/          ${DIRSRC}/F77/analysisflight.f \
51  DIRSRC=src          ${DIRSRC}/F77/readB.f \
52  DIRINC=inc          ${DIRSRC}/F77/interB.f \
53  DIRDOC=doc          ${DIRSRC}/F77/track.f \
54  DIRMACROS=macros          ${DIRSRC}/F77/grkuta.f \
55  DIRCALIB=calib          ${DIRSRC}/F77/bdll.f      # ***PP***
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  FOBJS=$(FSRCS:${DIRSRC}/F77/%.f=${DIRLIB}/%.o)
58  # Here the local variables used to build the targets  #-------------------------------------------------
59  #-------------------------------------------------  CSRCS=
60  FSRCS=${DIRSRC}/F77/fillpedsig.f   \  COBJS=$(CSRCS:${DIRSRC}%.cpp=${DIRLIB}/%.o)
61          ${DIRSRC}/F77/readallparam.f \  #-------------------------------------------------
62          ${DIRSRC}/F77/functions.f    \  # librerie utilizzabili da root (ci deve essere anche il ***LinkDef.h )
63          ${DIRSRC}/F77/cncomp.f    \  LIBROOTSRCS=${DIRSRC}/TrkParams.cpp \
64          ${DIRSRC}/F77/filladc.f    \          ${DIRSRC}/TrkLevel2.cpp  \
65          ${DIRSRC}/F77/reductionflight.f \          ${DIRSRC}/TrkLevel1.cpp \
66          ${DIRSRC}/F77/functionspfa.f    \          ${DIRSRC}/TrkLevel0.cpp \
67          ${DIRSRC}/F77/mini.f \          ${DIRSRC}/TrkHough.cpp \
68          ${DIRSRC}/F77/tricircle.f \          ${DIRSRC}/TrkCalib.cpp
69          ${DIRSRC}/F77/analysissubroutines.f \  
70          ${DIRSRC}/F77/analysisflight.f \  #LIBROOTSRCS=  
71          ${DIRSRC}/F77/readB.f \  LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
72          ${DIRSRC}/F77/interB.f \  LIBROOTOBJS=${DIRLIB}/readB.o \
73          ${DIRSRC}/F77/track.f \          ${DIRLIB}/interB.o \
74          ${DIRSRC}/F77/grkuta.f          ${DIRLIB}/track.o \
75            ${DIRLIB}/grkuta.o \
76  FOBJS=$(FSRCS:${DIRSRC}/F77/%.f=${DIRLIB}/%.o)          ${DIRLIB}/bdll.o \
77  #-------------------------------------------------          ${DIRLIB}/functionspfa.o \
78  CSRCS=          ${DIRLIB}/readallparam.o \
79  COBJS=$(CSRCS:${DIRSRC}%.cpp=${DIRLIB}/%.o)          ${DIRLIB}/functions.o  \
80  #-------------------------------------------------          ${DIRLIB}/mini.o  \
81  # librerie utilizzabili da root (ci deve essere anche il ***LinkDef.h )          ${DIRLIB}/tricircle.o  \
82  LIBROOTSRCS=    ${DIRSRC}/TrkLevel2.cpp  \          ${DIRLIB}/analysisflight.o  \
83                                  ${DIRSRC}/TrkLevel1.cpp          ${DIRLIB}/analysissubroutines.o  \
84  #LIBROOTSRCS=            ${DIRLIB}/fillpedsig.o  \
85  LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)          ${DIRLIB}/cncomp.o  \
86  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}/filladc.o  \
87  LIBROOTCLIBS=libTrkLevel2 libTrkLevel1          ${DIRLIB}/reductionflight.o
88  #LIBROOTCLIBS=  LIBROOTCLIBS= libTrkParams libTrkLevel2 libTrkLevel1 libTrkLevel0 libTrkHough libTrkCalib
89  FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so)  
90  #-------------------------------------------------  #LIBROOTCLIBS=
91  # librerie C++ NON utilizzabili da root  FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so)
92  #LIBCPPSRCS=  ${DIRSRC}/TrkLevel2.cpp \  #-------------------------------------------------
93  #               ${DIRSRC}/TrkLevel0.cpp  # librerie C++ NON utilizzabili da root
94  LIBCPPSRCS=${DIRSRC}/TrkLevel0.cpp \  #LIBCPPSRCS=  ${DIRSRC}/TrkLevel2.cpp \
95             ${DIRSRC}/TrkStruct.cpp \  #               ${DIRSRC}/TrkLevel0.cpp
96             ${DIRSRC}/TrkProcess.cpp \  LIBCPPSRCS=${DIRSRC}/TrkStruct.cpp \
97             ${DIRSRC}/TrkVerl2.cpp \             ${DIRSRC}/TrkProcess.cpp \
98             ${DIRSRC}/TrkCore.cpp               ${DIRSRC}/TrkVerl2.cpp \
99  LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)             ${DIRSRC}/TrkCore.cpp \
100  #LIBCPPCLIBS=libTrkLevel2 libTrkLevel0  #          ${DIRSRC}/TrkLevel0.cpp
101  LIBCPPCLIBS=libTrkLevel0 libTrkStruct libTrkProcess libTrkCore libTrkVerl2  
102  FULLCPPCLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so)  LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
103  #-------------------------------------------------  #LIBCPPCLIBS=libTrkLevel2 libTrkLevel0
104  # librerie F77 NON utilizzabili da root  LIBCPPCLIBS= libTrkStruct libTrkProcess libTrkCore libTrkVerl2 #libTrkLevel0
105  LIBF77SRCS=  FULLCPPCLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so)
106  LIBF77OBJS= $(LIBF77SRCS:${DIRSRC}/F77/%.f=${DIRLIB}/%.o)  #-------------------------------------------------
107  LIBF77LIBS= $(LIBF77SRCS:${DIRSRC}/F77/%.f=${DIRLIB}/lib%_${VER}.so)  # librerie F77 NON utilizzabili da root
108  LIBF77CLIBS=  LIBF77SRCS=
109  FULLF77CLIBS=$(LIBF77CLIBS:%=${DIRLIB}/%_${VER}.so)  LIBF77OBJS= $(LIBF77SRCS:${DIRSRC}/F77/%.f=${DIRLIB}/%.o)
110  #-------------------------------------------------  LIBF77LIBS= $(LIBF77SRCS:${DIRSRC}/F77/%.f=${DIRLIB}/lib%_${VER}.so)
111  FULLLIBS=${FULLROOTCLIBS} ${FULLCPPCLIBS} ${FULLF77CLIBS}  LIBF77CLIBS=
112    FULLF77CLIBS=$(LIBF77CLIBS:%=${DIRLIB}/%_${VER}.so)
113  #-------------------------------------------------  #-------------------------------------------------
114  # eseguibile  FULLLIBS=${FULLROOTCLIBS} ${FULLCPPCLIBS} ${FULLF77CLIBS}
115  CXXEXESRCS=${DIRSRC}/TrackerLevel2.cpp  
116  CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=${DIRLIB}%.o)  #-------------------------------------------------
117  CXXEXELIBS:=TrackerLevel2  # eseguibile
118    CXXEXESRCS=${DIRSRC}/TrackerLevel2.cpp
119  OTHERLIBS=${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so  CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=${DIRLIB}%.o)
120  SUBDIR=../RunInfo  CXXEXELIBS:=TrackerLevel2
121  SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done)  
122    OTHERLIBS=${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so
123  #-------------------------------------------------  SUBDIR=../RunInfo
124  # variabili per l'installazione  SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done)
125  EXESRCS=${DIRBIN}/TrackerLevel2  
126  INCSRCS= \  #-------------------------------------------------
127          ${DIRINC}/TrkLevel2.h \  # variabili per l'installazione
128          ${DIRINC}/TrkLevel1.h \  EXESRCS=${DIRBIN}/TrackerLevel2
129          ${DIRINC}/TrkLevel0.h \  INCSRCS= \
130          ${DIRINC}/TrkStruct.h \          ${DIRINC}/TrkLevel2.h \
131          ${DIRINC}/TrkProcess.h \          ${DIRINC}/TrkLevel1.h \
132          ${DIRINC}/TrkCore.h \          ${DIRINC}/TrkLevel0.h \
133          ${DIRINC}/TrkVerl2.h          ${DIRINC}/TrkHough.h \
134  MACROSSRCS=          ${DIRINC}/TrkCalib.h \
135  CALIBFILES=          ${DIRINC}/TrkParams.h \
136  DOCFILES=          ${DIRINC}/TrkStruct.h \
137  # Here the Variables used for info target          ${DIRINC}/TrkProcess.h \
138  PACKAGE=Tracker flight software          ${DIRINC}/TrkCore.h \
139  EXECUTABLES=${EXESRCS}          ${DIRINC}/TrkVerl2.h
140  LIBS= ${FULLLIBS} ${OTHERLIBS}  MACROSSRCS=
141  DOCS=  CALIBFILES=
142  SRCS=  DOCFILES=
143  MACROS= ${MACROSSRCS}  # Here the Variables used for info target
144  INCLUDE= ${INCSRCS}  PACKAGE=Tracker flight software
145  #  EXECUTABLES=${EXESRCS}
146  TOBEDEL = junk  LIBS= ${FULLLIBS} ${OTHERLIBS}
147  ROOTINC=$$${shell root-config --incdir}  DOCS=
148  NROOTINC=${shell root-config --incdir}  SRCS=
149  # Let's start  MACROS= ${MACROSSRCS}
150  #all : test mkbindir mklibdir mkverpath ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${FOBJS} ${COBJS} ${CXXEXELIBS}  INCLUDE= ${INCSRCS}
151  all : test mkbindir mklibdir mkverpath ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS}  #
152  all:  TOBEDEL = junk
153          @echo -e ${GREEN} ""  ROOTINC=$$${shell root-config --incdir}
154          @(${EGREEN} " Finished, now you can install the package \n  (use: make install or make upgrade or make forceinstall) "; ${RESET})  NROOTINC=${shell root-config --incdir}
155          @echo -e ${GREEN} ""  # Let's start
156          @${RESET}  #all : test mkbindir mklibdir mkverpath ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${FOBJS} ${COBJS} ${CXXEXELIBS}
157    all : test mkbindir mklibdir mkverpath ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS}
158  standalone: all ${CXXEXELIBS}  all:
159    #       @echo -e ${GREEN} ""
160  # Here some general rules to produce objects in our local dir  #       @(${EGREEN} " Finished, now you can install the package \n  (use: make install or make upgrade or make forceinstall) "; ${RESET})
161  ${DIRLIB}/%.o: ${DIRSRC}/%.cpp          @echo -e ${GREEN} ""
162  #       @(${EYELLOW} " C++ object ------------------------")          @${RESET}
163          @(${EGREEN} "Creating C++ object file: "${WHITE} "$@"; ${RESET})  
164          @${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.cpp -I${DIRTOP}/${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ `root-config --cflags`  standalone: all ${CXXEXELIBS}
165    
166  ${DIRLIB}/%.o : ${DIRSRC}/F77/%.f  include ../Make.dect
167  #       @(${EYELLOW} " F77 object ------------------------")  
168          @(${EGREEN} "Creating F77 object file: "${WHITE} "$@"; ${RESET})  ${DIRLIB}/%.o : ${DIRSRC}/F77/%.f
169          @${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/F77/`basename ${@} .o`.f -I${DIRTOP}/${DIRINC}/F77 -I${NROOTINC} ${SUBINC} -I${PAM_YODA}/include/yoda -I${PAM_INC}/          @(${EGREEN} "Creating tracker F77 object file: "${WHITE} "$@"; ${RESET})
170            @${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/F77/`basename ${@} .o`.f -I${DIRTOP}/${DIRINC}/F77 -I${NROOTINC} ${SUBINC} -I${PAM_YODA}/include/yoda -I${PAM_INC}/
171  # .so from .o fortran  
172  ${LIBF77LIBS}: ${LIBF77OBJS}  # A small target to check environmental variables
173          @(${EYELLOW} " F77 shared library --------------------------")  %_env:
174          @(${EGREEN} "Creating library: "${WHITE} "$@"; ${RESET})          @${test_env}
175  #       @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $^ `cernlib mathlib` /usr/lib/libg2c.so.0  
176  ##      @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^ `cernlib mathlib`  .PHONY: install installdoc installlib installmacros installinc installexe installcmacro
177          @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^  .PHONY: clean depclean info mkbindir mklibdir testcern testpamenv test
178    
179  ${LIBROOTLIBS}: ${LIBROOTSRCS} ${FOBJS}  mkbindir: ${DIRBIN}
180          @(${EYELLOW} " ROOT library ------------------------")  ${DIRBIN}:
181          @(${EGREEN} "Creating file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})          @${test_and_mk}
182  #  
183  #       Create *Dict.cpp and *Dict.h  mklibdir: ${DIRLIB}
184  #  ${DIRLIB}:
185          @${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          @${test_and_mk}
186  #  
187  #       create .o  # Here what has to be deleted in clean target
188  #  clean: TOBEDEL= ${DIRSRC}/*.o ${DIRSRC}/*Dict.cpp ${DIRSRC}/*Dict.h ${FOBJS} ${FULLLIBS} ${DIRBIN}/${CXXEXELIBS} ${COBJS} ${CXXEXEOBJS} ${DIRSRC}/TrkVerl2.cpp
189          @(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})  clean:
190          @${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};          @${test_and_rm}
191          @(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})  
192          @${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};  distclean: clean
193          @ln -sf  ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))  distclean: TOBEDEL= ${DIRBIN} ${DIRLIB}
194  #  distclean:
195  #       create .so          @${test_and_rm}
196  #  
197          @(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET})  forceinstall: FORCE=-f
198  ##      @${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          forceinstall: install
199          @${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    
200  #       ${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  upgrade: FORCE=-u
201          @ln -sf  ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))  upgrade: install
202          @(${EYELLOW} " -------------------------------------")  upgradestandalone: FORCE=-u
203    upgradestandalone: installstandalone
204  ${LIBCPPLIBS}: ${LIBCPPSRCS}  
205  #  install: installlib installinc installmacros installcalib installdoc installcmacro
206  #       create .o  installstandalone: install installexe
207  #  
208          @(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})  installlib: LINK=y
209          @${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};  installlib: TOBEMOVED= $(FULLLIBS:${DIRLIB}%=${PAM_LIB}%)
210  #  installlib: ORIGIN=${DIRLIB}
211  #       create .so  installlib:
212  #          @${test_and_cp}
213          @(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET})  
214          @${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  installcmacro: LINK=y
215          @ln -sf  ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))  installcmacro: TOBEMOVED= $(FULLMACROCLIBS:${DIRLIB}%=${PAM_LIB}%)
216    installcmacro: ORIGIN=${DIRLIB}
217    installcmacro:
218  ${CXXEXELIBS}: ${COBJS} ${FOBJS} ${CXXEXEOBJS}          @${test_and_cp}
219          @(${EVIOLET} "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *")  
220          @(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET})  installinc: TOBEMOVED= $(INCSRCS:${DIRINC}/%=${PAM_INC}/%)
221  #       @${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;  installinc: ORIGIN=${DIRINC}
222          @${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 mathlib`;  installinc:
223            @${test_and_cp}
224    
225  # A small target to check environmental variables  installexe: TOBEMOVED= $(EXESRCS:${DIRBIN}/%=${PAM_BIN}/%)
226  %_env:  installexe: ORIGIN=${DIRBIN}
227          @${test_env}  installexe:
228            @${test_and_cp}
229  .PHONY: install installdoc installlib installmacros installinc installexe installcmacro  
230  .PHONY: clean depclean info mkbindir mklibdir testcern testpamenv test  installmacros: TOBEMOVED= $(MACROSSRCS:${DIRMACROS}/%=${PAM_MACROS}/%)
231    installmacros: ORIGIN=${DIRMACROS}
232  mkbindir: ${DIRBIN}  installmacros:
233  ${DIRBIN}:          @${test_and_cp}
234          @${test_and_mk}  
235    installcalib: TOBEMOVED= $(CALIBFILES:${DIRCALIB}/%=${PAM_CALIB}/%)
236  mklibdir: ${DIRLIB}  installcalib: ORIGIN=${DIRCALIB}
237  ${DIRLIB}:  installcalib:
238          @${test_and_mk}          @${test_and_cp}
239    
240  # Here what has to be deleted in clean target  installdoc: TOBEMOVED= $(DOCFILES:${DIRDOC}/%=${PAM_DOC}/%)
241  clean: TOBEDEL= ${DIRSRC}/*.o ${DIRSRC}/*Dict.cpp ${DIRSRC}/*Dict.h ${FOBJS} ${FULLLIBS} ${DIRBIN}/${CXXEXELIBS} ${COBJS} ${CXXEXEOBJS} ${DIRSRC}/TrkVerl2.cpp  installdoc: ORIGIN=${DIRDOC}
242  clean:  installdoc:
243          @${test_and_rm}          @${test_and_cp}
244    
245  distclean: clean  mkverpath:
246  distclean: TOBEDEL= ${DIRBIN} ${DIRLIB}  #       @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
247  distclean:          @echo '#include <TSystem.h>' >  ${DIRTOP}/${DIRSRC}/TrkVerl2.cpp; echo ' const 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
248          @${test_and_rm}          @sleep 0.8
249    
250  forceinstall: FORCE=-f  
251  forceinstall: install  
252    info:
253  upgrade: FORCE=-u          @echo " "
254  upgrade: install          @${EGREEN} "Infos for package :" ${WHITE} ${PACKAGE}
255  upgradestandalone: FORCE=-u          @${EGREEN} "          VERSION :" ${WHITE} ${VER}
256  upgradestandalone: installstandalone          @${EGREEN} "      EXECUTABLES :" ${WHITE} ${EXECUTABLES}
257            @${EGREEN} "         INCLUDES :" ${WHITE} ${INCLUDE}
258  install: installlib installinc installmacros installcalib installdoc installcmacro          @${EGREEN} "             LIBS :" ${WHITE} ${LIBS}
259  installstandalone: install installexe          @${EGREEN} "             DOCS :" ${WHITE} ${DOCS}
260            @${EGREEN} "             SRCS :" ${WHITE} ${SRCS}
261  installlib: LINK=y          @${EGREEN} "           MACROS :" ${WHITE} ${MACROS}
262  installlib: TOBEMOVED= $(FULLLIBS:${DIRLIB}%=${PAM_LIB}%)          @echo " "
263  installlib: ORIGIN=${DIRLIB}          @${RESET}
264  installlib:  
265          @${test_and_cp}  test: testpamenv
266    
267  installcmacro: LINK=y  testpamenv: ${PAM_ENV}
268  installcmacro: TOBEMOVED= $(FULLMACROCLIBS:${DIRLIB}%=${PAM_LIB}%)  
269  installcmacro: ORIGIN=${DIRLIB}  root-config: OPT=--cflags
270  installcmacro:  root-config:
271          @${test_and_cp}          @${test_cmd}
272    
273  installinc: TOBEMOVED= $(INCSRCS:${DIRINC}/%=${PAM_INC}/%)  # Here follows some usefull macros
274  installinc: ORIGIN=${DIRINC}  define  test_and_cp
275  installinc:  wd=`pwd`;\
276          @${test_and_cp}  for i in ${TOBEMOVED} ; do \
277    wv=$${i##/*/}; \
278  installexe: TOBEMOVED= $(EXESRCS:${DIRBIN}/%=${PAM_BIN}/%)  dest=$${i/$${wv}/}; \
279  installexe: ORIGIN=${DIRBIN}  ${EGREEN} "Testing for :" ${WHITE} "$${i}" ; ${RESET}; \
280  installexe:  if [ ! "${FORCE}" ] ; then \
281          @${test_and_cp}   if [ ! -f $${i} ]; then  \
282      ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\
283  installmacros: TOBEMOVED= $(MACROSSRCS:${DIRMACROS}/%=${PAM_MACROS}/%)    ${EGREEN} "      to: "${WHITE} $${i} ; ${RESET}; \
284  installmacros: ORIGIN=${DIRMACROS}    cp ${ORIGIN}/$${i##/*/} $${i}; \
285  installmacros:   else \
286          @${test_and_cp}     ${ERED} "File already exist !!!! Please delete it " ${WHITE}; ${RESET}; \
287     fi;\
288  installcalib: TOBEMOVED= $(CALIBFILES:${DIRCALIB}/%=${PAM_CALIB}/%)  else \
289  installcalib: ORIGIN=${DIRCALIB}     if [ "${FORCE}" == "-u" ] ; then \
290  installcalib:       if [ "`basename $${i}`" != "`basename $${i} _${VER}.so`" ]; then \
291          @${test_and_cp}         ${EYELLOW} "Removing: "${WHITE} ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so; ${RESET}; \
292           rm -f ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so ; \
293  installdoc: TOBEMOVED= $(DOCFILES:${DIRDOC}/%=${PAM_DOC}/%)         ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\
294  installdoc: ORIGIN=${DIRDOC}         ${EGREEN} "      to: "${WHITE} $${i} ; ${RESET}; \
295  installdoc:         cp ${ORIGIN}/$${i##/*/} $${i}; \
296          @${test_and_cp}       else \
297           ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
298  mkverpath:         ${EYELLOW} "          to: "${WHITE} $${i} ; ${RESET}; \
299  #       @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         cp -f ${ORIGIN}/$${i##/*/} $${i}; \
300          @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       fi; \
301          @sleep 0.8     else \
302         ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\
303         ${EYELLOW} "          to: "${WHITE} $${i} ; ${RESET}; \
304         cp ${FORCE} ${ORIGIN}/$${i##/*/} $${i}; \
305  info:     fi;\
306          @echo " "  fi ;\
307          @${EGREEN} "Infos for package :" ${WHITE} ${PACKAGE}  if [ ! -z ${LINK} ] ; then \
308          @${EGREEN} "          VERSION :" ${WHITE} ${VER}    ${EGREEN} "Creating symlink from : "${WHITE} $${wv/_${VER}/} ;\
309          @${EGREEN} "      EXECUTABLES :" ${WHITE} ${EXECUTABLES}    ${EGREEN} "                   to : "${WHITE} $${i##/*/} ; ${RESET}; \
310          @${EGREEN} "         INCLUDES :" ${WHITE} ${INCLUDE}    cd $${dest}; \
311          @${EGREEN} "             LIBS :" ${WHITE} ${LIBS}    ln -sf $${wv} $${wv/_${VER}/}; \
312          @${EGREEN} "             DOCS :" ${WHITE} ${DOCS}    cd $${wd}; \
313          @${EGREEN} "             SRCS :" ${WHITE} ${SRCS}  fi \
314          @${EGREEN} "           MACROS :" ${WHITE} ${MACROS}  done
315          @echo " "  endef
316          @${RESET}  
317    define  test_and_mk
318  test: testpamenv  ${EGREEN} "Testing for :" ${WHITE} "$@"; ${RESET}
319    test -d "$@" || \
320  testpamenv: ${PAM_ENV}  (${EGREEN} "Creating : "${WHITE} "$@"; ${RESET}; mkdir -p $@)
321    endef
322  root-config: OPT=--cflags  
323  root-config:  define  test_env
324          @${test_cmd}  ${EGREEN} "Testing for env:" ${WHITE} $(patsubst %_env,%,$@); ${RESET}
325    printenv $(patsubst %_env,%,$@) 1>/dev/null || \
326  # Here follows some usefull macros  (${ERED} "ERROR, variable : "${WHITE} $(patsubst %_env,%,$@) \
327  define  test_and_cp  ${RED} "not defined !!! Check your env. settings"; \
328  wd=`pwd`;\  ${RESET}; exit 1)
329  for i in ${TOBEMOVED} ; do \  ${EGREEN} " Defined:" ${WHITE} $${$(patsubst %_env,%,$@)}; ${RESET}
330  wv=$${i##/*/}; \  endef
331  dest=$${i/$${wv}/}; \  
332  ${EGREEN} "Testing for :" ${WHITE} "$${i}" ; ${RESET}; \  define  test_cmd
333  if [ ! "${FORCE}" ] ; then \  ${EGREEN} "Testing for cmd:" ${WHITE} $@ ${OPT}; ${RESET}
334   if [ ! -f $${i} ]; then  \  $@ ${OPT} 1>/dev/null 2>&1 || \
335    ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\  (${ERED} "ERROR, command : "${WHITE} $@ ${OPT}\
336    ${EGREEN} "      to: "${WHITE} $${i} ; ${RESET}; \  ${RED} "not found !!! Check your installation"; \
337    cp ${ORIGIN}/$${i##/*/} $${i}; \  ${RESET}; exit 1)
338   else \  ${EGREEN} " Present:" ${WHITE} $@ ${OPT}; ${RESET}
339     ${ERED} "File already exist !!!! Please delete it " ${WHITE}; ${RESET}; \  endef
340   fi;\  
341  else \  define  test_and_rm
342     if [ "${FORCE}" == "-u" ] ; then \  for i in ${TOBEDEL}; do \
343       if [ "`basename $${i}`" != "`basename $${i} _${VER}.so`" ]; then \  test -d $${i} || (${ERED} "Removing file :"${WHITE} $${i}; ${RESET}; \
344         ${EYELLOW} "Removing: "${WHITE} ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so; ${RESET}; \  rm -f $${i} ); \
345         rm -f ${PAM_LIB}/`basename $${i} _${VER}.so`_v*r*.so ; \  test ! -d $${i} || (${ERED} "Removing dir :"${WHITE} $${i}; ${RESET}; \
346         ${EGREEN} "Copying : "${WHITE} ${ORIGIN}/$${i##/*/} ;\  rm -rf $${i} ); \
347         ${EGREEN} "      to: "${WHITE} $${i} ; ${RESET}; \  done
348         cp ${ORIGIN}/$${i##/*/} $${i}; \  endef
      else \  
        ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\  
        ${EYELLOW} "          to: "${WHITE} $${i} ; ${RESET}; \  
        cp -f ${ORIGIN}/$${i##/*/} $${i}; \  
      fi; \  
    else \  
      ${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\  
      ${EYELLOW} "          to: "${WHITE} $${i} ; ${RESET}; \  
      cp ${FORCE} ${ORIGIN}/$${i##/*/} $${i}; \  
    fi;\  
 fi ;\  
 if [ ! -z ${LINK} ] ; then \  
   ${EGREEN} "Creating symlink from : "${WHITE} $${wv/_${VER}/} ;\  
   ${EGREEN} "                   to : "${WHITE} $${i##/*/} ; ${RESET}; \  
   cd $${dest}; \  
   ln -sf $${wv} $${wv/_${VER}/}; \  
   cd $${wd}; \  
 fi \  
 done  
 endef  
   
 define  test_and_mk  
 ${EGREEN} "Testing for :" ${WHITE} "$@"; ${RESET}  
 test -d "$@" || \  
 (${EGREEN} "Creating : "${WHITE} "$@"; ${RESET}; mkdir -p $@)  
 endef  
   
 define  test_env  
 ${EGREEN} "Testing for env:" ${WHITE} $(patsubst %_env,%,$@); ${RESET}  
 printenv $(patsubst %_env,%,$@) 1>/dev/null || \  
 (${ERED} "ERROR, variable : "${WHITE} $(patsubst %_env,%,$@) \  
 ${RED} "not defined !!! Check your env. settings"; \  
 ${RESET}; exit 1)  
 ${EGREEN} " Defined:" ${WHITE} $${$(patsubst %_env,%,$@)}; ${RESET}  
 endef  
   
 define  test_cmd  
 ${EGREEN} "Testing for cmd:" ${WHITE} $@ ${OPT}; ${RESET}  
 $@ ${OPT} 1>/dev/null 2>&1 || \  
 (${ERED} "ERROR, command : "${WHITE} $@ ${OPT}\  
 ${RED} "not found !!! Check your installation"; \  
 ${RESET}; exit 1)  
 ${EGREEN} " Present:" ${WHITE} $@ ${OPT}; ${RESET}  
 endef  
   
 define  test_and_rm  
 for i in ${TOBEDEL}; do \  
 test -d $${i} || (${ERED} "Removing file :"${WHITE} $${i}; ${RESET}; \  
 rm -f $${i} ); \  
 test ! -d $${i} || (${ERED} "Removing dir :"${WHITE} $${i}; ${RESET}; \  
 rm -rf $${i} ); \  
 done  
 endef  

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.47

  ViewVC Help
Powered by ViewVC 1.1.23