562 # not be fully written when the make recipe is done. |
562 # not be fully written when the make recipe is done. |
563 # |
563 # |
564 # Param 1 - The path to base the name of the log file / command line file on |
564 # Param 1 - The path to base the name of the log file / command line file on |
565 # Param 2 - The command to run |
565 # Param 2 - The command to run |
566 ExecuteWithLog = \ |
566 ExecuteWithLog = \ |
567 $(call LogCmdlines, Exececuting: [$(strip $2)]) \ |
567 $(call LogCmdlines, Executing: [$(strip $2)]) \ |
568 $(call MakeDir, $(dir $(strip $1))) \ |
568 $(call MakeDir, $(dir $(strip $1)) $(MAKESUPPORT_OUTPUTDIR)/failure-logs) \ |
569 $(call WriteFile, $2, $(strip $1).cmdline) \ |
569 $(call WriteFile, $2, $(strip $1).cmdline) \ |
570 ( $(RM) $(strip $1).log && $(strip $2) > >($(TEE) -a $(strip $1).log) 2> >($(TEE) -a $(strip $1).log >&2) || \ |
570 ( $(RM) $(strip $1).log && $(strip $2) > >($(TEE) -a $(strip $1).log) 2> >($(TEE) -a $(strip $1).log >&2) || \ |
571 ( exitcode=$(DOLLAR)? && \ |
571 ( exitcode=$(DOLLAR)? && \ |
572 $(CP) $(strip $1).log $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).log && \ |
572 $(CP) $(strip $1).log $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).log && \ |
573 $(CP) $(strip $1).cmdline $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).cmdline && \ |
573 $(CP) $(strip $1).cmdline $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).cmdline && \ |