From c56ae17de53e37b971fc815199bd500b0b663981 Mon Sep 17 00:00:00 2001 From: Christian Lohmaier Date: Mon, 2 Sep 2024 12:00:04 +0200 Subject: [PATCH] scp2: simplifiy language snippet creation rules get rid of some needless redirection/nesting for stuff that's only used a single time. Change-Id: Ie72c006ae1ad1839ae72a1eb19c67d2122798af2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172737 Tested-by: Jenkins Reviewed-by: Christian Lohmaier --- scp2/CustomTarget_langmacros.mk | 2 +- solenv/gbuild/InstallModuleTarget.mk | 38 ++++------------------------ 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/scp2/CustomTarget_langmacros.mk b/scp2/CustomTarget_langmacros.mk index a373f292af67..ed5ba236e701 100644 --- a/scp2/CustomTarget_langmacros.mk +++ b/scp2/CustomTarget_langmacros.mk @@ -15,7 +15,7 @@ $(gb_CustomTarget_workdir)/scp2/macros/langmacros.inc :| $(gb_CustomTarget_workd $(gb_CustomTarget_workdir)/scp2/macros/langmacros.inc : $(SRCDIR)/scp2/macros/macro.pl $(BUILDDIR)/config_host.mk.stamp $(call gb_Helper_abbreviate_dirs,\ - export COMPLETELANGISO_VAR='$(gb_ScpTemplateTarget_LANGS)' && \ + export COMPLETELANGISO_VAR='$(ALL_LANGS)' && \ export HELP_LANGS='$(gb_HELP_LANGS)' && \ $(PERL) $< -verbose -o $@ -c $(BUILDDIR)/config_host.mk.stamp \ ) diff --git a/solenv/gbuild/InstallModuleTarget.mk b/solenv/gbuild/InstallModuleTarget.mk index 872b0dd1da97..5b8864adc6ff 100644 --- a/solenv/gbuild/InstallModuleTarget.mk +++ b/solenv/gbuild/InstallModuleTarget.mk @@ -12,37 +12,13 @@ # ScpTemplateTarget class -gb_ScpTemplateTarget_TARGET := $(SRCDIR)/scp2/source/templates/modules.pl -gb_ScpTemplateTarget_COMMAND := $(PERL) -w $(gb_ScpTemplateTarget_TARGET) - -gb_ScpTemplateTarget_LANGS := $(sort $(ALL_LANGS)) - -# Pass first arg if make is running in silent mode, second arg otherwise -define gb_ScpTemplateTarget__if_silent -$(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),$(1),$(2)) -endef - -gb_ScpTemplateTarget_get_source = $(SRCDIR)/$(1).sct - -define gb_ScpTemplateTarget__command -$(call gb_Helper_abbreviate_dirs,\ - export COMPLETELANGISO_VAR='$(gb_ScpTemplateTarget_LANGS)' && \ - $(gb_ScpTemplateTarget_COMMAND) \ - $(call gb_ScpTemplateTarget__if_silent,,-verbose) \ - -i $(SCP_TEMPLATE) \ - -o $(1) \ -) -endef - -$(dir $(call gb_ScpTemplateTarget_get_target,%))%/.dir : - $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) - # depend on configure output to rebuild everything -$(call gb_ScpTemplateTarget_get_target,%) : \ - $(gb_ScpTemplateTarget_TARGET) $(BUILDDIR)/config_$(gb_Side).mk +$(call gb_ScpTemplateTarget_get_target,%) : export COMPLETELANGISO_VAR:=$(ALL_LANGS) +$(call gb_ScpTemplateTarget_get_target,%) : $(SRCDIR)/scp2/source/templates/modules.pl \ + $(BUILDDIR)/config_$(gb_Side).mk $(call gb_Output_announce,$*,$(true),SCT,1) $(call gb_Trace_StartRange,$*,SCT) - $(call gb_ScpTemplateTarget__command,$@,$*) + $(PERL) -w $< $(if $(verbose),-verbose) -i $(filter %.sct,$^) -o $@ $(call gb_Trace_EndRange,$*,SCT) .PHONY : $(call gb_ScpTemplateTarget_get_clean_target,%) @@ -52,9 +28,8 @@ $(call gb_ScpTemplateTarget_get_clean_target,%) : # gb_ScpTemplateTarget_ScpTemplateTarget() define gb_ScpTemplateTarget_ScpTemplateTarget -$(call gb_ScpTemplateTarget_get_target,$(1)) : $(call gb_ScpTemplateTarget_get_source,$(1)) +$(call gb_ScpTemplateTarget_get_target,$(1)) : $(SRCDIR)/$(1).sct $(call gb_ScpTemplateTarget_get_target,$(1)) :| $(dir $(call gb_ScpTemplateTarget_get_target,$(1))).dir -$(call gb_ScpTemplateTarget_get_target,$(1)) : SCP_TEMPLATE := $(call gb_ScpTemplateTarget_get_source,$(1)) endef @@ -76,9 +51,6 @@ $(call gb_Helper_abbreviate_dirs,\ ) endef -$(dir $(call gb_ScpPreprocessTarget_get_target,%))%/.dir : - $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) - # depend on configure output to rebuild everything $(call gb_ScpPreprocessTarget_get_target,%) : \ $(gb_ScpPreprocessTarget_DEPS) $(BUILDDIR)/config_$(gb_Side).mk