--- PamelaDigitizer/Makefile 2008/09/22 19:55:07 1.8 +++ PamelaDigitizer/Makefile 2009/05/05 14:17:46 1.15 @@ -1,6 +1,6 @@ # PamelaDigitizer # SOFTWARE VERSION -VER= v3r00 +VER= v3r05 # An almost general purpouse Makefile for PAMELA repository # Let's start with some useful definition to make the echo colored RED='\E[1;31;40m' @@ -25,46 +25,49 @@ MAKE=make # C CC=gcc -#CFLAGS=-Wall -O -fPIC -pthread -g -m32 -CFLAGS=-Wall -O -fPIC -pthread -m32 +#CFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT} +CFLAGS=-Wall -O -fPIC -pthread ${PAM_BIT} # Enviroment: GCCVER=`gcc --version | head -1` UNAMEA=`uname -a` TODAY=`date` # F77 F77=g77 -#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 -extend_source -static -fno-backslash -m32 +#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash ${PAM_BIT} +F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT} # C++ CXX=g++ -CXXFLAGS=-Wall -O -fPIC -pthread -m32 # 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 - # Compilers settings ROOTCFLAGS =`root-config --cflags` -ROOTLDFLAGS =`root-config --ldflags` +ROOTLDFLAGS =`root-config --ldflags` ROOTLIBS =`root-config --libs` -lHbook -CERNLIBS =`cernlib_noshift kernlib,packlib,genlib` +#CERNLIBS =`cernlib_noshift kernlib,packlib,genlib` +CERNLIBS = F77LIBS =-lg2c -lnsl SYSLIBS =-lm -ldl -rdynamic LD =g++ -CXXFLAGS= -O3 -Wall -fPIC ${ROOTCFLAGS} -m32 -#CXXFLAGS= -g -Wall -O ${ROOTCFLAGS} -m32 +CXXFLAGS= -O3 -Wall -fPIC ${ROOTCFLAGS} ${PAM_BIT} +#CXXFLAGS= -g -Wall -O ${ROOTCFLAGS} ${PAM_BIT} # flags needed on the pamelatov's: -LDFLAGS = -m32 -#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 #LDFLAGS = -g -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib +LDFLAGS = $(PAM_BIT) $(CERNLIBS) +#LDFLAGS = -lmathlib -lpacklib -lkernlib -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib $(PAM_BIT) + +#LDFLAGS = -g -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib $(PAM_BIT) + +CXXSRCS= Digitizer.cxx DigitizePSCU.cxx DigitizeCalo.cxx DigitizeTOF.cxx DigitizeAC.cxx DigitizeS4.cxx DigitizeND.cxx Write.cxx DigitizeTRK.cxx Pamelagp2Digits.cxx DigitVersion.cxx +OBJS=$(CXXSRCS:%.cxx=%.o) + +CPPSRCS= CRC.cpp calcrc.cpp +CPOBJS=$(CPPSRCS:%.cpp=%.o) HEAS =$(SRCS:.cpp=.h) -OBJS =$(SRCS:.cpp=.o) +#OBJS =$(SRCS:.cpp=.o) DEPS =$(SRCS:.cpp=.d) CLAS =$(DICS:.cpp= ) CLASH=$(DICS:.cpp=.h) @@ -72,54 +75,67 @@ DICO =$(addsuffix Dict.o, ${CLAS}) DICH =$(addsuffix Dict.h, ${CLAS}) -all: mkverpath Pamelagp2Digits +all: prepare libs Pamelagp2Digits @echo -e ${GREEN} "" @(${EGREEN} " Finished, now you can install the package \n (use: make install) "; ${RESET}) @echo -e ${GREEN} "" @${RESET} +prepare: mkverpath -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} -# @(${EWHITE} " Compiling Pamelagp2Digits... \n ") - $(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libsgp4.so ${PAM_YODA}/lib/libyoda.so +libs: $(CPOBJS) ${OBJS} ${DICO} + + +#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} +Pamelagp2Digits: + @(${EWHITE} " Compiling Pamelagp2Digits... \n ") + @ $(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libsgp4.so ${PAM_YODA}/lib/libyoda.so ${OBJS} $(CPOBJS) @rm -f *.o Digitizer: Digitizer.o ${OBJS} ${DICO} - $(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} + $(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} depend: ${DEPS} -%.d: %.cpp + +%.d: %.cxx @echo Creating dependencies for $< @$(CXX) -MM $(CXXFLAGS) $< -o $@ - - .SUFFIXES: .cxx %.o: %.cxx - $(CXX) $(CXXFLAGS) -c $< `root-config --cflags` -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ + @(${EGREEN} "Creating CXX object file: "${WHITE} "`basename $@`"; ${RESET}) + @$(CXX) $(CXXFLAGS) -c $< `root-config --cflags` -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ +.SUFFIXES: .cpp +%.o: %.cpp + @(${EGREEN} "Creating CPP object file: "${WHITE} "`basename $@`"; ${RESET}) + @$(CXX) $(CXXFLAGS) -c $< `root-config --cflags` -I${PAM_YODA}/include/yoda/ -I${PAM_INC}/ .PHONY: clean mkverpath: @(${EGREEN} creating file DigitVersion.cxx; ${RESET}) @echo '#include ' > 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 - @sleep 0.8 + @sleep 1.2 clean: @(${EGREEN} Removing object files .....) @rm -f *~ - @rm -f ${OBJS} ${DICO} *.o - @echo Removing dependencies files ..... + @rm -f ${OBJS} ${CPOBJS} ${DICO} *.o + @echo " Removing dependencies files ....." @rm -f ${DEPS} - @echo Removing dictionary files ..... + @echo " Removing dictionary files ....." @rm -f ${JUNK} ${DICH} - @echo Removing temporary files ..... + @echo " Removing temporary files ....." + @rm -f ${JUNK} + @rm -f DigitVersion.cxx; + @echo " Removing Pamelagp2Digits ....." @rm -f ${JUNK} - @rm -f DigitVersion.cxx; ${RESET} + @rm -f Pamelagp2Digits; ${RESET} + @touch DigitVersion.cxx install: # @echo "TEST: copying the executable in the PAM_BIN directory";