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

Diff of /DarthVader/CalorimeterLevel2/Makefile

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

revision 1.17 by mocchiut, Mon Jan 22 09:25:30 2007 UTC revision 1.43 by mocchiut, Tue Aug 4 14:01:17 2009 UTC
# Line 1  Line 1 
1  # Calorimeter flight analysis software  # Calorimeter flight analysis software
2  # SOFTWARE VERSION  # SOFTWARE VERSION
3  VER= v4r04  VER= v6r00
4  # An almost general purpouse Makefile for PAMELA repository  #
5  # Let's start with some usefull definition for colorize the echo  include ../Make.def
6  RED='\E[1;31;40m'  #
7  GREEN='\E[1;32;40m'  ifeq ($(GCC4),)
8  YELLOW='\E[1;33;40m'          EXTRAOPT=-Wno-globals -fvxt
9  BLUE='\E[1;34;40m'  else
10  WHITE='\E[1;37;40m'          EXTRAOPT=
11  VIOLET='\E[1;35;40m'  endif
12  CYAN='\E[1;36;40m'  #F77FLAGS=  -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash ${PAM_BIT}
13  # Here the echo definition to use them  #F77FLAGS= -fforce-addr -funroll-all-loops -ffinite-math-only -Wall -funroll-loops -Wno-globals -fPIC -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT}
14  EVIOLET=echo -e ${VIOLET}  F77FLAGS= -O1 -fforce-addr -funroll-all-loops -ffinite-math-only -Wall -funroll-loops -fPIC $(EXTRAOPT) -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT}
15  ECYAN=echo -e ${CYAN}  #F77FLAGS= -g -fforce-addr -funroll-all-loops -ffinite-math-only -Wall -funroll-loops -Wno-globals -fPIC -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT}
16  ERED=echo -e ${RED}  #F77FLAGS= -Wall -Wno-globals -fPIC -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT}
 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 -O4 -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 -fPIC -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash  
 # C++  
 CXX=g++  
 #CXXFLAGS=-Wall -O -fPIC -pthread -g  
 CXXFLAGS=-Wall -O4 -fPIC -pthread  
 # ROOTCINT  
 ROOTCINT=rootcint  
17  # Here the variables definig the local directories  # Here the variables definig the local directories
18  DIRTOP=${shell pwd}  DIRTOP=${shell pwd}
19  DIRLIB=../lib/${ARCH}  DIRLIB=../lib/${ARCH}
# Line 61  FSRCS=${DIRSRC}/direction.for \ Line 36  FSRCS=${DIRSRC}/direction.for \
36        ${DIRSRC}/nshower.for \        ${DIRSRC}/nshower.for \
37        ${DIRSRC}/nointer.for \        ${DIRSRC}/nointer.for \
38        ${DIRSRC}/elio.for \        ${DIRSRC}/elio.for \
39          ${DIRSRC}/nuclei.for \
40        ${DIRSRC}/cluster.for \        ${DIRSRC}/cluster.for \
41        ${DIRSRC}/cluster2.for \        ${DIRSRC}/cluster2.for \
42          ${DIRSRC}/cluster4.for \
43        ${DIRSRC}/laterale.for \        ${DIRSRC}/laterale.for \
44        ${DIRSRC}/baric.for \        ${DIRSRC}/baric.for \
45        ${DIRSRC}/selftrig.for \        ${DIRSRC}/selftrig.for \
# Line 79  CSRCS=${DIRSRC}/delay.c Line 56  CSRCS=${DIRSRC}/delay.c
56  COBJS=$(CSRCS:${DIRSRC}%.c=${DIRLIB}%.o)  COBJS=$(CSRCS:${DIRSRC}%.c=${DIRLIB}%.o)
57    
58  # -- CPP - ROOT libraries --  # -- CPP - ROOT libraries --
59  LIBROOTSRCS=${DIRSRC}/CaloLevel1.cpp \  LIBROOTSRCS=${DIRSRC}/CaloLevel0.cpp \
60                ${DIRSRC}/CaloLevel1.cpp \
61              ${DIRSRC}/CaloLevel2.cpp              ${DIRSRC}/CaloLevel2.cpp
62    
63  LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)  LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
64  LIBROOTOBJS=${DIRLIB}/millim.o  #LIBROOTOBJS=${DIRLIB}/millim.o
65  LIBROOTCLIBS=libCaloLevel2 libCaloLevel1  LIBROOTOBJS=${FOBJS} ${COBJS}
66    LIBROOTCLIBS=libCaloLevel2 libCaloLevel1 libCaloLevel0
67  FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so)  FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so)
68    
69  # -- CPP - NON-ROOT libraries --  # -- CPP - NON-ROOT libraries --
70  LIBCPPSRCS=${DIRSRC}/CaloProcessing.cpp \  LIBCPPSRCS=${DIRSRC}/CaloCore.cpp \
            ${DIRSRC}/CaloCore.cpp \  
71             ${DIRSRC}/CaloVerl2.cpp             ${DIRSRC}/CaloVerl2.cpp
72  LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)  LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so)
73  LIBCPPCLIBS=libCaloProcessing libCaloCore libCaloVerl2  LIBCPPCLIBS=libCaloCore libCaloVerl2
74  FULLLIBCPPLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so)  FULLLIBCPPLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so)
75    
76  # -- CPP - Executables --  # -- CPP - Executables --
# Line 113  FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPP Line 91  FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPP
91  # Other objects to install  # Other objects to install
92  EXESRCS=${DIRBIN}/CalorimeterLevel2  EXESRCS=${DIRBIN}/CalorimeterLevel2
93    
94  INCSRCS=${DIRINC}/CaloLevel1.h ${DIRINC}/CaloLevel2.h ${DIRINC}/CaloStruct.h ${DIRINC}/CaloProcessing.h ${DIRINC}/CaloCore.h  INCSRCS=${DIRINC}/CaloLevel0.h ${DIRINC}/CaloLevel1.h ${DIRINC}/CaloLevel2.h ${DIRINC}/CaloStruct.h ${DIRINC}/CaloCore.h ${DIRINC}/INTEST.TXT
95    
96  MACROSSRCS=  MACROSSRCS=
97    
# Line 138  NROOTINC=${shell root-config --incdir} Line 116  NROOTINC=${shell root-config --incdir}
116  #all: test mkbindir mklibdir mkverpath ${FOBJS} ${CPPOBJS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS}  #all: test mkbindir mklibdir mkverpath ${FOBJS} ${CPPOBJS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS}
117  all: prepare libs  all: prepare libs
118  all:  all:
119          @echo -e ${GREEN} ""  #       @echo -e ${GREEN} ""
120          @(${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})
121          @echo -e ${GREEN} ""          @echo -e ${GREEN} ""
122          @${RESET}          @${RESET}
123    
# Line 150  prepare: test mkbindir mklibdir mkverpat Line 128  prepare: test mkbindir mklibdir mkverpat
128  exe: prepare ${CXXEXELIBS}  exe: prepare ${CXXEXELIBS}
129    
130  libs: prepare ${LIBROOTLIBS} ${LIBCPPLIBS}  libs: prepare ${LIBROOTLIBS} ${LIBCPPLIBS}
   
 # Here some general rules to produce objects in our local dir  
 ${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_INC}/ `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_INC}/ `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} ${FOBJS}  
         @(${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_INC}/ ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`.h ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`LinkDef.h  
 #  
 #       create .o  
131  #  #
132          @(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET})  include ../Make.dect
         @${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};  
         @(${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_INC}/ -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} -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  
         @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} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ -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} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ ${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} ${CPPOBJS} ${FOBJS} ${TRKOBJS} ${PAM_YODA}/lib/libyoda.so -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -lThread `root-config --cflags --glibs` `cernlib mathlib`  
         @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRLIB}/$@.o ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} ${TRKOBJS} ${CPPOBJS} ${COBJS} ${FOBJS} ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` `cernlib mathlib`  
   
133  # A small target to check environmental variables  # A small target to check environmental variables
134  %_env:  %_env:
135          @${test_env}          @${test_env}

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.43

  ViewVC Help
Powered by ViewVC 1.1.23