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

  ViewVC Help
Powered by ViewVC 1.1.23