1 |
# Calorimeter flight analysis software |
# PamelaLevel2 software |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v4r01 |
VER= v9r00 |
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' |
23 |
# Here the variables used to override the standard make flags |
# Here the variables used to override the standard make flags |
24 |
# C |
# C |
25 |
CC=gcc |
CC=gcc |
26 |
#CFLAGS=-Wall -O -fPIC -pthread -g |
#CFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT} |
27 |
CFLAGS=-Wall -O -fPIC -pthread |
CFLAGS=-Wall -O4 -fPIC -pthread ${PAM_BIT} |
28 |
# Enviroment: |
# Enviroment: |
29 |
GCCVER=`gcc --version | head -1` |
GCCVER=`gcc --version | head -1` |
30 |
UNAMEA=`uname -a` |
UNAMEA=`uname -a` |
31 |
TODAY=`date` |
TODAY=`date` |
32 |
# F77 |
ifeq ($(GCC4),) |
33 |
|
export GCCVERS=$(shell echo `gcc -dumpversion | sed 's/\./\ /g'`) |
34 |
|
export GCCVERMAJ=$(word 1,$(GCCVERS)) |
35 |
|
export GCC4=$(shell echo `echo "${GCCVERMAJ} > 3" |bc -l`) |
36 |
|
endif |
37 |
|
ifeq ($(GCC4),1) |
38 |
|
F77=gfortran |
39 |
|
LG2C=-lgfortran |
40 |
|
EXTRAOPT= |
41 |
|
else |
42 |
F77=g77 |
F77=g77 |
43 |
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash |
LG2C=-lg2c |
44 |
F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash |
EXTRAOPT=-Wno-globals -fvxt |
45 |
|
endif |
46 |
|
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash ${PAM_BIT} |
47 |
|
F77FLAGS= -Wall -funroll-loops -fPIC $(EXTRAOPT) -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT} |
48 |
# C++ |
# C++ |
49 |
CXX=g++ |
CXX=g++ |
50 |
#CXXFLAGS=-Wall -O -fPIC -pthread -g |
#CXXFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT} |
51 |
CXXFLAGS=-Wall -O -fPIC -pthread |
CXXFLAGS=-Wall -O4 -fPIC -pthread ${PAM_BIT} |
52 |
# ROOTCINT |
# ROOTCINT |
53 |
ROOTCINT=rootcint |
ROOTCINT=rootcint |
54 |
# Here the variables definig the local directories |
# Here the variables definig the local directories |
142 |
${LIBF77LIBS}: ${LIBF77OBJS} |
${LIBF77LIBS}: ${LIBF77OBJS} |
143 |
@(${EYELLOW} " F77 shared library --------------------------") |
@(${EYELLOW} " F77 shared library --------------------------") |
144 |
@(${EGREEN} "Creating library: "${WHITE} "$@"; ${RESET}) |
@(${EGREEN} "Creating library: "${WHITE} "$@"; ${RESET}) |
145 |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $^ -lg2c `doc/cernlib_pam mathlib` |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $^ $(LG2C) `doc/cernlib_pam mathlib` |
146 |
|
|
147 |
|
|
148 |
${LIBROOTLIBS}: ${LIBROOTSRCS} ${FOBJS} |
${LIBROOTLIBS}: ${LIBROOTSRCS} ${FOBJS} |
167 |
# create .so |
# create .so |
168 |
# |
# |
169 |
@(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET}) |
@(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET}) |
170 |
@${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 |
171 |
# @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
# @ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
172 |
|
|
173 |
${LIBCPPLIBS}: ${LIBCPPSRCS} |
${LIBCPPLIBS}: ${LIBCPPSRCS} |
180 |
# create .so |
# create .so |
181 |
# |
# |
182 |
@(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET}) |
@(${EGREEN} "Compiling shared library: "${WHITE} "$@"; ${RESET}) |
183 |
@${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 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 1>/dev/null |
184 |
|
|
185 |
|
|
186 |
${CXXEXELIBS}: ${COBJS} ${FOBJS} ${CXXEXEOBJS} |
${CXXEXELIBS}: ${COBJS} ${FOBJS} ${CXXEXEOBJS} |