1 |
# Calorimeter flight analysis software |
# Calorimeter flight analysis software |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v3r08 |
VER= v4r04 |
4 |
# An almost general purpouse Makefile for PAMELA repository |
# An almost general purpouse Makefile for PAMELA repository |
5 |
# Let's start with some usefull definition for colorize the echo |
# Let's start with some usefull definition for colorize the echo |
6 |
RED='\E[1;31;40m' |
RED='\E[1;31;40m' |
24 |
# C |
# C |
25 |
CC=gcc |
CC=gcc |
26 |
#CFLAGS=-Wall -O -fPIC -pthread -g |
#CFLAGS=-Wall -O -fPIC -pthread -g |
27 |
CFLAGS=-Wall -O -fPIC -pthread |
CFLAGS=-Wall -O4 -fPIC -pthread |
28 |
# Enviroment: |
# Enviroment: |
29 |
GCCVER=`gcc --version | head -1` |
GCCVER=`gcc --version | head -1` |
30 |
UNAMEA=`uname -a` |
UNAMEA=`uname -a` |
32 |
# F77 |
# F77 |
33 |
F77=g77 |
F77=g77 |
34 |
#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 |
35 |
F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash |
F77FLAGS= -Wall -Wno-globals -fPIC -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash |
36 |
# C++ |
# C++ |
37 |
CXX=g++ |
CXX=g++ |
38 |
#CXXFLAGS=-Wall -O -fPIC -pthread -g |
#CXXFLAGS=-Wall -O -fPIC -pthread -g |
39 |
CXXFLAGS=-Wall -O -fPIC -pthread |
CXXFLAGS=-Wall -O4 -fPIC -pthread |
40 |
# ROOTCINT |
# ROOTCINT |
41 |
ROOTCINT=rootcint |
ROOTCINT=rootcint |
42 |
# Here the variables definig the local directories |
# Here the variables definig the local directories |
61 |
${DIRSRC}/nshower.for \ |
${DIRSRC}/nshower.for \ |
62 |
${DIRSRC}/nointer.for \ |
${DIRSRC}/nointer.for \ |
63 |
${DIRSRC}/elio.for \ |
${DIRSRC}/elio.for \ |
64 |
|
${DIRSRC}/nuclei.for \ |
65 |
${DIRSRC}/cluster.for \ |
${DIRSRC}/cluster.for \ |
66 |
${DIRSRC}/cluster2.for \ |
${DIRSRC}/cluster2.for \ |
67 |
${DIRSRC}/laterale.for \ |
${DIRSRC}/laterale.for \ |
80 |
COBJS=$(CSRCS:${DIRSRC}%.c=${DIRLIB}%.o) |
COBJS=$(CSRCS:${DIRSRC}%.c=${DIRLIB}%.o) |
81 |
|
|
82 |
# -- CPP - ROOT libraries -- |
# -- CPP - ROOT libraries -- |
83 |
LIBROOTSRCS=${DIRSRC}/CaloLevel2.cpp |
LIBROOTSRCS=${DIRSRC}/CaloLevel1.cpp \ |
84 |
|
${DIRSRC}/CaloLevel2.cpp |
85 |
|
|
86 |
LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) |
LIBROOTLIBS=$(LIBROOTSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) |
87 |
LIBROOTCLIBS=libCaloLevel2 |
LIBROOTOBJS=${DIRLIB}/millim.o |
88 |
|
LIBROOTCLIBS=libCaloLevel2 libCaloLevel1 |
89 |
FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so) |
FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so) |
90 |
|
|
91 |
# -- CPP - NON-ROOT libraries -- |
# -- CPP - NON-ROOT libraries -- |
114 |
# Other objects to install |
# Other objects to install |
115 |
EXESRCS=${DIRBIN}/CalorimeterLevel2 |
EXESRCS=${DIRBIN}/CalorimeterLevel2 |
116 |
|
|
117 |
INCSRCS=${DIRINC}/CaloLevel2.h ${DIRINC}/CaloStruct.h ${DIRINC}/CaloProcessing.h ${DIRINC}/CaloCore.h |
INCSRCS=${DIRINC}/CaloLevel1.h ${DIRINC}/CaloLevel2.h ${DIRINC}/CaloStruct.h ${DIRINC}/CaloProcessing.h ${DIRINC}/CaloCore.h |
118 |
|
|
119 |
MACROSSRCS= |
MACROSSRCS= |
120 |
|
|
165 |
@(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET}) |
166 |
@${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.for -I${DIRINC} |
@${F77} ${F77FLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.for -I${DIRINC} |
167 |
|
|
168 |
${LIBROOTLIBS}: ${LIBROOTSRCS} |
${LIBROOTLIBS}: ${LIBROOTSRCS} ${FOBJS} |
169 |
@(${EGREEN} "ROOTCINT - creating file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) |
@(${EGREEN} "ROOTCINT - creating file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) |
170 |
# |
# |
171 |
# Create *Dict.cpp and *Dict.h |
# Create *Dict.cpp and *Dict.h |
182 |
# create .so |
# create .so |
183 |
# |
# |
184 |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
185 |
@${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 1>/dev/null |
@${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 |
186 |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
187 |
|
|
188 |
${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS} |
${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS} |