1 |
# PamelaDigitizer |
# PamelaDigitizer |
2 |
# SOFTWARE VERSION |
# SOFTWARE VERSION |
3 |
VER= v3r00 |
VER= v3r05 |
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` |
45 |
ROOTLDFLAGS =`root-config --ldflags` |
ROOTLDFLAGS =`root-config --ldflags` |
46 |
ROOTLIBS =`root-config --libs` -lHbook |
ROOTLIBS =`root-config --libs` -lHbook |
47 |
CERNLIBS =`cernlib_noshift kernlib,packlib,genlib` |
#CERNLIBS =`cernlib_noshift kernlib,packlib,genlib` |
48 |
F77LIBS =-lg2c -lnsl |
CERNLIBS = |
49 |
|
#F77LIBS =-lg2c -lnsl |
50 |
|
F77LIBS =--lnsl |
51 |
SYSLIBS =-lm -ldl -rdynamic |
SYSLIBS =-lm -ldl -rdynamic |
52 |
LD =g++ |
LD =g++ |
53 |
CXXFLAGS= -O3 -Wall -fPIC ${ROOTCFLAGS} -m32 |
CXXFLAGS= -O3 -Wall -fPIC ${ROOTCFLAGS} ${PAM_BIT} |
54 |
#CXXFLAGS= -g -Wall -O ${ROOTCFLAGS} -m32 |
#CXXFLAGS= -g -Wall -O ${ROOTCFLAGS} ${PAM_BIT} |
55 |
# flags needed on the pamelatov's: |
# flags needed on the pamelatov's: |
56 |
LDFLAGS = -m32 |
|
57 |
#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 |
58 |
#LDFLAGS = -g -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib |
#LDFLAGS = -g -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib |
59 |
|
LDFLAGS = $(PAM_BIT) $(CERNLIBS) |
60 |
|
#LDFLAGS = -lmathlib -lpacklib -lkernlib -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib $(PAM_BIT) |
61 |
|
|
62 |
|
#LDFLAGS = -g -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib $(PAM_BIT) |
63 |
|
|
64 |
|
CXXSRCS= Digitizer.cxx DigitizePSCU.cxx DigitizeCalo.cxx DigitizeTOF.cxx DigitizeAC.cxx DigitizeS4.cxx DigitizeND.cxx Write.cxx DigitizeTRK.cxx Pamelagp2Digits.cxx DigitVersion.cxx |
65 |
|
OBJS=$(CXXSRCS:%.cxx=%.o) |
66 |
|
|
67 |
|
CPPSRCS= CRC.cpp calcrc.cpp |
68 |
|
CPOBJS=$(CPPSRCS:%.cpp=%.o) |
69 |
|
|
70 |
HEAS =$(SRCS:.cpp=.h) |
HEAS =$(SRCS:.cpp=.h) |
71 |
OBJS =$(SRCS:.cpp=.o) |
#OBJS =$(SRCS:.cpp=.o) |
72 |
DEPS =$(SRCS:.cpp=.d) |
DEPS =$(SRCS:.cpp=.d) |
73 |
CLAS =$(DICS:.cpp= ) |
CLAS =$(DICS:.cpp= ) |
74 |
CLASH=$(DICS:.cpp=.h) |
CLASH=$(DICS:.cpp=.h) |
76 |
DICO =$(addsuffix Dict.o, ${CLAS}) |
DICO =$(addsuffix Dict.o, ${CLAS}) |
77 |
DICH =$(addsuffix Dict.h, ${CLAS}) |
DICH =$(addsuffix Dict.h, ${CLAS}) |
78 |
|
|
79 |
all: mkverpath Pamelagp2Digits |
all: prepare libs Pamelagp2Digits |
80 |
@echo -e ${GREEN} "" |
@echo -e ${GREEN} "" |
81 |
@(${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}) |
82 |
@echo -e ${GREEN} "" |
@echo -e ${GREEN} "" |
83 |
@${RESET} |
@${RESET} |
84 |
|
|
85 |
|
prepare: mkverpath |
86 |
|
|
87 |
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} |
88 |
# @(${EWHITE} " Compiling Pamelagp2Digits... \n ") |
|
89 |
$(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libsgp4.so ${PAM_YODA}/lib/libyoda.so |
|
90 |
|
#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} |
91 |
|
Pamelagp2Digits: |
92 |
|
@(${EWHITE} " Compiling Pamelagp2Digits... \n ") |
93 |
|
@ $(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libsgp4.so ${PAM_YODA}/lib/libyoda.so ${OBJS} $(CPOBJS) |
94 |
@rm -f *.o |
@rm -f *.o |
95 |
|
|
96 |
Digitizer: Digitizer.o ${OBJS} ${DICO} |
Digitizer: Digitizer.o ${OBJS} ${DICO} |
97 |
$(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} |
$(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} |
98 |
|
|
99 |
depend: ${DEPS} |
depend: ${DEPS} |
100 |
|
|
101 |
%.d: %.cpp |
|
102 |
|
%.d: %.cxx |
103 |
@echo Creating dependencies for $< |
@echo Creating dependencies for $< |
104 |
@$(CXX) -MM $(CXXFLAGS) $< -o $@ |
@$(CXX) -MM $(CXXFLAGS) $< -o $@ |
105 |
|
|
|
|
|
|
|
|
106 |
.SUFFIXES: .cxx |
.SUFFIXES: .cxx |
107 |
%.o: %.cxx |
%.o: %.cxx |
108 |
$(CXX) $(CXXFLAGS) -c $< `root-config --cflags` -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ |
@(${EGREEN} "Creating CXX object file: "${WHITE} "`basename $@`"; ${RESET}) |
109 |
|
@$(CXX) $(CXXFLAGS) -c $< `root-config --cflags` -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ |
110 |
|
|
111 |
|
.SUFFIXES: .cpp |
112 |
|
%.o: %.cpp |
113 |
|
@(${EGREEN} "Creating CPP object file: "${WHITE} "`basename $@`"; ${RESET}) |
114 |
|
@$(CXX) $(CXXFLAGS) -c $< `root-config --cflags` -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ |
115 |
|
|
116 |
.PHONY: clean |
.PHONY: clean |
117 |
|
|
118 |
mkverpath: |
mkverpath: |
119 |
@(${EGREEN} creating file DigitVersion.cxx; ${RESET}) |
@(${EGREEN} creating file DigitVersion.cxx; ${RESET}) |
120 |
@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 ' const 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 |
121 |
@sleep 0.8 |
@sleep 1.2 |
122 |
|
|
123 |
clean: |
clean: |
124 |
|
|
125 |
|
|
126 |
@(${EGREEN} Removing object files .....) |
@(${EGREEN} Removing object files .....) |
127 |
@rm -f *~ |
@rm -f *~ |
128 |
@rm -f ${OBJS} ${DICO} *.o |
@rm -f ${OBJS} ${CPOBJS} ${DICO} *.o |
129 |
@echo Removing dependencies files ..... |
@echo " Removing dependencies files ....." |
130 |
@rm -f ${DEPS} |
@rm -f ${DEPS} |
131 |
@echo Removing dictionary files ..... |
@echo " Removing dictionary files ....." |
132 |
@rm -f ${JUNK} ${DICH} |
@rm -f ${JUNK} ${DICH} |
133 |
@echo Removing temporary files ..... |
@echo " Removing temporary files ....." |
134 |
|
@rm -f ${JUNK} |
135 |
|
@rm -f DigitVersion.cxx; |
136 |
|
@echo " Removing Pamelagp2Digits ....." |
137 |
@rm -f ${JUNK} |
@rm -f ${JUNK} |
138 |
@rm -f DigitVersion.cxx; ${RESET} |
@rm -f Pamelagp2Digits; ${RESET} |
139 |
|
@touch DigitVersion.cxx |
140 |
|
|
141 |
install: |
install: |
142 |
# @echo "TEST: copying the executable in the PAM_BIN directory"; |
# @echo "TEST: copying the executable in the PAM_BIN directory"; |