Is it possible to break from a GMAKE foreach loop and then exit from make?

Pierre Rouleau <[email protected]>
Newsgroups gmane.comp.gnu.make.general
Message-ID <CALTqLiYYCtKvpYq-dDi+daK8W0ExwkyOFFwZR+UMjPAPxCXq9Q@mail.gmail.com>
Hi all,

I have a makefile tha patches the kernel but does not check if the patch
succeeded.
The rule is shown below.  It uses a foreach loop to apply a set of patches
identified by
a list of patches.

Is it possible to use the `|| exit 1' construct inside the text portion of
the foreach loop to detect
failing patches and stop make execution?

ie, Is it possible to transform the following:

$(OUTPUT_ROOT_DIR)/.kernel_patched: $(OUTPUT_ROOT_DIR)/.kernel_original
        @echo -e "Applying only specific patch to kernel"
        (cd $(OUTPUT_ROOT_DIR)/$(CFG_GLOBAL_LINUX_VERSION); $(foreach
thepatch,$(KERNEL_PATCH_ONE),echo patching $(thepatch); patch
--ignore-whitespace -p1 < $(thepatch);))


into this and is it the best way or are there better alternatives?

$(OUTPUT_ROOT_DIR)/.kernel_patched: $(OUTPUT_ROOT_DIR)/.kernel_original
        @echo -e "Applying only specific patch to kernel"
        (cd $(OUTPUT_ROOT_DIR)/$(CFG_GLOBAL_LINUX_VERSION); $(foreach
thepatch,$(KERNEL_PATCH_ONE),echo patching $(thepatch); patch
--ignore-whitespace -p1 < $(thepatch) || exit 1;))


Thanks


-- 
/Pierre
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.