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

Diff of /DarthVader/S4Level2/Makefile

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

revision 1.3 by pam-fi, Fri Jul 21 11:01:40 2006 UTC revision 1.20 by mocchiut, Thu Aug 28 13:43:43 2014 UTC
# Line 1  Line 1 
1  #S4 flight analysis software  #S4 flight analysis software
2  # SOFTWARE VERSION  # SOFTWARE VERSION
3  VER= v3r00  VER= v4r04
4  # An almost general purpouse Makefile for PAMELA repository  include ../Make.def
 # Let's start with some usefull definition for colorize the echo  
 RED='\E[1;31;40m'  
 GREEN='\E[1;32;40m'  
 YELLOW='\E[1;33;40m'  
 BLUE='\E[1;34;40m'  
 WHITE='\E[1;37;40m'  
 VIOLET='\E[1;35;40m'  
 CYAN='\E[1;36;40m'  
 # Here the echo definition to use them  
 EVIOLET=echo -e ${VIOLET}  
 ECYAN=echo -e ${CYAN}  
 ERED=echo -e ${RED}  
 EGREEN=echo -e ${GREEN}  
 EYELLOW=echo -e ${YELLOW}  
 EBLUE=echo -e ${BLUE}  
 EWHITE=echo -e ${WHITE}  
 # Reset the terminal  
 RESET=tput sgr0  
 # Here the variables used to override the standard make flags  
 # C  
 CC=gcc  
 #CFLAGS=-Wall -O -fPIC -pthread -g  
 CFLAGS=-Wall -O -fPIC -pthread  
 # Enviroment:  
 GCCVER=`gcc --version | head -1`  
 UNAMEA=`uname -a`  
 TODAY=`date`  
 # F77  
 F77=g77  
 #F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash  
 F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash  
 # C++  
 CXX=g++  
 #CXXFLAGS=-Wall -O -fPIC -pthread -g  
 CXXFLAGS=-Wall -O -fPIC -pthread  
 # ROOTCINT  
 ROOTCINT=rootcint  
5  # Here the variables definig the local directories  # Here the variables definig the local directories
6  DIRTOP=${shell pwd}  DIRTOP=${shell pwd}
7  DIRLIB=../lib/${ARCH}  DIRLIB=../lib/${ARCH}
# Line 86  CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=$ Line 49  CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=$
49  CXXEXELIBS:=S4_LEVEL2  CXXEXELIBS:=S4_LEVEL2
50    
51  # -- list of tracker objects needed to link  # -- list of tracker objects needed to link
52  TRKOBJS=${DIRLIB}/libGLTables.so ${DIRLIB}/libRunInfo.so  TRKOBJS=${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so
53  # -- directory where to find tracker headers needed to compile  # -- directory where to find tracker headers needed to compile
54  SUBDIR=../GLTables ../RunInfo  SUBDIR=../RunInfo
55  SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done)  SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done)
56  # List of all libraries we want to install  # List of all libraries we want to install
57  FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPPLIBS}  FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPPLIBS}
# Line 122  NROOTINC=${shell root-config --incdir} Line 85  NROOTINC=${shell root-config --incdir}
85  all: prepare libs  all: prepare libs
86  all:  all:
87          @echo -e ${GREEN} ""          @echo -e ${GREEN} ""
         @(${EGREEN} " Finished, now you can install the package \n  (use: make install or make upgrade or make forceinstall) "; ${RESET})  
         @echo -e ${GREEN} ""  
88          @${RESET}          @${RESET}
89    
90  standalone: all exe  standalone: all exe
# Line 134  exe: prepare ${CXXEXELIBS} Line 95  exe: prepare ${CXXEXELIBS}
95    
96  libs: prepare ${LIBROOTLIBS} ${LIBCPPLIBS}  libs: prepare ${LIBROOTLIBS} ${LIBCPPLIBS}
97    
98  # Here some general rules to produce objects in our local dir  include ../Make.dect
 ${DIRLIB}/%.o: ${DIRSRC}/%.cpp  
         @(${EGREEN} "Creating CPP object file: "${WHITE} "`basename $@`"; ${RESET})  
         @${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.cpp -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/  -I${PAM_YODA}/include/utils/ `root-config --cflags`  
   
 ${DIRLIB}/%.o: ${DIRSRC}/%.c  
         @(${EGREEN} "Creating C object file: "${WHITE} "`basename $@`"; ${RESET})  
         @${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.c -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ `root-config --cflags`  
   
 ${DIRLIB}/%.o: ${DIRSRC}/%.for  
         @(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET})  
         @${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.for -I${DIRINC}  
   
 ${LIBROOTLIBS}: ${LIBROOTSRCS}  
         @(${EGREEN} "ROOTCINT - creating file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})  
 #  
 #       Create *Dict.cpp and *Dict.h  
 #  
         @${ROOTCINT} -f ${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -c -I${ROOTINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`.h ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`LinkDef.h  
 #  
 #       create .o  
 #  
         @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})  
         @${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_YODA}/include/utils/ -I${NROOTINC};  
         @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})  
         @${CXX} ${CXXFLAGS} -c ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -o ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.o -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ -I${NROOTINC};  
 #  
 #       create .so  
 #  
         @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET})  
         @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ ${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  
         @ln -sf  ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))  
   
 ${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS}  
 #  
 #       create .o  
 #  
         @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})  
         @${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_YODA}/include/utils/ -I${NROOTINC};  
 #  
 #       create .so  
 #  
         @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET})  
         @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ ${DIRTOP}/${DIRLIB}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${FOBJS} ${COBJS} 1>/dev/null  
         @ln -sf  ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F))  
   
 ${CXXEXELIBS}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS}  
         @(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET})  
         @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRLIB}/$@.o ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} ${TRKOBJS} ${CPPOBJS} ${COBJS} ${FOBJS} ${PAM_YODA}/lib/libyoda.so ${PAM_YODA}/lib/libutils.so -lThread `root-config --cflags --glibs` `cernlib mathlib`  
99    
100  # A small target to check environmental variables  # A small target to check environmental variables
101  %_env:  %_env:
# Line 264  installdoc: Line 177  installdoc:
177          @${test_and_cp}          @${test_and_cp}
178    
179  mkverpath:  mkverpath:
180          @echo '#include <TSystem.h>' >  ${DIRTOP}/${DIRSRC}/S4Verl2.cpp; echo ' char *S4Info(bool print){ if ( print ) printf("\nS4 Level2 flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >>  ${DIRTOP}/${DIRSRC}/S4Verl2.cpp          @echo '#include <TSystem.h>' >  ${DIRTOP}/${DIRSRC}/S4Verl2.cpp; echo 'const char *S4Info(bool print){ if ( print ) printf("\nS4 Level2 flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >>  ${DIRTOP}/${DIRSRC}/S4Verl2.cpp
181          @sleep 0.8          @sleep 0.8
182    
183    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.23