--- chewbacca/Makefile 2009/04/17 09:56:16 1.8 +++ chewbacca/Makefile 2009/07/29 15:46:55 1.9 @@ -23,7 +23,7 @@ export RESET=tput sgr0 # export BASEDIR=$(shell echo `pwd`) -export LD_LIBRARY_PATH+=$(BASEDIR)/event +#export LD_LIBRARY_PATH+=:$(BASEDIR)/event/ # export LDFLAGS+=$(PAM_BIT) export CFLAGS+=$(PAM_BIT) @@ -32,19 +32,35 @@ DIRS=event PamOffLineSW YodaProfiler # all: +ifeq ($(verbose),) + @for sub_dir in $(DIRS) ; do \ + ( cd $$sub_dir &>/dev/null && (${EGREEN} "Make all in $$sub_dir "; ${RESET}) && make -s BASEDIR=$(BASEDIR)) ; \ + done +else for sub_dir in $(DIRS) ; do \ ( cd $$sub_dir && make BASEDIR=$(BASEDIR)) ; \ done +endif distclean: +ifeq ($(verbose),) + @for sub_dir in $(DIRS) ; do \ + ( cd $$sub_dir &>/dev/null && (${EGREEN} "Make distclean in $$sub_dir "; ${RESET}) && make -s distclean) ; \ + done + @for sub_dir in `find ./ -name obj` ; do \ + rm -rf $$sub_dir ; \ + done +else for sub_dir in $(DIRS) ; do \ ( cd $$sub_dir && make distclean) ; \ done for sub_dir in `find ./ -name obj` ; do \ rm -rf $$sub_dir ; \ done +endif install: +ifeq ($(verbose),) @(${EGREEN} " Creating PAMELA environment "; ${RESET}) @if [ "$(PAM_SOFTWARE)" == "" ]; then (${ERED} ""; ${RESET}); \ (${ERED} " PLEASE SET THE PAMELA ENVIRONMENT BEFORE INSTALLING "; ${RESET}); \ @@ -68,9 +84,40 @@ @(${EGREEN} " Installing exec file "${EWHITE}"chewbacca"; ${RESET}) @cp -f $(BASEDIR)/PamOffLineSW/chewbacca $(PAM_BIN)/ @(${EGREEN} " Installing "${EWHITE}"yoda headers";${RESET}) - @(cd $(BASEDIR)/event/ && make distclean) + @(cd $(BASEDIR)/event/ &>/dev/null && make -s distclean) @rm -rf $(PAM_INC)/yoda/ @cp -rf $(BASEDIR)/event/ $(PAM_INC)/yoda @cp -rf $(PAM_LIB)/libyoda.so $(BASEDIR)/event/ @(${EGREEN}"") @(cd YodaProfiler && make forceinstall) +else + (${EGREEN} " Creating PAMELA environment "; ${RESET}) + if [ "$(PAM_SOFTWARE)" == "" ]; then (${ERED} ""; ${RESET}); \ + (${ERED} " PLEASE SET THE PAMELA ENVIRONMENT BEFORE INSTALLING "; ${RESET}); \ + (${ERED} ""; ${RESET}); \ + exit; fi + if [ ! -d $(PAM_HOME) ]; then mkdir $(PAM_HOME); fi + if [ ! -d $(PAM_SOFTWARE) ]; then mkdir $(PAM_SOFTWARE); fi + if [ ! -d $(PAM_LIB) ]; then mkdir $(PAM_LIB); fi + if [ ! -d $(PAM_INC) ]; then mkdir $(PAM_INC); fi + ln -sf $(PAM_SOFTWARE)/inc $(PAM_SOFTWARE)/include + if [ ! -d $(PAM_BIN) ]; then mkdir $(PAM_BIN); fi + if [ ! -d $(PAM_DOC) ]; then mkdir $(PAM_DOC); fi + if [ ! -d $(PAM_MACROS) ]; then mkdir $(PAM_MACROS); fi + if [ ! -d $(PAM_SRC) ]; then mkdir $(PAM_SRC); fi + if [ ! -d $(PAM_CALIB) ]; then mkdir $(PAM_CALIB); fi + if [ ! -d $(FEV_PLUGIN) ]&&[ "$(FEV_PLUGIN)" != "" ]; then mkdir $(FEV_PLUGIN); fi + (${EGREEN} " Installing "${EWHITE}"libyoda.so "; ${RESET}) + cp -f $(BASEDIR)/event/libyoda.so.0.0.0 $(PAM_LIB)/ + ln -sf $(PAM_LIB)/libyoda.so.0.0.0 $(PAM_LIB)/libyoda.so + ln -sf $(PAM_LIB)/libyoda.so.0.0.0 $(PAM_LIB)/libyoda.so.0 + (${EGREEN} " Installing exec file "${EWHITE}"chewbacca"; ${RESET}) + cp -f $(BASEDIR)/PamOffLineSW/chewbacca $(PAM_BIN)/ + (${EGREEN} " Installing "${EWHITE}"yoda headers";${RESET}) + (cd $(BASEDIR)/event/ && make distclean) + rm -rf $(PAM_INC)/yoda/ + cp -rf $(BASEDIR)/event/ $(PAM_INC)/yoda + cp -rf $(PAM_LIB)/libyoda.so $(BASEDIR)/event/ + (${EGREEN}"") + (cd YodaProfiler && make forceinstall) +endif