--- chewbacca/PamOffLineSW/Makefile 2008/09/23 14:02:31 1.3 +++ chewbacca/PamOffLineSW/Makefile 2009/08/04 13:58:08 1.9 @@ -1,6 +1,6 @@ #***************************************************************************** # -# FILE NAME: $Id: Makefile,v 1.2 2008/09/23 07:57:54 mocchiut Exp $ +# FILE NAME: $Id: Makefile,v 1.8 2009/07/29 16:13:13 mocchiut Exp $ # VERSION: # AUTHOR: Nergal S.r.l. # DATE: @@ -15,7 +15,14 @@ #------------------------------------------------------------------------------ +ifneq ($(MAKECMDGOALS),distclean) include $(BASEDIR)/PamOffLineSW/Make.def +endif +ifeq ($(GCC4),1) +export LG2C=-lgfortran +else +export LG2C=-lg2c +endif #------------------------------------------------------------------------------ @@ -47,17 +54,32 @@ all: $(EXECUTABLES) $(EXECUTABLES): $(TARGETLIB) $(EXTLIB) - $(CXX) $(PAM_BIT) -shared -o $@ -L ../event -lyoda -lg2c `root-config --libs` -lRMySQL $^ +ifeq ($(verbose),) + @$(CXX) $(PAM_BIT) -o $@ -L ../event -lyoda ${LG2C} `root-config --libs` -lRMySQL $^ +else + $(CXX) $(PAM_BIT) -o $@ -L ../event -lyoda ${LG2C} `root-config --libs` -lRMySQL $^ +endif $(EXTLIB): $(EXTDIR) +ifeq ($(verbose),) + @for sub_dir in $(EXTDIR) ; do \ + (${EGREEN} "Make all in $$sub_dir "; ${RESET});\ + $(MAKE) -s -C $$sub_dir libs ; \ + done +else for sub_dir in $(EXTDIR) ; do \ $(MAKE) -C $$sub_dir libs ; \ done +endif libs: $(TARGETLIB) $(TARGETLIB) : ${OBJS} +ifeq ($(verbose),) + @$(AR) -scrv $@ ${OBJS} &>/dev/null +else $(AR) -scrv $@ ${OBJS} +endif SUBPACKET_HEADER_FILES = \ @@ -128,26 +150,52 @@ LinkDef.h $(ROOTEVENTDICT).cpp: ${DICT_HEADER_FILES} +ifeq ($(verbose),) + @echo "Calling ROOTCINT" ;\ + LD_LIBRARY_PATH=$(ROOT_LIB):$(LD_LIBRARY_PATH); $(ROOTCINT) -f $@ -c ${INCLUDES} $^ +else echo $(ROOTCINT) -f $@ -c ${INCLUDES} $^ ;\ - LD_LIBRARY_PATH=$(ROOT_LIB) $(ROOTCINT) -f $@ -c ${INCLUDES} $^ + LD_LIBRARY_PATH=$(ROOT_LIB):$(LD_LIBRARY_PATH); $(ROOTCINT) -f $@ -c ${INCLUDES} $^ +endif clean: clean-subdir +ifeq ($(verbose),) + @rm -f $(TARGETLIB) ${OBJS} $(OBJDIR)/.*.d $(EXECUTABLES) +else rm -f $(TARGETLIB) ${OBJS} $(OBJDIR)/.*.d $(EXECUTABLES) +endif clean-subdir: $(EXTDIR) +ifeq ($(verbose),) + @for sub_dir in $(EXTDIR) ; do \ + $(MAKE) -s -C $$sub_dir clean ; \ + done +else for sub_dir in $(EXTDIR) ; do \ $(MAKE) -C $$sub_dir clean ; \ done +endif distclean: distclean-sub distclean-subdir clean +ifeq ($(verbose),) + @rm -f $(ROOTEVENTDICT).{cpp,h} + @$(MAKE) -s -C techmodel/ clean +else rm -f $(ROOTEVENTDICT).{cpp,h} +endif distclean-subdir: +ifeq ($(verbose),) + @for sub_dir in $(EXTDIR) ; do \ + $(MAKE) -s -C $$sub_dir distclean-sub ; \ + done +else for sub_dir in $(EXTDIR) ; do \ $(MAKE) -C $$sub_dir distclean-sub ; \ done +endif --include $(DEPEND) +#-include $(DEPEND) #------------------------------------------------------------------------------