1 |
# YodaProfiler |
# YodaProfiler |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v1r00 |
VER= v2r00 |
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 |
MAKE=make |
MAKE=make |
26 |
# C |
# C |
27 |
CC=gcc |
CC=gcc |
28 |
CFLAGS=-Wall -O -fPIC -pthread -g |
#CFLAGS=-Wall -O -fPIC -pthread -g |
29 |
#CFLAGS=-Wall -O -fPIC -pthread |
CFLAGS=-Wall -O -fPIC -pthread |
30 |
# Enviroment: |
# Enviroment: |
31 |
GCCVER=`gcc --version | head -1` |
GCCVER=`gcc --version | head -1` |
32 |
UNAMEA=`uname -a` |
UNAMEA=`uname -a` |
37 |
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash |
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash |
38 |
# C++ |
# C++ |
39 |
CXX=g++ |
CXX=g++ |
40 |
CXXFLAGS=-Wall -O -fPIC -pthread -g |
#CXXFLAGS=-Wall -O -fPIC -pthread -g |
41 |
#CXXFLAGS=-Wall -O -fPIC -pthread |
CXXFLAGS=-Wall -O -fPIC -pthread |
42 |
# ROOTCINT |
# ROOTCINT |
43 |
ROOTCINT=rootcint |
ROOTCINT=rootcint |
44 |
# Here the variables definig the local directories |
# Here the variables definig the local directories |
62 |
|
|
63 |
# -- CPP - no libraries -- |
# -- CPP - no libraries -- |
64 |
CPPSRCS=${DIRSRC}/YodaProfilerVerl2.cpp \ |
CPPSRCS=${DIRSRC}/YodaProfilerVerl2.cpp \ |
65 |
${DIRSRC}/PamelaDBOperations.cpp |
${DIRSRC}/PamelaDBOperations.cpp |
66 |
CPPOBJS=$(CPPSRCS:${DIRSRC}%.cpp=${DIRLIB}%.o) |
CPPOBJS=$(CPPSRCS:${DIRSRC}%.cpp=${DIRLIB}%.o) |
67 |
|
|
68 |
# -- C - no libraries -- |
# -- C - no libraries -- |
77 |
FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so) |
FULLROOTCLIBS=$(LIBROOTCLIBS:%=${DIRLIB}/%_${VER}.so) |
78 |
|
|
79 |
# -- CPP - NON-ROOT libraries -- |
# -- CPP - NON-ROOT libraries -- |
80 |
LIBCPPSRCS= |
LIBCPPSRCS=${DIRSRC}/sgp4.cpp |
81 |
LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) |
LIBCPPLIBS=$(LIBCPPSRCS:${DIRSRC}/%.cpp=${DIRLIB}/lib%_${VER}.so) |
82 |
LIBCPPCLIBS= |
LIBCPPCLIBS=libsgp4 |
83 |
FULLLIBCPPLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so) |
FULLLIBCPPLIBS=$(LIBCPPCLIBS:%=${DIRLIB}/%_${VER}.so) |
84 |
|
|
85 |
# -- CPP - Executables -- |
# -- CPP - Executables -- |
93 |
# Other objects to install |
# Other objects to install |
94 |
EXESRCS=${DIRBIN}/YodaProfiler |
EXESRCS=${DIRBIN}/YodaProfiler |
95 |
|
|
96 |
INCSRCS=${DIRINC}/GLTables.h ${DIRINC}/GLTablesStruct.h |
INCSRCS=${DIRINC}/GLTables.h ${DIRINC}/GLTablesStruct.h ${DIRINC}/sgp4.h |
97 |
|
|
98 |
MACROSSRCS= |
MACROSSRCS= |
99 |
|
|
125 |
# Here some general rules to produce objects in our local dir |
# Here some general rules to produce objects in our local dir |
126 |
${DIRLIB}/%.o: ${DIRSRC}/%.cpp |
${DIRLIB}/%.o: ${DIRSRC}/%.cpp |
127 |
@(${EGREEN} "Creating CPP object file: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating CPP object file: "${WHITE} "`basename $@`"; ${RESET}) |
128 |
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.cpp -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ `root-config --cflags` |
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.cpp -I${DIRINC} ${SUBINC} -I${PAM_YODA}/include/yoda/ `root-config --cflags` |
129 |
|
|
130 |
${DIRLIB}/%.o: ${DIRSRC}/%.c |
${DIRLIB}/%.o: ${DIRSRC}/%.c |
131 |
@(${EGREEN} "Creating C object file: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating C object file: "${WHITE} "`basename $@`"; ${RESET}) |
132 |
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.c -I${DIRINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ `root-config --cflags` |
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/`basename ${@} .o`.c -I${DIRINC} -I${PAM_YODA}/include/yoda/ `root-config --cflags` |
133 |
|
|
134 |
${DIRLIB}/%.o: ${DIRSRC}/%.for |
${DIRLIB}/%.o: ${DIRSRC}/%.for |
135 |
@(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating F77 object file: "${WHITE} "`basename $@`"; ${RESET}) |
140 |
# |
# |
141 |
# Create *Dict.cpp and *Dict.h |
# Create *Dict.cpp and *Dict.h |
142 |
# |
# |
143 |
@${ROOTCINT} -f ${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -c -I${ROOTINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`.h ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`LinkDef.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 |
144 |
# |
# |
145 |
# create .o |
# create .o |
146 |
# |
# |
147 |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) |
148 |
@cd ${DIRSRC} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _${VER}.so | sed s/lib//`.cpp -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ -I${NROOTINC}; |
@cd ${DIRSRC} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _${VER}.so | sed s/lib//`.cpp -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${NROOTINC}; |
149 |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp"; ${RESET}) |
150 |
@cd ${DIRSRC} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _${VER}.so | sed s/lib//`Dict.cpp -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ -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_YODA}/include/yoda/ -I${NROOTINC}; |
151 |
# |
# |
152 |
# create .so |
# create .so |
153 |
# |
# |
154 |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
155 |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${DIRTOP}/${DIRSRC}/`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/ ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`Dict.o 1>/dev/null |
156 |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
157 |
|
|
158 |
${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS} |
${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS} |
160 |
# create .o |
# create .o |
161 |
# |
# |
162 |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) |
@(${EGREEN} "Compiling CPP file: "${WHITE} "`basename $(@F) _${VER}.so | sed s/lib//`.cpp"; ${RESET}) |
163 |
@cd ${DIRSRC} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _${VER}.so | sed s/lib//`.cpp -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ -I${NROOTINC} ${SUBINC}; |
@cd ${DIRSRC} &>/dev/null && ${CXX} ${CXXFLAGS} -c `basename $(@F) _${VER}.so | sed s/lib//`.cpp -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ -I${NROOTINC} ${SUBINC}; |
164 |
# |
# |
165 |
# create .so |
# create .so |
166 |
# |
# |
167 |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
168 |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${SUBINC} -I${PAM_YODA}/include/yoda/ -I${PAM_YODA}/include/utils/ ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${FOBJS} ${COBJS} 1>/dev/null |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${SUBINC} -I${PAM_YODA}/include/yoda/ ${DIRTOP}/${DIRSRC}/`basename $(@F) _${VER}.so | sed s/lib//`.o ${FOBJS} ${COBJS} 1>/dev/null |
169 |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
170 |
|
|
171 |
${CXXEXELIBS}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS} |
${CXXEXELIBS}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS} |
172 |
@(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) |
@(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) |
173 |
# @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${CPPOBJS} ${PAM_YODA}/lib/libyoda.so ${PAM_YODA}/lib/libutils.so -lThread `root-config --cflags --glibs` `cernlib mathlib` |
# @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${CPPOBJS} ${PAM_YODA}/lib/libyoda.so ${PAM_YODA}/lib/libutils.so -lThread `root-config --cflags --glibs` `cernlib mathlib` |
174 |
# @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${DIRTOP}/${DIRLIB}/libPacketTypeList.so ${DIRTOP}/${DIRLIB}/libGLTables.so ${CPPOBJS} ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` `cernlib mathlib` |
# @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${DIRTOP}/${DIRLIB}/libPacketTypeList.so ${DIRTOP}/${DIRLIB}/libGLTables.so ${CPPOBJS} ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` `cernlib mathlib` |
175 |
@${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${DIRTOP}/${DIRLIB}/libGLTables.so ${CPPOBJS} ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` `cernlib mathlib` |
|
176 |
|
# @${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${DIRTOP}/${DIRLIB}/libGLTables.so ${CPPOBJS} ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` `cernlib mathlib` |
177 |
|
@${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${DIRTOP}/${DIRLIB}/libGLTables.so ${DIRTOP}/${DIRLIB}/libsgp4.so ${CPPOBJS} ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` |
178 |
|
|
179 |
# A small target to check environmental variables |
# A small target to check environmental variables |
180 |
%_env: |
%_env: |