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

  ViewVC Help
Powered by ViewVC 1.1.23