1 |
# Flight quick look - FQLOOK |
# Flight quick look - FQLOOK |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v1r02 |
VER= v1r24 |
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 |
CFLAGS=-Wall -O4 -fPIC -pthread ${PAM_BIT} |
27 |
# Enviroment: |
# Enviroment: |
28 |
GCCVER=`gcc --version | head -1` |
GCCVER=`gcc --version | head -1` |
29 |
UNAMEA=`uname -a` |
UNAMEA=`uname -a` |
30 |
TODAY=`date` |
TODAY=`date` |
31 |
# F77 |
# F77 |
32 |
|
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 |
|
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 |
CXXFLAGS=-Wall -O4 -fPIC -pthread ${PAM_BIT} |
51 |
# ROOTCINT |
# ROOTCINT |
52 |
ROOTCINT=rootcint |
ROOTCINT=rootcint |
53 |
# Here the variables definig the local directories |
# Here the variables definig the local directories |
65 |
|
|
66 |
MACROSRCS=${DIRMACROS}/FCaloQLOOK.cxx \ |
MACROSRCS=${DIRMACROS}/FCaloQLOOK.cxx \ |
67 |
${DIRMACROS}/FCaloCHKCALIB.cxx |
${DIRMACROS}/FCaloCHKCALIB.cxx |
68 |
MACROSLIBS=$(MACROSRCS:${DIRMACROS}/%.cxx=${DIRLIB}/%_cxx_${VER}.so) |
MACROSLIBS=$(MACROSRCS:${DIRMACROS}/%.cxx=${DIRLIB}/lib%_${VER}.so) |
69 |
MACROCLIBS=FCaloQLOOK_cxx FCaloCHKCALIB_cxx |
MACROCLIBS=libFCaloQLOOK libFCaloCHKCALIB |
70 |
FULLMACROCLIBS=$(MACROCLIBS:%=${DIRLIB}/%_${VER}.so) |
FULLMACROCLIBS=$(MACROCLIBS:%=${DIRLIB}/%_${VER}.so) |
71 |
FULLLINKMACROCLIBS=$(MACROCLIBS:%=${DIRLIB}/%.so) |
FULLLINKMACROCLIBS=$(MACROCLIBS:%=${DIRLIB}/%.so) |
72 |
|
|
82 |
|
|
83 |
CALIBFILES= |
CALIBFILES= |
84 |
|
|
85 |
DOCFILES=${DIRDOC}/fcaloQLOOK.README.pdf ${DIRDOC}/FQL-calo-doc.pdf |
DOCFILES=${DIRDOC}/fcaloQLOOK.README.pdf ${DIRDOC}/FQL-calo-opmanual.pdf ${DIRDOC}/FQL-calo-opmanual.doc |
86 |
|
|
87 |
# Here the Variables used for info target |
# Here the Variables used for info target |
88 |
PACKAGE=Calorimeter flight quick look software |
PACKAGE=Calorimeter flight quick look software |
110 |
@echo 'void info(){ printf("\nQLOOK flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); }' >> ${DIRSRC}/temp.cc |
@echo 'void info(){ printf("\nQLOOK flight package version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); }' >> ${DIRSRC}/temp.cc |
111 |
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/temp.cc -I${DIRINC} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ `root-config --cflags` |
@${CXX} ${CXXFLAGS} -c -o $@ ${DIRSRC}/temp.cc -I${DIRINC} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ `root-config --cflags` |
112 |
|
|
113 |
|
|
114 |
${MACROSLIBS}: ${MACROSRCS} |
${MACROSLIBS}: ${MACROSRCS} |
115 |
@(${EGREEN} "Compiling macro: "${WHITE} "$@"; ${RESET}) |
@(${EGREEN} "Compiling macro: "${WHITE} "$@"; ${RESET}) |
116 |
@${ROOTCINT} -f ${DIRMACROS}/`basename $(@F) _cxx_${VER}.so`link.cxx -c -I${ROOTINC} ${DIRINC}/`basename $(@F) _cxx_${VER}.so`fun.h ${DIRINC}/`basename $(@F) _cxx_${VER}.so`LinkDef.h |
@${ROOTCINT} -f ${DIRMACROS}/`basename $(@F) _${VER}.so | sed s/lib//`link.cxx -c -I${ROOTINC} ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`fun.h ${DIRINC}/`basename $(@F) _${VER}.so | sed s/lib//`LinkDef.h |
117 |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ ${DIRMACROS}/`basename $(@F) _cxx_${VER}.so`.cxx ${DIRMACROS}/`basename $(@F) _cxx_${VER}.so`link.cxx -lg2c -I${PAM_INC} -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ ${PAM_YODA}/lib/libyoda.so `root-config --cflags --glibs` 1>/dev/null |
@${CXX} ${CXXFLAGS} -Xlinker -soname=$(@F) -shared -o $@ ${DIRMACROS}/`basename $(@F) _${VER}.so | sed s/lib//`.cxx ${DIRMACROS}/`basename $(@F) _${VER}.so | sed s/lib//`link.cxx $(LG2C) -I${PAM_INC} -I${DIRTOP}/${DIRINC} -I${DIRTOP} -I${PAM_YODA}/include/yoda/ ${PAM_YODA}/lib/libyoda.so `root-config --cflags --glibs` 1>/dev/null |
118 |
|
|
119 |
${CXXEXELIBS}: ${CXXEXEOBJS} |
${CXXEXELIBS}: ${CXXEXEOBJS} |
120 |
@(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) |
@(${EGREEN} "Creating exec file: "${WHITE} "$@"; ${RESET}) |
121 |
@${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRBIN}/$@.o -I${DIRINC} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ ${PAM_YODA}/lib/libyoda.so ${DIRTOP}/${DIRLIB}/$@_cxx_${VER}.so `root-config --cflags --glibs`; |
@${CXX} ${CXXFLAGS} -o ${DIRBIN}/$@ ${DIRBIN}/$@.o -I${DIRINC} -I${PAM_INC} -I${PAM_YODA}/include/yoda/ ${PAM_YODA}/lib/libyoda.so ${DIRTOP}/${DIRLIB}/lib$@_${VER}.so `root-config --cflags --glibs`; |
122 |
@rm -f ${DIRSRC}/temp.cc |
@rm -f ${DIRSRC}/temp.cc |
123 |
|
|
124 |
# A small target to check environmental variables |
# A small target to check environmental variables |