1 |
# PamelaDigitizer |
# PamelaDigitizer |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v3r00 |
VER= v3r03 |
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' |
25 |
MAKE=make |
MAKE=make |
26 |
# C |
# C |
27 |
CC=gcc |
CC=gcc |
28 |
#CFLAGS=-Wall -O -fPIC -pthread -g -m32 |
#CFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT} |
29 |
CFLAGS=-Wall -O -fPIC -pthread -m32 |
CFLAGS=-Wall -O -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 |
F77=g77 |
F77=g77 |
36 |
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash -m32 |
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash ${PAM_BIT} |
37 |
F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash -m32 |
F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT} |
38 |
# C++ |
# C++ |
39 |
CXX=g++ |
CXX=g++ |
|
CXXFLAGS=-Wall -O -fPIC -pthread -m32 |
|
40 |
# ROOTCINT |
# ROOTCINT |
41 |
ROOTCINT=rootcint |
ROOTCINT=rootcint |
|
# Here the variables defining the local directories |
|
|
# ... not used ... |
|
|
# Here the PAMELA environmental variables to be checked |
|
|
# ... not used ... |
|
|
|
|
|
# Here the local variables used to build the targets |
|
|
|
|
42 |
|
|
43 |
# Compilers settings |
# Compilers settings |
44 |
ROOTCFLAGS =`root-config --cflags` |
ROOTCFLAGS =`root-config --cflags` |
48 |
F77LIBS =-lg2c -lnsl |
F77LIBS =-lg2c -lnsl |
49 |
SYSLIBS =-lm -ldl -rdynamic |
SYSLIBS =-lm -ldl -rdynamic |
50 |
LD =g++ |
LD =g++ |
51 |
CXXFLAGS= -O3 -Wall -fPIC ${ROOTCFLAGS} -m32 |
CXXFLAGS= -O3 -Wall -fPIC ${ROOTCFLAGS} ${PAM_BIT} |
52 |
#CXXFLAGS= -g -Wall -O ${ROOTCFLAGS} -m32 |
#CXXFLAGS= -g -Wall -O ${ROOTCFLAGS} ${PAM_BIT} |
53 |
# flags needed on the pamelatov's: |
# flags needed on the pamelatov's: |
54 |
LDFLAGS = -m32 |
|
55 |
#LDFLAGS = -g -lmathlib -lpacklib -lkernlib -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib |
#LDFLAGS = $(PAM_BIT) -g -lmathlib -lpacklib -lkernlib -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib |
56 |
#LDFLAGS = -g -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib |
#LDFLAGS = -g -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib |
57 |
|
LDFLAGS = $(PAM_BIT) $(CERNLIBS) |
58 |
|
#LDFLAGS = -lmathlib -lpacklib -lkernlib -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib $(PAM_BIT) |
59 |
|
|
60 |
|
#LDFLAGS = -g -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib $(PAM_BIT) |
61 |
|
|
62 |
|
CXXSRCS= Digitizer.cxx DigitizeRunHeader.cxx DigitizeCalo.cxx DigitizeTOF.cxx DigitizeAC.cxx DigitizeS4.cxx DigitizeND.cxx Write.cxx DigitizeTRK.cxx Pamelagp2Digits.cxx DigitVersion.cxx |
63 |
|
OBJS=$(CXXSRCS:%.cxx=%.o) |
64 |
|
|
65 |
|
CPPSRCS= CRC.cpp calcrc.cpp |
66 |
|
CPOBJS=$(CPPSRCS:%.cpp=%.o) |
67 |
|
|
68 |
HEAS =$(SRCS:.cpp=.h) |
HEAS =$(SRCS:.cpp=.h) |
69 |
OBJS =$(SRCS:.cpp=.o) |
#OBJS =$(SRCS:.cpp=.o) |
70 |
DEPS =$(SRCS:.cpp=.d) |
DEPS =$(SRCS:.cpp=.d) |
71 |
CLAS =$(DICS:.cpp= ) |
CLAS =$(DICS:.cpp= ) |
72 |
CLASH=$(DICS:.cpp=.h) |
CLASH=$(DICS:.cpp=.h) |
74 |
DICO =$(addsuffix Dict.o, ${CLAS}) |
DICO =$(addsuffix Dict.o, ${CLAS}) |
75 |
DICH =$(addsuffix Dict.h, ${CLAS}) |
DICH =$(addsuffix Dict.h, ${CLAS}) |
76 |
|
|
77 |
all: mkverpath Pamelagp2Digits |
all: prepare libs Pamelagp2Digits |
78 |
@echo -e ${GREEN} "" |
@echo -e ${GREEN} "" |
79 |
@(${EGREEN} " Finished, now you can install the package \n (use: make install) "; ${RESET}) |
@(${EGREEN} " Finished, now you can install the package \n (use: make install) "; ${RESET}) |
80 |
@echo -e ${GREEN} "" |
@echo -e ${GREEN} "" |
81 |
@${RESET} |
@${RESET} |
82 |
|
|
83 |
|
prepare: mkverpath |
84 |
|
|
85 |
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} |
libs: $(CPOBJS) ${OBJS} ${DICO} |
86 |
# @(${EWHITE} " Compiling Pamelagp2Digits... \n ") |
|
87 |
$(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libsgp4.so ${PAM_YODA}/lib/libyoda.so |
|
88 |
|
#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} |
89 |
|
Pamelagp2Digits: |
90 |
|
@(${EWHITE} " Compiling Pamelagp2Digits... \n ") |
91 |
|
@ $(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libsgp4.so ${PAM_YODA}/lib/libyoda.so ${OBJS} $(CPOBJS) |
92 |
@rm -f *.o |
@rm -f *.o |
93 |
|
|
94 |
Digitizer: Digitizer.o ${OBJS} ${DICO} |
Digitizer: Digitizer.o ${OBJS} ${DICO} |
96 |
|
|
97 |
depend: ${DEPS} |
depend: ${DEPS} |
98 |
|
|
99 |
%.d: %.cpp |
|
100 |
|
%.d: %.cxx |
101 |
@echo Creating dependencies for $< |
@echo Creating dependencies for $< |
102 |
@$(CXX) -MM $(CXXFLAGS) $< -o $@ |
@$(CXX) -MM $(CXXFLAGS) $< -o $@ |
103 |
|
|
|
|
|
|
|
|
104 |
.SUFFIXES: .cxx |
.SUFFIXES: .cxx |
105 |
%.o: %.cxx |
%.o: %.cxx |
106 |
$(CXX) $(CXXFLAGS) -c $< `root-config --cflags` -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ |
@(${EGREEN} "Creating CXX object file: "${WHITE} "`basename $@`"; ${RESET}) |
107 |
|
@$(CXX) $(CXXFLAGS) -c $< `root-config --cflags` -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ |
108 |
|
|
109 |
|
.SUFFIXES: .cpp |
110 |
|
%.o: %.cpp |
111 |
|
@(${EGREEN} "Creating CPP object file: "${WHITE} "`basename $@`"; ${RESET}) |
112 |
|
@$(CXX) $(CXXFLAGS) -c $< `root-config --cflags` -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ |
113 |
|
|
114 |
.PHONY: clean |
.PHONY: clean |
115 |
|
|
116 |
mkverpath: |
mkverpath: |
117 |
@(${EGREEN} creating file DigitVersion.cxx; ${RESET}) |
@(${EGREEN} creating file DigitVersion.cxx; ${RESET}) |
118 |
@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 |
@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 |
119 |
@sleep 0.8 |
@sleep 1.2 |
120 |
|
|
121 |
clean: |
clean: |
122 |
|
|
123 |
|
|
124 |
@(${EGREEN} Removing object files .....) |
@(${EGREEN} Removing object files .....) |
125 |
@rm -f *~ |
@rm -f *~ |
126 |
@rm -f ${OBJS} ${DICO} *.o |
@rm -f ${OBJS} ${CPOBJS} ${DICO} *.o |
127 |
@echo Removing dependencies files ..... |
@echo " Removing dependencies files ....." |
128 |
@rm -f ${DEPS} |
@rm -f ${DEPS} |
129 |
@echo Removing dictionary files ..... |
@echo " Removing dictionary files ....." |
130 |
@rm -f ${JUNK} ${DICH} |
@rm -f ${JUNK} ${DICH} |
131 |
@echo Removing temporary files ..... |
@echo " Removing temporary files ....." |
132 |
|
@rm -f ${JUNK} |
133 |
|
@rm -f DigitVersion.cxx; |
134 |
|
@echo " Removing Pamelagp2Digits ....." |
135 |
@rm -f ${JUNK} |
@rm -f ${JUNK} |
136 |
@rm -f DigitVersion.cxx; ${RESET} |
@rm -f Pamelagp2Digits; ${RESET} |
137 |
|
|
138 |
install: |
install: |
139 |
# @echo "TEST: copying the executable in the PAM_BIN directory"; |
# @echo "TEST: copying the executable in the PAM_BIN directory"; |