diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2024-05-05 19:20:33 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2024-05-06 11:40:45 +0200 |
commit | 875a1bf2e132e9083f3cf23b0fc59aeedaf61574 (patch) | |
tree | e0aaa2967914dc9d1ece2055d4dfe3805982b41e /solenv | |
parent | 971db10d73a0fe80cceca70d19edd02de30be414 (diff) |
makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo)
…by a simple/static $(gb_UnpackedTarball_workdir)/foo
see also 0c4c84a14b01c71c76a9c45a7f26aec4d64f3e4f
Change-Id: I8e6aa55c85534c4446556548910c950ddbe7c6fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167163
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/ExternalPackage.mk | 4 | ||||
-rw-r--r-- | solenv/gbuild/ExternalProject.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/TargetLocations.mk | 3 | ||||
-rw-r--r-- | solenv/gbuild/UIConfig.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/UnpackedTarball.mk | 28 |
5 files changed, 20 insertions, 19 deletions
diff --git a/solenv/gbuild/ExternalPackage.mk b/solenv/gbuild/ExternalPackage.mk index 05bfa6d0cd18..81363028bd42 100644 --- a/solenv/gbuild/ExternalPackage.mk +++ b/solenv/gbuild/ExternalPackage.mk @@ -58,7 +58,7 @@ endef # # gb_ExternalPackage_ExternalPackage_internal name unpacked define gb_ExternalPackage_ExternalPackage_internal -$(call gb_Package_Package_internal,$(1),$(call gb_UnpackedTarball_get_dir,$(2))) +$(call gb_Package_Package_internal,$(1),$(gb_UnpackedTarball_workdir)/$(2)) $(call gb_Package_use_unpacked,$(1),$(2)) $(call gb_ExternalPackage_get_target,$(1)) : $(call gb_Package_get_target,$(1)) @@ -86,7 +86,7 @@ endef # # gb_ExternalPackage_mark_generated_file package file define gb_ExternalPackage_mark_generated_file -$(call gb_UnpackedTarball_get_dir,$(gb_ExternalPackage_UNPACKED_$(1)))/$(2) : \ +$(gb_UnpackedTarball_workdir)/$(gb_ExternalPackage_UNPACKED_$(1))/$(2) : \ $(call gb_ExternalProject_get_target,$(gb_ExternalPackage_PROJECT_$(1))) $(if $(suffix $(2)),\ $(call gb_UnpackedTarbal__ensure_pattern_rule,$(gb_ExternalPackage_UNPACKED_$(1)),$(suffix $(2))),\ diff --git a/solenv/gbuild/ExternalProject.mk b/solenv/gbuild/ExternalProject.mk index 5227e6c13bec..e9496b87761e 100644 --- a/solenv/gbuild/ExternalProject.mk +++ b/solenv/gbuild/ExternalProject.mk @@ -73,7 +73,7 @@ $(call gb_ExternalProject_get_clean_target,%) : # # gb_ExternalProject_ExternalProject project define gb_ExternalProject_ExternalProject -$(call gb_ExternalProject_get_target,$(1)) : EXTERNAL_WORKDIR := $(call gb_UnpackedTarball_get_dir,$(1)) +$(call gb_ExternalProject_get_target,$(1)) : EXTERNAL_WORKDIR := $(gb_UnpackedTarball_workdir)/$(1) $(call gb_ExternalProject_get_preparation_target,$(1)) : $(gb_Module_CURRENTMAKEFILE) $(call gb_ExternalProject_get_preparation_target,$(1)) :| $(dir $(call gb_ExternalProject_get_target,$(1))).dir diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index dc659c1e4b4d..b8e2321c85ae 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -207,7 +207,8 @@ gb_UnoApiHeadersTarget_get_real_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/nor gb_UnoApiHeadersTarget_get_bootstrap_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/$(call gb_UnoApiHeadersTarget_select_variant,$(1),bootstrap).done gb_UnoApiHeadersTarget_get_comprehensive_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/$(call gb_UnoApiHeadersTarget_select_variant,$(1),comprehensive).done gb_UnoApiHeadersTarget_get_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/$(call gb_UnoApiHeadersTarget_select_variant,$(1),normal).done -gb_UnpackedTarball_get_dir = $(WORKDIR)/UnpackedTarball/$(1) +gb_UnpackedTarball_get_dir = $(error please use plain gb_UnpackedTarball_workdir instead) +gb_UnpackedTarball_workdir := $(WORKDIR)/UnpackedTarball gb_UnpackedTarball_get_pristine_dir = $(WORKDIR)/UnpackedTarball/$(1).org gb_UnpackedTarball_get_final_target = $(WORKDIR)/UnpackedTarball/$(1).update # NOTE: the .done target is hardcoded in solenv/bin/concat-deps.c ! diff --git a/solenv/gbuild/UIConfig.mk b/solenv/gbuild/UIConfig.mk index eaca4c5d8da3..8e29cfdd6c37 100644 --- a/solenv/gbuild/UIConfig.mk +++ b/solenv/gbuild/UIConfig.mk @@ -98,7 +98,7 @@ endef gb_UIConfig_INSTDIR := $(LIBO_SHARE_FOLDER)/config/soffice.cfg ifneq ($(filter LXML,$(BUILD_TYPE)),) -gb_UIConfig_LXML_PATH := PYTHONPATH=$${PYTHONPATH:+$$PYTHONPATH:}$(call gb_UnpackedTarball_get_dir,lxml)/install ; +gb_UIConfig_LXML_PATH := PYTHONPATH=$${PYTHONPATH:+$$PYTHONPATH:}$(gb_UnpackedTarball_workdir)/lxml/install ; gb_UIConfig_LXML_TARGET := $(call gb_ExternalProject_get_target,lxml) endif gb_UIConfig_gla11y_SCRIPT := $(SRCDIR)/bin/gla11y diff --git a/solenv/gbuild/UnpackedTarball.mk b/solenv/gbuild/UnpackedTarball.mk index 4419dd172870..dd7317e29ec2 100644 --- a/solenv/gbuild/UnpackedTarball.mk +++ b/solenv/gbuild/UnpackedTarball.mk @@ -151,7 +151,7 @@ $(call gb_Helper_abbreviate_dirs,\ ) \ $(if $(gb_KEEP_PRISTINE), \ rm -fr $(call gb_UnpackedTarball_get_pristine_dir,$(2)) && \ - cp -r $(call gb_UnpackedTarball_get_dir,$(2)) $(call gb_UnpackedTarball_get_pristine_dir,$(2)) && \ + cp -r $(gb_UnpackedTarball_workdir)/$(2) $(call gb_UnpackedTarball_get_pristine_dir,$(2)) && \ ) \ touch $(1) \ )\ @@ -172,7 +172,7 @@ $(call gb_UnpackedTarball_get_preparation_target,%) : $(call gb_UnpackedTarball_get_target,%) : $(call gb_Output_announce,$*,$(true),PAT,2) $(call gb_Trace_StartRange,$*,PAT) - $(call gb_UnpackedTarball__command,$@,$*,$(call gb_UnpackedTarball_get_dir,$*)) + $(call gb_UnpackedTarball__command,$@,$*,$(gb_UnpackedTarball_workdir)/$*) $(call gb_Trace_EndRange,$*,PAT) $(call gb_UnpackedTarball_get_final_target,%) : @@ -186,7 +186,7 @@ $(call gb_UnpackedTarball_get_clean_target,%) : $(call gb_UnpackedTarball_get_final_target,$*) \ $(call gb_UnpackedTarball_get_target,$*) \ $(call gb_UnpackedTarball_get_preparation_target,$*) \ - $(call gb_UnpackedTarball_get_dir,$*) \ + $(gb_UnpackedTarball_workdir)/$* \ $(call gb_UnpackedTarball_get_pristine_dir,$*) \ ) @@ -229,14 +229,14 @@ endef # # gb_UnpackedTarball_fix_end_of_line unpacked file(s) define gb_UnpackedTarball_fix_end_of_line -$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_FIX_EOL += $(addprefix $(call gb_UnpackedTarball_get_dir,$(1))/,$(2)) +$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_FIX_EOL += $(addprefix $(gb_UnpackedTarball_workdir)/$(1)/,$(2)) endef # Internal version of set_tarball, mostly to avoid repeated invocation of $(shell define gb_UnpackedTarball_set_tarball_internal -$(call gb_UnpackedTarget_UnpackedTarget,$(2),$(call gb_UnpackedTarball_get_dir,$(1)),$(3),$(4)) +$(call gb_UnpackedTarget_UnpackedTarget,$(2),$(gb_UnpackedTarball_workdir)/$(1),$(3),$(4)) $(call gb_UnpackedTarball_get_target,$(1)) : $(call gb_UnpackedTarget_get_target,$(2)) $(call gb_UnpackedTarball_get_clean_target,$(1)) : $(call gb_UnpackedTarget_get_clean_target,$(2)) $(call gb_UnpackedTarget_get_target,$(2)) : $(call gb_UnpackedTarball_get_preparation_target,$(1)) @@ -247,7 +247,7 @@ $(if $(findstring out,$(5)),$(call gb_Module_get_target,$(4)) : $(TARFILE_LOCATI $(TARFILE_LOCATION)/$(6) : $(call gb_Module_get_nonl10n_target,$(4)) $$(call gb_Output_announce,$(6),$(true),PKB,3) $$(call gb_Trace_StartRange,$(6),PKB) - if test ! -f "$$@" ; then cd $(call gb_UnpackedTarball_get_dir,) && $(GNUTAR) -czf "$$@" $(1)/ || $(GNUTAR) -czf "$$@" $(1)/ ; else touch "$$@" ; fi + if test ! -f "$$@" ; then cd $(gb_UnpackedTarball_workdir)/ && $(GNUTAR) -czf "$$@" $(1)/ || $(GNUTAR) -czf "$$@" $(1)/ ; else touch "$$@" ; fi $$(call gb_Trace_EndRange,$(6),PKB) ) @@ -314,7 +314,7 @@ endef # gb_UnpackedTarball_add_file unpacked destfile file define gb_UnpackedTarball_add_file $(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_FILES += $(SRCDIR)/$(3) -$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_DESTFILES += $(call gb_UnpackedTarball_get_dir,$(1))/$(2) +$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_DESTFILES += $(gb_UnpackedTarball_workdir)/$(1)/$(2) $(call gb_UnpackedTarball_get_preparation_target,$(1)) : $(SRCDIR)/$(3) endef @@ -363,7 +363,7 @@ $(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_POST_ACTION := $(strip $(2 endef define gb_UnpackedTarbal__make_pattern_rule -$(call gb_UnpackedTarball_get_dir,$(1))/%$(2) : +$(gb_UnpackedTarball_workdir)/$(1)/%$(2) : $$(if $$(wildcard $$@),,$$(call gb_Output_error,file $$@ does not exist in the tarball)) $$(if $$(UNPACKED_MODE),chmod $$(UNPACKED_MODE) $$@ &&) \ touch $$@ @@ -378,7 +378,7 @@ $(if $(filter $(2),$(gb_UnpackedTarball_PATTERN_RULES_$(1))),,$(call gb_Unpacked endef define gb_UnpackedTarbal__make_file_rule -$(call gb_UnpackedTarball_get_dir,$(1))/$(2) : +$(gb_UnpackedTarball_workdir)/$(1)/$(2) : $$(if $$(wildcard $$@),,$$(call gb_Output_error,file $$@ does not exist in the tarball)) $$(if $$(UNPACKED_MODE),chmod $$(UNPACKED_MODE) $$@ &&) \ touch $$@ @@ -395,9 +395,9 @@ endef # # gb_UnpackedTarball_mark_output_file unpacked file define gb_UnpackedTarball_mark_output_file -$(call gb_UnpackedTarball_get_final_target,$(1)) : $(call gb_UnpackedTarball_get_dir,$(1))/$(2) -$(call gb_UnpackedTarball_get_dir,$(1))/$(2) : $(call gb_UnpackedTarball_get_target,$(1)) -$(call gb_UnpackedTarball_get_dir,$(1))/$(2) : UNPACKED_MODE := 644 +$(call gb_UnpackedTarball_get_final_target,$(1)) : $(gb_UnpackedTarball_workdir)/$(1)/$(2) +$(gb_UnpackedTarball_workdir)/$(1)/$(2) : $(call gb_UnpackedTarball_get_target,$(1)) +$(gb_UnpackedTarball_workdir)/$(1)/$(2) : UNPACKED_MODE := 644 $(if $(suffix $(2)),\ $(call gb_UnpackedTarbal__ensure_pattern_rule,$(1),$(suffix $(2))),\ $(call gb_UnpackedTarbal__make_file_rule,$(1),$(2)) \ @@ -440,10 +440,10 @@ endef fi %.genpatch : - if [ -d $(call gb_UnpackedTarball_get_dir,$*) -a -d $(call gb_UnpackedTarball_get_pristine_dir,$*) ] ; then \ + if [ -d $(gb_UnpackedTarball_workdir)/$* -a -d $(call gb_UnpackedTarball_get_pristine_dir,$*) ] ; then \ ( \ patch_file=$$(pwd)/$*.new.patch.1; \ - cd $(call gb_UnpackedTarball_get_dir,) ; \ + cd $(gb_UnpackedTarball_workdir)/ ; \ diff -ur $*.org $* > $$patch_file; \ echo "Patch $$patch_file generated" ; \ ); \ |