1 |
# Calorimeter profile plugin |
# Calorimeter profile plugin |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v3r00 |
VER= v3r02 |
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' |
25 |
CC=gcc |
CC=gcc |
26 |
#CFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT} |
#CFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT} |
27 |
CFLAGS=-Wall -O3 -fPIC -pthread ${PAM_BIT} |
CFLAGS=-Wall -O3 -fPIC -pthread ${PAM_BIT} |
28 |
|
#CFLAGS=-Wall -g -fPIC -pthread ${PAM_BIT} |
29 |
# Enviroment: |
# Enviroment: |
30 |
GCCVER=`gcc --version | head -1` |
GCCVER=`gcc --version | head -1` |
31 |
UNAMEA=`uname -a` |
UNAMEA=`uname -a` |
120 |
TOBEDEL = junk |
TOBEDEL = junk |
121 |
ROOTINC=$$${shell root-config --incdir} |
ROOTINC=$$${shell root-config --incdir} |
122 |
NROOTINC=${shell root-config --incdir} |
NROOTINC=${shell root-config --incdir} |
123 |
|
ROOTVERS=$(shell echo `root-config --version | sed 's/\./\ /g' | sed 's/\//\ /g' `) |
124 |
|
ROOTMAJ=$(word 1,$(ROOTVERS)) |
125 |
|
ROOTMIN=$(word 2,$(ROOTVERS)) |
126 |
# Let's start |
# Let's start |
127 |
all : test mkbindir mklibdir ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS} |
all : test mkbindir mklibdir ${LIBF77LIBS} ${LIBROOTLIBS} ${LIBCPPLIBS} ${CXXEXELIBS} |
128 |
all: |
all: |
129 |
@echo -e ${GREEN} "" |
@echo -e ${GREEN} "" |
130 |
@(${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}) |
131 |
@echo -e ${GREEN} "" |
@echo -e ${GREEN} "" |
132 |
|
@if [ ${ROOTMAJ} -lt 5 ]||([ ${ROOTMAJ} -eq 5 ]&&[ ${ROOTMIN} -lt 24 ]); then (${ERED} " W A R N I N G ! ! old ROOT version (${ROOTMAJ}.${ROOTMIN})\n The longitudinal fit will fail - upgrade ROOT to version >= 5.24! \n"; ${RESET}); fi; |
133 |
|
@echo -e ${GREEN} "" |
134 |
@${RESET} |
@${RESET} |
135 |
|
|
136 |
# Here some general rules to produce objects in our local dir |
# Here some general rules to produce objects in our local dir |
167 |
# create .o |
# create .o |
168 |
# |
# |
169 |
@(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) |
@(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) |
170 |
@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}; |
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}; |
171 |
@(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) |
@(${EGREEN} "Compiling file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) |
172 |
@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}; |
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}; |
173 |
# |
# |
174 |
# create .so |
# create .so |
175 |
# |
# |
176 |
@(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET}) |
@(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET}) |
177 |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $(LG2C) -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda -I${PAM_INC} ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.o ${LIBROOTOBJS} `doc/cernlib_pam mathlib` 1>/dev/null |
${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $(LG2C) -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda -I${PAM_INC} ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.o ${LIBROOTOBJS} `doc/cernlib_pam mathlib` 1>/dev/null |
178 |
# @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
# @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
179 |
|
|
180 |
${LIBCPPLIBS}: ${LIBCPPSRCS} |
${LIBCPPLIBS}: ${LIBCPPSRCS} |