1 |
# PamelaDigitizer |
# PamelaDigitizer |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v2r01 |
VER= v3r00 |
4 |
# An almost general purpouse Makefile for PAMELA repository |
# An almost general purpouse Makefile for PAMELA repository |
5 |
# Let's start with some useful definition to make the echo colored |
# Let's start with some useful definition to make the echo colored |
6 |
RED='\E[1;31;40m' |
RED='\E[1;31;40m' |
7 |
GREEN='\E[1;32;40m' |
GREEN='\E[1;32;40m' |
8 |
YELLOW='\E[1;33;40m' |
YELLOW='\E[1;33;40m' |
9 |
BLUE='\E[1;34;40m' |
BLUE='\E[1;34;40m' |
10 |
WHITE='\E[1;37;40m' |
WHITE='\E[1;37;40m' |
11 |
VIOLET='\E[1;35;40m' |
VIOLET='\E[1;35;40m' |
12 |
CYAN='\E[1;36;40m' |
CYAN='\E[1;36;40m' |
13 |
# Here the echo definition to use them |
# Here the echo definition to use them |
14 |
EVIOLET=echo -e ${VIOLET} |
EVIOLET=echo -e ${VIOLET} |
15 |
ECYAN=echo -e ${CYAN} |
ECYAN=echo -e ${CYAN} |
16 |
ERED=echo -e ${RED} |
ERED=echo -e ${RED} |
17 |
EGREEN=echo -e ${GREEN} |
EGREEN=echo -e ${GREEN} |
18 |
EYELLOW=echo -e ${YELLOW} |
EYELLOW=echo -e ${YELLOW} |
19 |
EBLUE=echo -e ${BLUE} |
EBLUE=echo -e ${BLUE} |
20 |
EWHITE=echo -e ${WHITE} |
EWHITE=echo -e ${WHITE} |
21 |
# Reset the terminal |
# Reset the terminal |
22 |
RESET=tput sgr0 |
RESET=tput sgr0 |
23 |
# Here the variables used to override the standard make flags |
# Here the variables used to override the standard make flags |
24 |
#MAKE |
#MAKE |
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 -m32 |
29 |
CFLAGS=-Wall -O -fPIC -pthread |
CFLAGS=-Wall -O -fPIC -pthread -m32 |
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 |
F77=g77 |
F77=g77 |
36 |
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash |
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash -m32 |
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 -m32 |
38 |
# C++ |
# C++ |
39 |
CXX=g++ |
CXX=g++ |
40 |
CXXFLAGS=-Wall -O -fPIC -pthread |
CXXFLAGS=-Wall -O -fPIC -pthread -m32 |
41 |
# ROOTCINT |
# ROOTCINT |
42 |
ROOTCINT=rootcint |
ROOTCINT=rootcint |
43 |
# Here the variables defining the local directories |
# Here the variables defining the local directories |
44 |
# ... not used ... |
# ... not used ... |
45 |
# Here the PAMELA environmental variables to be checked |
# Here the PAMELA environmental variables to be checked |
46 |
# ... not used ... |
# ... not used ... |
47 |
|
|
48 |
# Here the local variables used to build the targets |
# Here the local variables used to build the targets |
49 |
|
|
50 |
|
|
51 |
# Compilers settings |
# Compilers settings |
52 |
ROOTCFLAGS =`root-config --cflags` |
ROOTCFLAGS =`root-config --cflags` |
53 |
ROOTLDFLAGS =`root-config --ldflags` |
ROOTLDFLAGS =`root-config --ldflags` |
54 |
ROOTLIBS =`root-config --libs` -lHbook |
ROOTLIBS =`root-config --libs` -lHbook |
55 |
CERNLIBS =`cernlib_noshift kernlib,packlib,genlib` |
CERNLIBS =`cernlib_noshift kernlib,packlib,genlib` |
56 |
F77LIBS =-lg2c -lnsl |
F77LIBS =-lg2c -lnsl |
57 |
SYSLIBS =-lm -ldl -rdynamic |
SYSLIBS =-lm -ldl -rdynamic |
58 |
LD =g++ |
LD =g++ |
59 |
CXXFLAGS=-g -O -Wall -fPIC ${ROOTCFLAGS} |
CXXFLAGS= -O3 -Wall -fPIC ${ROOTCFLAGS} -m32 |
60 |
#CXXFLAGS= -g -Wall -O ${ROOTCFLAGS} |
#CXXFLAGS= -g -Wall -O ${ROOTCFLAGS} -m32 |
61 |
# flags needed on the pamelatov's: |
# flags needed on the pamelatov's: |
62 |
LDFLAGS = -g -lmathlib -lpacklib -lkernlib -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib |
LDFLAGS = -m32 |
63 |
#LDFLAGS = -g -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib |
#LDFLAGS = -g -lmathlib -lpacklib -lkernlib -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib |
64 |
|
#LDFLAGS = -g -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib |
65 |
HEAS =$(SRCS:.cpp=.h) |
|
66 |
OBJS =$(SRCS:.cpp=.o) |
HEAS =$(SRCS:.cpp=.h) |
67 |
DEPS =$(SRCS:.cpp=.d) |
OBJS =$(SRCS:.cpp=.o) |
68 |
CLAS =$(DICS:.cpp= ) |
DEPS =$(SRCS:.cpp=.d) |
69 |
CLASH=$(DICS:.cpp=.h) |
CLAS =$(DICS:.cpp= ) |
70 |
JUNK =$(addsuffix ~,${SRCS}) $(addsuffix ~,${HEAS}) |
CLASH=$(DICS:.cpp=.h) |
71 |
DICO =$(addsuffix Dict.o, ${CLAS}) |
JUNK =$(addsuffix ~,${SRCS}) $(addsuffix ~,${HEAS}) |
72 |
DICH =$(addsuffix Dict.h, ${CLAS}) |
DICO =$(addsuffix Dict.o, ${CLAS}) |
73 |
|
DICH =$(addsuffix Dict.h, ${CLAS}) |
74 |
all: mkverpath Pamelagp2Digits |
|
75 |
@echo -e ${GREEN} "" |
all: mkverpath Pamelagp2Digits |
76 |
@(${EGREEN} " Finished, now you can install the package \n (use: make install) "; ${RESET}) |
@echo -e ${GREEN} "" |
77 |
@echo -e ${GREEN} "" |
@(${EGREEN} " Finished, now you can install the package \n (use: make install) "; ${RESET}) |
78 |
@${RESET} |
@echo -e ${GREEN} "" |
79 |
|
@${RESET} |
80 |
|
|
81 |
Pamelagp2Digits: DigitVersion.o CRC.o calcrc.o Pamelagp2Digits.o Digitizer.o DigitizeRunHeader.o DigitizeCalo.o DigitizeTOF.o DigitizeAC.o DigitizeS4.o DigitizeND.o Write.o DigitizeTRK.o ${OBJS} ${DICO} |
|
82 |
# @(${EWHITE} " Compiling Pamelagp2Digits... \n ") |
Pamelagp2Digits: DigitVersion.o CRC.o calcrc.o Pamelagp2Digits.o Digitizer.o DigitizeRunHeader.o DigitizeCalo.o DigitizeTOF.o DigitizeAC.o DigitizeS4.o DigitizeND.o Write.o DigitizeTRK.o ${OBJS} ${DICO} |
83 |
$(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libsgp4.so ${PAM_YODA}/lib/libyoda.so |
# @(${EWHITE} " Compiling Pamelagp2Digits... \n ") |
84 |
@rm -f *.o |
$(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libsgp4.so ${PAM_YODA}/lib/libyoda.so |
85 |
|
@rm -f *.o |
86 |
Digitizer: Digitizer.o ${OBJS} ${DICO} |
|
87 |
$(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} |
Digitizer: Digitizer.o ${OBJS} ${DICO} |
88 |
|
$(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} |
89 |
depend: ${DEPS} |
|
90 |
|
depend: ${DEPS} |
91 |
%.d: %.cpp |
|
92 |
@echo Creating dependencies for $< |
%.d: %.cpp |
93 |
@$(CXX) -MM $(CXXFLAGS) $< -o $@ |
@echo Creating dependencies for $< |
94 |
|
@$(CXX) -MM $(CXXFLAGS) $< -o $@ |
95 |
|
|
96 |
|
|
97 |
.SUFFIXES: .cxx |
|
98 |
.cxx.o: |
.SUFFIXES: .cxx |
99 |
$(CXX) $(CXXFLAGS) -c $< `root-config --cflags` -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ |
%.o: %.cxx |
100 |
|
$(CXX) $(CXXFLAGS) -c $< `root-config --cflags` -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ |
101 |
|
|
102 |
.PHONY: clean |
|
103 |
|
.PHONY: clean |
104 |
mkverpath: |
|
105 |
@(${EGREEN} creating file DigitVersion.cpp; ${RESET}) |
mkverpath: |
106 |
@echo '#include <TSystem.h>' > DigitVersion.cpp; echo ' char *DigitizerInfo(bool print){ if ( print ) printf("\nPAMELA PamelaDigitizer version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> DigitVersion.cpp |
@(${EGREEN} creating file DigitVersion.cxx; ${RESET}) |
107 |
@sleep 0.8 |
@echo '#include <TSystem.h>' > DigitVersion.cxx; echo ' char *DigitizerInfo(bool print){ if ( print ) printf("\nPAMELA PamelaDigitizer version: ${VER}\n\nCompiled on '${TODAY}' with: '${GCCVER}'\n\nOn: '${UNAMEA}'\n\n"); return("${VER}"); }' >> DigitVersion.cxx |
108 |
|
@sleep 0.8 |
109 |
clean: |
|
110 |
|
clean: |
111 |
|
|
112 |
@(${EGREEN} Removing object files .....) |
|
113 |
@rm -f *~ |
@(${EGREEN} Removing object files .....) |
114 |
@rm -f ${OBJS} ${DICO} *.o |
@rm -f *~ |
115 |
@echo Removing dependencies files ..... |
@rm -f ${OBJS} ${DICO} *.o |
116 |
@rm -f ${DEPS} |
@echo Removing dependencies files ..... |
117 |
@echo Removing dictionary files ..... |
@rm -f ${DEPS} |
118 |
@rm -f ${JUNK} ${DICH} |
@echo Removing dictionary files ..... |
119 |
@echo Removing temporary files ..... |
@rm -f ${JUNK} ${DICH} |
120 |
@rm -f ${JUNK} |
@echo Removing temporary files ..... |
121 |
@rm -f DigitVersion.cpp; ${RESET} |
@rm -f ${JUNK} |
122 |
|
@rm -f DigitVersion.cxx; ${RESET} |
123 |
install: |
|
124 |
# @echo "TEST: copying the executable in the PAM_BIN directory"; |
install: |
125 |
@(${EGREEN} "copying the executable in the PAM_BIN directory"; ${RESET}) |
# @echo "TEST: copying the executable in the PAM_BIN directory"; |
126 |
cp Pamelagp2Digits ${PAM_BIN}/. |
@(${EGREEN} "copying the executable in the PAM_BIN directory"; ${RESET}) |
127 |
|
cp Pamelagp2Digits ${PAM_BIN}/. |