| 1 | 
 # Tracker flight analysis software  | 
 # Tracker flight analysis software  | 
| 2 | 
 # SOFTWARE VERSION | 
 # SOFTWARE VERSION | 
| 3 | 
 VER= v5r00 | 
 VER= v6r02 | 
| 4 | 
 DEBUG=0 | 
 DEBUG=0 | 
| 5 | 
 # An almost general purpouse Makefile for PAMELA repository | 
 # An almost general purpouse Makefile for PAMELA repository | 
| 6 | 
 # Let's start with some usefull definition for colorize the echo  | 
 # Let's start with some usefull definition for colorize the echo  | 
| 24 | 
 # Here the variables used to override the standard make flags | 
 # Here the variables used to override the standard make flags | 
| 25 | 
 # C | 
 # C | 
| 26 | 
 CC=gcc | 
 CC=gcc | 
| 27 | 
 #CFLAGS=-Wall -O -fPIC -pthread -g | 
 #CFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT}  | 
| 28 | 
 #CFLAGS=-Wall -O -fPIC -pthread | 
 #CFLAGS=-Wall -O -fPIC -pthread ${PAM_BIT}  | 
| 29 | 
 CFLAGS=-Wall -fPIC -pthread | 
 CFLAGS=-Wall -O3 -funroll-loops -fPIC -pthread ${PAM_BIT}  | 
| 30 | 
  | 
 #CFLAGS=-Wall -fPIC -pthread ${PAM_BIT}  | 
| 31 | 
 # Enviroment: | 
 # Enviroment: | 
| 32 | 
 GCCVER=`gcc --version | head -1` | 
 GCCVER=`gcc --version | head -1` | 
| 33 | 
 UNAMEA=`uname -a` | 
 UNAMEA=`uname -a` | 
| 34 | 
 TODAY=`date` | 
 TODAY=`date` | 
| 35 | 
  | 
 # | 
| 36 | 
  | 
 ifeq ($(PAM_BIT),"-m32") | 
| 37 | 
  | 
         MALIGN=-malign-double | 
| 38 | 
  | 
 else | 
| 39 | 
  | 
         MALIGN= | 
| 40 | 
  | 
 endif | 
| 41 | 
 # F77 | 
 # F77 | 
| 42 | 
 F77=g77 | 
 F77=g77 | 
| 43 | 
 #F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash  | 
 #F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash  ${PAM_BIT}  | 
| 44 | 
 F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC | 
 #F77FLAGS=  -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}  | 
| 45 | 
  | 
 #F77FLAGS=  -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}  | 
| 46 | 
  | 
 F77FLAGS=  -O2 $(MALIGN) -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}  | 
| 47 | 
  | 
 #F77FLAGS=  -malign-double -Wall -funroll-loops -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}  | 
| 48 | 
  | 
 #F77FLAGS=   -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}  | 
| 49 | 
  | 
 #F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -fPIC ${PAM_BIT}  | 
| 50 | 
 # C++ | 
 # C++ | 
| 51 | 
 CXX=g++ | 
 CXX=g++ | 
| 52 | 
 #CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=${DEBUG}'  | 
 #CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=${DEBUG}' ${PAM_BIT}  | 
| 53 | 
 #CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=0' | 
 #CXXFLAGS=-Wall -O -fPIC -pthread -g -D'DEBUG=0' ${PAM_BIT}  | 
| 54 | 
 #CXXFLAGS=-Wall -O -fPIC -pthread -fpermissive | 
 #CXXFLAGS=-Wall -O -fPIC -pthread -fpermissive ${PAM_BIT}  | 
| 55 | 
 #CXXFLAGS=-Wall -O4 -fPIC -pthread | 
 #CXXFLAGS=-Wall -O4 -fPIC -pthread ${PAM_BIT}  | 
| 56 | 
 CXXFLAGS=-Wall -fPIC -pthread | 
 CXXFLAGS=-Wall -O3 -funroll-loops -fPIC -pthread ${PAM_BIT}  | 
| 57 | 
  | 
 #CXXFLAGS=-Wall -fPIC -pthread ${PAM_BIT}  | 
| 58 | 
 # ROOTCINT | 
 # ROOTCINT | 
| 59 | 
 ROOTCINT=rootcint | 
 ROOTCINT=rootcint | 
| 60 | 
 # Here the variables definig the local directories | 
 # Here the variables definig the local directories | 
| 211 | 
  | 
  | 
| 212 | 
 # .so from .o fortran | 
 # .so from .o fortran | 
| 213 | 
 ${LIBF77LIBS}: ${LIBF77OBJS} | 
 ${LIBF77LIBS}: ${LIBF77OBJS} | 
| 214 | 
         @(${EYELLOW} " F77 shared library --------------------------") | 
 #       @(${EYELLOW} " F77 shared library --------------------------") | 
| 215 | 
         @(${EGREEN} "Creating library: "${WHITE} "$@"; ${RESET}) | 
         @(${EGREEN} "Creating library: "${WHITE} "$@"; ${RESET}) | 
| 216 | 
 #       @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $^ `cernlib mathlib` /usr/lib/libg2c.so.0 | 
 #       @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $^ `cernlib mathlib` /usr/lib/libg2c.so.0 | 
| 217 | 
 ##      @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^ `cernlib mathlib`  | 
 ##      @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^ `cernlib mathlib`  | 
| 218 | 
         @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^  | 
         @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c $^  | 
| 219 | 
  | 
  | 
| 220 | 
 ${LIBROOTLIBS}: ${LIBROOTSRCS} ${FOBJS} | 
 ${LIBROOTLIBS}: ${LIBROOTSRCS} ${FOBJS} | 
| 221 | 
         @(${EYELLOW} " ROOT library ------------------------") | 
 #       @(${EYELLOW} " ROOT library ------------------------") | 
| 222 | 
         @(${EGREEN} "Creating file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) | 
         @(${EGREEN} "Creating file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) | 
| 223 | 
 # | 
 # | 
| 224 | 
 #       Create *Dict.cpp and *Dict.h | 
 #       Create *Dict.cpp and *Dict.h | 
| 240 | 
         @${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   | 
         @${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   | 
| 241 | 
 #       ${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ ${SUBINC} ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.o 1>/dev/null | 
 #       ${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ ${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 | 
| 242 | 
         @ln -sf  ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) | 
         @ln -sf  ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) | 
| 243 | 
         @(${EYELLOW} " -------------------------------------") | 
 #       @(${EYELLOW} " -------------------------------------") | 
| 244 | 
  | 
  | 
| 245 | 
 ${LIBCPPLIBS}: ${LIBCPPSRCS} | 
 ${LIBCPPLIBS}: ${LIBCPPSRCS} | 
| 246 | 
 # | 
 # |