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

Diff of /DarthVader/OrbitalInfo/Makefile

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

revision 1.2 by mocchiut, Fri May 19 14:36:37 2006 UTC revision 1.32 by pam-mep, Fri Mar 28 20:47:14 2014 UTC
# Line 1  Line 1 
1  #Orbital Information for flight analysis software  #Orbital Information for flight analysis software
2  # SOFTWARE VERSION  # SOFTWARE VERSION
3  VER= v0r01  <<<<<<< Makefile
4  # An almost general purpouse Makefile for PAMELA repository  VER= v4r02
5  # Let's start with some usefull definition for colorize the echo  =======
6  RED='\E[1;31;40m'  VER= v4r05
7  GREEN='\E[1;32;40m'  >>>>>>> 1.31
8  YELLOW='\E[1;33;40m'  #
9  BLUE='\E[1;34;40m'  include ../Make.def
 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  
10  # Here the variables definig the local directories  # Here the variables definig the local directories
11  DIRTOP=${shell pwd}  DIRTOP=${shell pwd}
12  DIRLIB=../lib/${ARCH}  DIRLIB=../lib/${ARCH}
# Line 53  DIRCALIB=calib Line 21  DIRCALIB=calib
21  # Here the  PAMELA environmental variables to be checked  # Here the  PAMELA environmental variables to be checked
22  PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env PAM_YODA_env  PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env PAM_YODA_env
23    
24    F77FLAGS=  -Wall -funroll-loops -fPIC $(EXTRAOPT) -fno-automatic -extend_source -fno-bounds-check -static -fno-backslash ${PAM_BIT}
25    
26  # Here the local variables used to build the targets  # Here the local variables used to build the targets
27  # -- F77 - no libraries --  # -- F77 - no libraries --
28  FSRCS=  FSRCS=${DIRSRC}/igrf_sub.for
29  FOBJS=$(FSRCS:${DIRSRC}%.for=${DIRLIB}%.o)  FOBJS=$(FSRCS:${DIRSRC}%.for=${DIRLIB}%.o)
30    
31  # -- CPP - no libraries --  # -- CPP - no libraries --
# Line 67  CSRCS= Line 37  CSRCS=
37  COBJS=$(CSRCS:${DIRSRC}%.c=${DIRLIB}%.o)  COBJS=$(CSRCS:${DIRSRC}%.c=${DIRLIB}%.o)
38    
39  # -- CPP - ROOT libraries --  # -- CPP - ROOT libraries --
40  LIBROOTSRCS=${DIRSRC}/OrbitalInfo.cpp  LIBROOTSRCS=${DIRSRC}/OrbitalInfo.cpp \
41                ${DIRSRC}/InclinationInfo.cpp \
42                ${DIRSRC}/OrientationInfo.cpp
43    
44  LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)  LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
45  LIBROOTCLIBS=libOrbitalInfo  LIBROOTCLIBS=libOrbitalInfo libInclinationInfo libOrientationInfo
46  FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so)  FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so)
47    
48  # -- CPP - NON-ROOT libraries --  # -- CPP - NON-ROOT libraries --
# Line 89  CXXEXELIBS:=OrbitalInfoLevel2 Line 61  CXXEXELIBS:=OrbitalInfoLevel2
61  #TRKOBJS=${DIRTOP}/../lib2/libTrkLevel2.so ${DIRTOP}/../lib2/libtrack.so  #TRKOBJS=${DIRTOP}/../lib2/libTrkLevel2.so ${DIRTOP}/../lib2/libtrack.so
62  #TRKOBJS=${PAM_LIB}/libTrkLevel2.so ${PAM_LIB}/libtrack.so ${PAM_LIB}/libreadB.so ${PAM_LIB}/libinterB.so ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libRunInfo.so  #TRKOBJS=${PAM_LIB}/libTrkLevel2.so ${PAM_LIB}/libtrack.so ${PAM_LIB}/libreadB.so ${PAM_LIB}/libinterB.so ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libRunInfo.so
63  #TRKOBJS=  #TRKOBJS=
64  OTHERLIBS=${DIRLIB}/libGLTables.so ${DIRLIB}/libRunInfo.so  OTHERLIBS=${PAM_LIB}/libGLTables.so ${DIRLIB}/libRunInfo.so ${DIRLIB}/libToFLevel2.so
65  # -- directory where to find tracker headers needed to compile  # -- directory where to find tracker headers needed to compile
66  #TRKHEAD=${DIRTOP}/../tracker/inc  #TRKHEAD=${DIRTOP}/../tracker/inc
67  #TRKHEAD=${PAM_INC}  #TRKHEAD=${PAM_INC}
68  SUBDIR=../GLTables ../RunInfo  SUBDIR=../RunInfo ../ToFLevel2 ../TrackerLevel2 ../TriggerLevel2
69  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)
70    
71  # List of all libraries we want to install  # List of all libraries we want to install
# Line 102  FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPP Line 74  FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPP
74  # Other objects to install  # Other objects to install
75  EXESRCS=${DIRBIN}/OrbitalInfoLevel2  EXESRCS=${DIRBIN}/OrbitalInfoLevel2
76    
77  INCSRCS=${DIRINC}/OrbitalInfo.h  INCSRCS=${DIRINC}/OrbitalInfo.h ${DIRINC}/OrbitalInfoStruct.h ${DIRINC}/InclinationInfo.h ${DIRINC}/OrientationInfo.h
78    
79  MACROSSRCS=  MACROSSRCS=
80    
# Line 127  NROOTINC=${shell root-config --incdir} Line 99  NROOTINC=${shell root-config --incdir}
99  #all: test mkbindir mklibdir mkverpath ${FOBJS} ${CPPOBJS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS}  #all: test mkbindir mklibdir mkverpath ${FOBJS} ${CPPOBJS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS}
100  all: prepare libs  all: prepare libs
101  all:  all:
102          @echo -e ${GREEN} ""  #       @echo -e ${GREEN} ""
103          @(${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})
104          @echo -e ${GREEN} ""          @echo -e ${GREEN} ""
105          @${RESET}          @${RESET}
106    
# Line 140  exe: prepare ${CXXEXELIBS} Line 112  exe: prepare ${CXXEXELIBS}
112    
113  libs: prepare ${LIBROOTLIBS} ${LIBCPPLIBS}  libs: prepare ${LIBROOTLIBS} ${LIBCPPLIBS}
114    
115  # 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/ `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};  
 #  
 #       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};  
 #  
 #       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))  
   
 ${CXXEXELIBS}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS}  
         @(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET})  
         @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRLIB}/$@.o ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} ${OTHERLIBS} ${CPPOBJS} ${COBJS} ${FOBJS} ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` `cernlib mathlib`  
   
116  # A small target to check environmental variables  # A small target to check environmental variables
117  %_env:  %_env:
118          @${test_env}          @${test_env}
# Line 269  installdoc: Line 192  installdoc:
192          @${test_and_cp}          @${test_and_cp}
193    
194  mkverpath:  mkverpath:
195          @echo '#include <TSystem.h>' >  ${DIRTOP}/${DIRSRC}/OrbitalInfoVerl2.cpp; echo ' char *OrbitalInfoInfo(bool print){ if ( print ) printf("\nOrbitalInfo flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >>  ${DIRTOP}/${DIRSRC}/OrbitalInfoVerl2.cpp          @echo '#include <TSystem.h>' >  ${DIRTOP}/${DIRSRC}/OrbitalInfoVerl2.cpp; echo 'const char *OrbitalInfoInfo(bool print){ if ( print ) printf("\nOrbitalInfo flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >>  ${DIRTOP}/${DIRSRC}/OrbitalInfoVerl2.cpp
196          @sleep 0.8          @sleep 0.8
197    
198    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.32

  ViewVC Help
Powered by ViewVC 1.1.23