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

Reply via email to