1 |
# PadmeAmidala |
# PadmeAmidala |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v2r01 |
VER= v10r04 |
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 ${PAM_BIT} |
29 |
CFLAGS=-Wall -O -fPIC -pthread |
CFLAGS=-Wall -O4 -fPIC -pthread ${PAM_BIT} |
30 |
# Enviroment: |
# Enviroment: |
31 |
GCCVER=`gcc --version | head -1` |
GCCVER=`gcc --version | head -1` |
32 |
UNAMEA=`uname -a` |
UNAMEA=`uname -a` |
33 |
TODAY=`date` |
TODAY=`date` |
34 |
# F77 |
# F77 |
35 |
|
ifeq ($(GCC4),) |
36 |
|
export GCCVERS=$(shell echo `gcc -dumpversion | sed 's/\./\ /g'`) |
37 |
|
export GCCVERMAJ=$(word 1,$(GCCVERS)) |
38 |
|
export GCC4=$(shell echo `echo "${GCCVERMAJ} > 3" |bc -l`) |
39 |
|
endif |
40 |
|
ifeq ($(GCC4),1) |
41 |
|
F77=gfortran |
42 |
|
LG2C=-lgfortran |
43 |
|
EXTRAOPT= |
44 |
|
else |
45 |
F77=g77 |
F77=g77 |
46 |
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash |
LG2C=-lg2c |
47 |
F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash |
EXTRAOPT=-Wno-globals -fvxt |
48 |
|
endif |
49 |
|
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash ${PAM_BIT} |
50 |
|
F77FLAGS= -Wall -funroll-loops -fPIC $(EXTRAOPT) -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT} |
51 |
# C++ |
# C++ |
52 |
CXX=g++ |
CXX=g++ |
53 |
#CXXFLAGS=-Wall -O -fPIC -pthread -g |
#CXXFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT} |
54 |
CXXFLAGS=-Wall -O -fPIC -pthread |
CXXFLAGS=-Wall -O4 -fPIC -pthread ${PAM_BIT} |
55 |
# ROOTCINT |
# ROOTCINT |
56 |
ROOTCINT=rootcint |
ROOTCINT=rootcint |
57 |
# Here the variables definig the local directories |
# Here the variables definig the local directories |
163 |
# create .so |
# create .so |
164 |
# |
# |
165 |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
@(${EGREEN} "Creating shared library: "${WHITE} "`basename $@`"; ${RESET}) |
166 |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ -lg2c -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_INC} -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 |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ $(LG2C) -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_INC} -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 |
167 |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
@ln -sf ${DIRTOP}/${DIRLIB}/$(@F) ${DIRTOP}/${DIRLIB}/$(patsubst %_${VER}.so,%.so,$(@F)) |
168 |
|
|
169 |
${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS} |
${LIBCPPLIBS}: ${LIBSRCS} ${COBJS} ${FOBJS} |
181 |
|
|
182 |
${CXXEXELIBS}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS} |
${CXXEXELIBS}: ${CPPOBJS} ${COBJS} ${CXXEXEOBJS} |
183 |
@(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) |
@(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) |
184 |
@${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${DIRTOP}/${DIRLIB}/libRunGlue.so ${PAM_LIB}/libPamLevel2.so ${PAM_LIB}/libDarthVader.so ${CPPOBJS} ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` -lRFIO |
@${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRTOP}/${DIRLIB}/$@.o ${DIRTOP}/${DIRLIB}/libRunGlue.so ${PAM_LIB}/libPamLevel2.so ${PAM_LIB}/libDarthVader.so ${CPPOBJS} ${PAM_YODA}/lib/libyoda.so -lThread `root-config --cflags --glibs` |
185 |
|
|
186 |
# A small target to check environmental variables |
# A small target to check environmental variables |
187 |
%_env: |
%_env: |
254 |
@${test_and_cp} |
@${test_and_cp} |
255 |
|
|
256 |
mkverpath: |
mkverpath: |
257 |
@echo '#include <TSystem.h>' > ${DIRTOP}/${DIRSRC}/PadmeAmidalaVerl2.cpp; echo ' char *AmidalaInfo(bool print){ if ( print ) printf("\nPAMELA PadmeAmidala version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> ${DIRTOP}/${DIRSRC}/PadmeAmidalaVerl2.cpp |
@echo '#include <TSystem.h>' > ${DIRTOP}/${DIRSRC}/PadmeAmidalaVerl2.cpp; echo ' const char *AmidalaInfo(bool print){ if ( print ) printf("\nPAMELA PadmeAmidala version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> ${DIRTOP}/${DIRSRC}/PadmeAmidalaVerl2.cpp |
258 |
@sleep 0.8 |
@sleep 0.8 |
259 |
|
|
260 |
|
|