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

Diff of /DarthVader/AnticounterLevel2/Makefile

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

revision 1.1 by mocchiut, Fri May 19 13:15:59 2006 UTC revision 1.20 by mocchiut, Thu Aug 28 13:43:33 2014 UTC
# Line 1  Line 1 
1  # AC flight analysis software  # AC flight analysis software
2  # SOFTWARE VERSION  # SOFTWARE VERSION
3  VER= v1r00  VER= v2r05
4  # An almost general purpouse Makefile for PAMELA repository  #
5  # Let's start with some usefull definition for colorize the echo  include ../Make.def
 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  
6  # Here the variables definig the local directories  # Here the variables definig the local directories
7  DIRTOP=${shell pwd}  DIRTOP=${shell pwd}
8  DIRLIB=../lib/${ARCH}  DIRLIB=../lib/${ARCH}
# Line 84  CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=$ Line 48  CXXEXEOBJS=$(CXXEXESRCS:${DIRSRC}%.cpp=$
48  CXXEXELIBS=AnticounterLevel2  CXXEXELIBS=AnticounterLevel2
49    
50  # -- list of "external" objects needed to link  # -- list of "external" objects needed to link
51  OTHOBJS=${DIRLIB}/libGLTables.so ${DIRLIB}/libRunInfo.so  OTHOBJS=${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so
52    
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    
57  # List of all libraries we want to install  # List of all libraries we want to install
# Line 96  FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPP Line 60  FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPP
60  # Other objects to install  # Other objects to install
61  EXESRCS=${DIRBIN}/AnticounterLevel2  EXESRCS=${DIRBIN}/AnticounterLevel2
62    
63  INCSRCS=${DIRINC}/AcLevel2.h  INCSRCS=${DIRINC}/AcLevel2.h ${DIRINC}/AcStruct.h
64    
65  MACROSSRCS=  MACROSSRCS=
66    
# Line 121  NROOTINC=${shell root-config --incdir} Line 85  NROOTINC=${shell root-config --incdir}
85  #all: test mkbindir mklibdir mkverpath ${FOBJS} ${CPPOBJS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS}  #all: test mkbindir mklibdir mkverpath ${FOBJS} ${CPPOBJS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS}
86  all: prepare libs  all: prepare libs
87  all:  all:
88          @echo -e ${GREEN} ""  #       @echo -e ${GREEN} ""
89          @(${EGREEN} " Finished, now you can install the package \n  (use: make install or make upgrade or make forceinstall) "; ${RESET})  #       @(${EGREEN} " Finished, now you can install the package \n  (use: make install or make upgrade or make forceinstall) "; ${RESET})
90          @echo -e ${GREEN} ""          @echo -e ${GREEN} ""
91          @${RESET}          @${RESET}
92    
# Line 134  exe: prepare ${CXXEXELIBS} Line 98  exe: prepare ${CXXEXELIBS}
98    
99  libs: prepare ${LIBROOTLIBS} ${LIBCPPLIBS}  libs: prepare ${LIBROOTLIBS} ${LIBCPPLIBS}
100    
101  # 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/ `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/ `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/ ${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${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${NROOTINC};  
 #  
 #       @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})  
 #       @cd ${DIRSRC} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _${VER}.so | sed s/lib//`.cpp -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ -I${NROOTINC};  
 #       @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET})  
 #       @cd ${DIRSRC} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ -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/ ${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${NROOTINC};  
 #       @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})  
 #       @cd ${DIRSRC} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _${VER}.so | sed s/lib//`.cpp -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ -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/ ${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))  
   
 #       @(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET})  
 #       @${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${FOBJS} ${COBJS} 1>/dev/null  
   
 ${CXXEXELIBS}: ${CPPOBJS} ${FOBJS} ${COBJS} ${CXXEXEOBJS}  
         @(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET})  
         @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRLIB}/$@.o ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} ${OTHOBJS} ${CPPOBJS} ${COBJS} ${FOBJS} ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` `cernlib mathlib`  
   
102  # A small target to check environmental variables  # A small target to check environmental variables
103  %_env:  %_env:
104          @${test_env}          @${test_env}
# Line 275  installdoc: Line 178  installdoc:
178          @${test_and_cp}          @${test_and_cp}
179    
180  mkverpath:  mkverpath:
181          @echo '#include <TSystem.h>' >  ${DIRTOP}/${DIRSRC}/AcVerl2.cpp; echo ' char *AcInfo(bool print){ if ( print ) printf("\nAnticounter Level2 flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >>  ${DIRTOP}/${DIRSRC}/AcVerl2.cpp          @echo '#include <TSystem.h>' >  ${DIRTOP}/${DIRSRC}/AcVerl2.cpp; echo 'const char *AcInfo(bool print){ if ( print ) printf("\nAnticounter Level2 flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >>  ${DIRTOP}/${DIRSRC}/AcVerl2.cpp
182          @sleep 0.8          @sleep 0.8
183    
184    

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

  ViewVC Help
Powered by ViewVC 1.1.23