help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

foreach with error in loop continues


From: Emmanuel Mayssat
Subject: foreach with error in loop continues
Date: Mon, 10 Oct 2016 13:50:08 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

Hello,

I am running a make with the $(foreach directive.
What I noticed is that if the loop fails ($? != 0), foreach still
continues.

Here is the code:

define create_role_targets
$(1):
    -$(MAKE) -e IAM_ROLE_NAME=$(1) _iam_create_role
    $(foreach P, $(call get_role_policies_R,$(1)), \
        $(MAKE) -e IAM_POLICY_NAME=\$(P) -e IAM_ROLE_NAME=$(1) 
_iam_validate_policy_document _iam_put_role_policies; \
    )
endef
$(eval $(foreach R, $(_CONFIG_ROLE_NAMES), $(call create_role_targets,$(R))))



I agree the code is somewhat convoluted, but the MAKE in the foreach loop
occasionally fails and if it does, it continues. No only that is not
desirable, but it is not expected.
Is there a way to fail the foreach loop if its inner command fails?

Regards,

-- 
Emmanuel
Menlo Security, Inc.
Menlo Park, CA




reply via email to

[Prev in Thread] Current Thread [Next in Thread]