--- PamelaDigitizer/Makefile 2007/10/11 11:29:21 1.3 +++ PamelaDigitizer/Makefile 2008/09/23 07:26:52 1.9 @@ -1,3 +1,53 @@ +# PamelaDigitizer +# SOFTWARE VERSION +VER= v3r00 +# 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' +GREEN='\E[1;32;40m' +YELLOW='\E[1;33;40m' +BLUE='\E[1;34;40m' +WHITE='\E[1;37;40m' +VIOLET='\E[1;35;40m' +CYAN='\E[1;36;40m' +# Here the echo definition to use them +EVIOLET=echo -e ${VIOLET} +ECYAN=echo -e ${CYAN} +ERED=echo -e ${RED} +EGREEN=echo -e ${GREEN} +EYELLOW=echo -e ${YELLOW} +EBLUE=echo -e ${BLUE} +EWHITE=echo -e ${WHITE} +# Reset the terminal +RESET=tput sgr0 +# Here the variables used to override the standard make flags +#MAKE +MAKE=make +# C +CC=gcc +#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 ${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 ${PAM_BIT} +# 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` @@ -6,10 +56,11 @@ F77LIBS =-lg2c -lnsl SYSLIBS =-lm -ldl -rdynamic LD =g++ -CXXFLAGS=-g -O -Wall -fPIC ${ROOTCFLAGS} -#CXXFLAGS= -g -Wall -O ${ROOTCFLAGS} +CXXFLAGS= -O3 -Wall -fPIC ${ROOTCFLAGS} ${PAM_BIT} +#CXXFLAGS= -g -Wall -O ${ROOTCFLAGS} ${PAM_BIT} # flags needed on the pamelatov's: -LDFLAGS = -g -lmathlib -lpacklib -lkernlib -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib +LDFLAGS = -m32 +#LDFLAGS = -g -lmathlib -lpacklib -lkernlib -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib #LDFLAGS = -g -llapack -lg2c -lm -lnsl -lcrypt -L/cern/2005/lib HEAS =$(SRCS:.cpp=.h) @@ -21,11 +72,17 @@ DICO =$(addsuffix Dict.o, ${CLAS}) DICH =$(addsuffix Dict.h, ${CLAS}) -all: Pamelagp2Digits +all: mkverpath Pamelagp2Digits + @echo -e ${GREEN} "" + @(${EGREEN} " Finished, now you can install the package \n (use: make install) "; ${RESET}) + @echo -e ${GREEN} "" + @${RESET} -Pamelagp2Digits: CRC.o calcrc.o Pamelagp2Digits.o Digitizer.o ${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} +# @(${EWHITE} " Compiling Pamelagp2Digits... \n ") $(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} ${PAM_LIB}/libGLTables.so ${PAM_LIB}/libsgp4.so ${PAM_YODA}/lib/libyoda.so + @rm -f *.o Digitizer: Digitizer.o ${OBJS} ${DICO} $(LD) $(LDFLAGS) -o $@ $^ ${ROOTLIBS} ${CERNLIBS} ${F77LIBS} ${SYSLIBS} @@ -39,14 +96,22 @@ .SUFFIXES: .cxx -.cxx.o: +%.o: %.cxx $(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 + clean: - @echo Removing object files ..... + + + @(${EGREEN} Removing object files .....) + @rm -f *~ @rm -f ${OBJS} ${DICO} *.o @echo Removing dependencies files ..... @rm -f ${DEPS} @@ -54,3 +119,9 @@ @rm -f ${JUNK} ${DICH} @echo Removing temporary files ..... @rm -f ${JUNK} + @rm -f DigitVersion.cxx; ${RESET} + +install: +# @echo "TEST: copying the executable in the PAM_BIN directory"; + @(${EGREEN} "copying the executable in the PAM_BIN directory"; ${RESET}) + cp Pamelagp2Digits ${PAM_BIN}/.