#-- start of packages_header ------

include ${CMTROOT}/src/Makefile.core

ifndef BCAST_CMD
BCAST_CMD = $(cmtexe) make
endif

ifdef LOG_LOCATION
LOG_SUFFIX = .log
endif

ifndef CMTACTIONS
Cmt_actions_handler = test "$$group" != cmt_actions || continue ;
else
Cmt_actions_handler =
endif

# -- Special macro to change the behavior on a failure of a package
#    (complementary to the option '-k')
#  Allowed values for PACKAGE_FAILURE_POLICY:
#    stop:   do not continue (default)
#    skip:   if a group fails, continue with the next package
#    ignore: try all the groups even if one fails before going to the next package
#            (may result in duplicated errors within a package)
# Taken from https://svnweb.cern.ch/trac/gaudi/browser/Gaudi/trunk/Makefile.cmt
Package_failure_handler = test $$BUILD_RESULT -eq 0 || exit $$BUILD_RESULT ;
ifdef PACKAGE_FAILURE_POLICY
ifeq ($(PACKAGE_FAILURE_POLICY),stop)
Package_failure_handler = test $$BUILD_RESULT -eq 0 || exit $$BUILD_RESULT ;
else
ifeq ($(PACKAGE_FAILURE_POLICY),skip)
Package_failure_handler = test $$BUILD_RESULT -eq 0 || break ;
else
ifeq ($(PACKAGE_FAILURE_POLICY),ignore)
Package_failure_handler =
else
$(error Unknown PACKAGE_FAILURE_POLICY "$(PACKAGE_FAILURE_POLICY)". Allowed values: "stop" (default), "skip", "ignore")
endif
endif
endif
endif
# --

all : ;

ifdef BCAST_ONLY
all : ${PACKAGE}
clean : ${PACKAGE}clean
binclean : ${PACKAGE}binclean
uninstall : ${PACKAGE}uninstall
endif
#--------------------------------------------------------

ifndef PEDANTIC
.DEFAULT :
	$(echo) "(uses.make) $@: No rule for such target" >&2
endif

#-- end of packages_header ------
