diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-02 10:47:28 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-02 10:49:59 +0100 |
commit | 4e4ea4bc733dc62e6c06eb42574ea0c5b0e5b826 (patch) | |
tree | 947948e6fe449f05726c8b86f9bed8b93e10660d | |
parent | b004bf7f54b31f1b2eab01ed8b21a2c605be55d4 (diff) |
Improve gb_Helper_print_on_error, and use in a CustomTarget
* always wrap the sub-command in ( ... )
* if no 2nd arg is given, use a temp file
Change-Id: I7b43214dda1e4f8ee5e9b9a7310d58adee2a6500
-rw-r--r-- | i18npool/CustomTarget_localedata.mk | 8 | ||||
-rw-r--r-- | solenv/gbuild/Helper.mk | 8 |
2 files changed, 11 insertions, 5 deletions
diff --git a/i18npool/CustomTarget_localedata.mk b/i18npool/CustomTarget_localedata.mk index 481b3ee975bf..c03bbbc5f8be 100644 --- a/i18npool/CustomTarget_localedata.mk +++ b/i18npool/CustomTarget_localedata.mk @@ -21,10 +21,10 @@ $(call gb_CustomTarget_get_workdir,i18npool/localedata)/localedata_$(1).cxx : \ $(call gb_Executable_get_runtime_dependencies,saxparser) $$(call gb_Output_announce,$$(subst $(WORKDIR)/,,$$@),$(true),SAX,1) $$(call gb_Helper_abbreviate_dirs, \ - $$(call gb_Helper_execute,saxparser) $(1) $$< $$@.tmp \ - -env:LO_LIB_DIR=$(call gb_Helper_make_url,$(INSTROOT_FOR_BUILD)/$(LIBO_LIB_FOLDER)) \ - -env:URE_MORE_SERVICES=$(call gb_Helper_make_url,$(call gb_Rdb_get_target_for_build,saxparser)) \ - $(if $(findstring s,$(MAKEFLAGS)),> /dev/null 2>&1) && \ + $$(call gb_Helper_print_on_error, \ + $$(call gb_Helper_execute,saxparser) $(1) $$< $$@.tmp \ + -env:LO_LIB_DIR=$(call gb_Helper_make_url,$(INSTROOT_FOR_BUILD)/$(LIBO_LIB_FOLDER)) \ + -env:URE_MORE_SERVICES=$(call gb_Helper_make_url,$(call gb_Rdb_get_target_for_build,saxparser))) && \ sed 's/\(^.*get[^;]*$$$$\)/SAL_DLLPUBLIC_EXPORT \1/' $$@.tmp > $$@ && \ rm $$@.tmp) diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk index bdc8e30d4297..da6a9afe4ec9 100644 --- a/solenv/gbuild/Helper.mk +++ b/solenv/gbuild/Helper.mk @@ -286,7 +286,13 @@ $(if $(filter $(1),$(BUILD_TYPE_FOR_HOST)),$(2)) endef define gb_Helper_print_on_error -$(if $(gb_QUIET_EXTERNAL),( $(1) ) > $(2) 2>&1 || ( cat $(2) && false ),$(1) ) +$(if $(gb_QUIET_EXTERNAL), \ + $(if $(2), \ + ( ( $(1) ) > $(2) 2>&1 || ( cat $(2) && false ) ), \ + ( TEMPFILE=$(shell $(gb_MKTEMP)) && ( $(1) ) > $$TEMPFILE 2>&1 \ + && rm $$TEMPFILE \ + || ( cat $$TEMPFILE && rm $$TEMPFILE && false ) )), \ + ( $(1) )) endef # vim: set noet sw=4 ts=4: |