1 |
# RunInfo software |
# RunInfo software |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v1r02 |
VER= v2r02 |
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} |
15 |
# Here the PAMELA environmental variables to be checked |
# Here the PAMELA environmental variables to be checked |
16 |
PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env |
PAM_ENV= PAM_BIN_env PAM_LIB_env PAM_INC_env PAM_DOC_env |
17 |
# |
# |
18 |
SUBDIR=../GLTables |
SUBDIR= |
19 |
SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done) |
SUBINC=-I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ |
20 |
|
#SUBINC=$(shell for dir in `echo ${SUBDIR}`; do echo -I$${dir}/inc; done) |
21 |
|
|
22 |
# Here the local variables used to build the targets |
# Here the local variables used to build the targets |
23 |
# -- F77 - no libraries -- |
# -- F77 - no libraries -- |
53 |
CXXEXELIBS=RunInfoLevel2 |
CXXEXELIBS=RunInfoLevel2 |
54 |
|
|
55 |
# Other needed libraries |
# Other needed libraries |
56 |
OTHOBJS = ${DIRLIB}/libGLTables.so |
OTHOBJS = ${PAM_LIB}/libGLTables.so |
57 |
|
|
58 |
# List of all libraries we want to install |
# List of all libraries we want to install |
59 |
FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} |
FULLLIBS = ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} |
61 |
# Other objects to install |
# Other objects to install |
62 |
EXESRCS=${DIRBIN}/RunInfoLevel2 |
EXESRCS=${DIRBIN}/RunInfoLevel2 |
63 |
|
|
64 |
INCSRCS=${DIRINC}/RunInfo.h ${DIRINC}/RunInfoCore.h |
INCSRCS=${DIRINC}/RunInfo.h ${DIRINC}/RunInfoCore.h ${DIRINC}/RunInfoStruct.h |
65 |
|
|
66 |
MACROSSRCS= |
MACROSSRCS= |
67 |
|
|
87 |
all: prepare libs |
all: prepare libs |
88 |
all: |
all: |
89 |
@echo -e ${GREEN} "" |
@echo -e ${GREEN} "" |
|
@(${EGREEN} " Finished, now you can install the package \n (use: make install or make upgrade or make forceinstall) "; ${RESET}) |
|
|
@echo -e ${GREEN} "" |
|
90 |
@${RESET} |
@${RESET} |
91 |
|
|
92 |
standalone: all exe |
standalone: all exe |
97 |
|
|
98 |
libs: prepare ${LIBROOTLIBS} ${LIBCPPLIBS} |
libs: prepare ${LIBROOTLIBS} ${LIBCPPLIBS} |
99 |
|
|
100 |
# 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/wizard3/pamela/sw/src/offline/pamlevel2/calorimeter/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} -I${SUBINC} `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} ${SUBINC} ${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${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${NROOTINC}; |
|
|
# |
|
|
# create .so |
|
|
# |
|
|
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
|
|
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${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${NROOTINC}; |
|
|
# |
|
|
# create .so |
|
|
# |
|
|
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
|
|
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} ${SUBINC} ${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} "`basename $@ Level2`"; ${RESET}) |
|
|
@${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRLIB}/$@.o ${OTHOBJS} ${FULLROOTCLIBS} ${FULLLIBCPPLIBS} ${CPPOBJS} ${FOBJS} ${PAM_YODA}/lib/libyoda.so -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -lThread `root-config --cflags --glibs` `cernlib mathlib` |
|
101 |
|
|
102 |
# A small target to check environmental variables |
# A small target to check environmental variables |
103 |
%_env: |
%_env: |
229 |
else \ |
else \ |
230 |
${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\ |
${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\ |
231 |
${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \ |
${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \ |
232 |
cp -f ${ORIGIN}/$${i##/*/} $${i}; \ |
cp -rf ${ORIGIN}/$${i##/*/} $${i}; \ |
233 |
fi; \ |
fi; \ |
234 |
else \ |
else \ |
235 |
${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\ |
${EYELLOW} " Forcing copy: "${WHITE} ${ORIGIN}/$${i##/*/} ;\ |
236 |
${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \ |
${EYELLOW} " to: "${WHITE} $${i} ; ${RESET}; \ |
237 |
cp ${FORCE} ${ORIGIN}/$${i##/*/} $${i}; \ |
cp -rf ${FORCE} ${ORIGIN}/$${i##/*/} $${i}; \ |
238 |
fi;\ |
fi;\ |
239 |
fi ;\ |
fi ;\ |
240 |
if [ ! -z ${LINK} ] ; then \ |
if [ ! -z ${LINK} ] ; then \ |