From 1deb3f671107b59cb0d5f10f62c6adfa9757c268 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sun, 29 Jan 2012 15:21:50 +0100 Subject: split rdb generation out of UnoApiTarget --- solenv/gbuild/TargetLocations.mk | 6 ++- solenv/gbuild/TypesRdb.mk | 89 ++++++++++++++++++++++++++++++++++++++++ solenv/gbuild/UnoApiTarget.mk | 38 ++++++++--------- solenv/gbuild/gbuild.mk | 1 + 4 files changed, 113 insertions(+), 21 deletions(-) create mode 100644 solenv/gbuild/TypesRdb.mk (limited to 'solenv') diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index b49f890dd196..c5c7d8635975 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -38,6 +38,7 @@ gb_PackagePart_get_destinations = \ $(OUTDIR)/inc \ $(OUTDIR)/lib \ $(OUTDIR)/pck \ + $(OUTDIR)/rdb \ $(OUTDIR)/unittest \ $(OUTDIR)/xml \ @@ -45,6 +46,7 @@ gb_PackagePart_get_target = $(OUTDIR)/$(1) gb_Rdb_get_outdir_target = $(OUTDIR)/xml/$(1).rdb gb_ResTarget_get_outdir_imagelist_target = $(OUTDIR)/res/img/$(1).ilst gb_ResTarget_get_outdir_target = $(OUTDIR)/bin/$(1).res +gb_TypesRdb_get_outdir_target = $(OUTDIR)/rdb/$(1).rdb gb_Jar_get_outdir_target = $(OUTDIR)/bin/$(1).jar gb_Zip_get_outdir_target = $(OUTDIR)/pck/$(1).zip # outdir targets: $(1) is path @@ -116,7 +118,8 @@ gb_SrsPartTarget_get_target = $(WORKDIR)/SrsPartTarget/$(1) gb_SrsTarget_get_target = $(WORKDIR)/SrsTarget/$(1).srs gb_SrsTemplatePartTarget_get_target = $(WORKDIR)/inc/$(firstword $(subst /, ,$(1)))/$(subst _tmpl,,$(notdir $(1))) gb_SrsTemplateTarget_get_target = $(WORKDIR)/SrsTemplateTarget/$(1) -gb_UnoApiTarget_get_target = $(WORKDIR)/UnoApiTarget/$(1).rdb +gb_TypesRdb_get_target = $(WORKDIR)/TypesRdb/$(1).rdb +gb_UnoApiTarget_get_target = $(WORKDIR)/UnoApiTarget/$(1).done gb_UnoApiOutTarget_get_target = $(OUTDIR)/bin/$(1).rdb gb_UnoApiPartTarget_get_target = $(WORKDIR)/UnoApiPartTarget/$(1) gb_UnoApiTarget_get_header_target = $(WORKDIR)/UnoApiHeaders/$(1) @@ -171,6 +174,7 @@ $(eval $(call gb_Helper_make_clean_targets,\ SdiTarget \ SrsTarget \ SrsTemplateTarget \ + TypesRdb \ CppunitTest \ CustomTarget \ ExternalLib \ diff --git a/solenv/gbuild/TypesRdb.mk b/solenv/gbuild/TypesRdb.mk new file mode 100644 index 000000000000..9beb9218a07a --- /dev/null +++ b/solenv/gbuild/TypesRdb.mk @@ -0,0 +1,89 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# Major Contributor(s): +# Copyright (C) 2010 Red Hat, Inc., David Tardon +# (initial developer) +# +# All Rights Reserved. +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +gb_TypesRdb_REGMERGETARGET := $(call gb_Executable_get_target_for_build,regmerge) +gb_TypesRdb_REGMERGECOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_TypesRdb_REGMERGETARGET) + +define gb_TypesRdb__command_impl +RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,$(call gb_Helper_convert_native,$(1) $(2) $(3))) && \ +$(gb_TypesRdb_REGMERGECOMMAND) @$${RESPONSEFILE} && \ +rm -f $${RESPONSEFILE} +endef + +define gb_TypesRdb__command +$(call gb_Output_announce,$*,$(true),RDB,3) +mkdir -p $(dir $(1)) && \ +$(if $(TYPESRDB_FILES),$(call gb_TypesRdb__command_impl,$(1),UCR,$(TYPESRDB_FILES)),true) && \ +$(if $(TYPESRDB_MERGE),$(call gb_TypesRdb__command_impl,$(1),/,$(TYPESRDB_MERGE)),true) +endef + +$(call gb_TypesRdb_get_outdir_target,%) : + $(call gb_Deliver_deliver,$(call gb_TypesRdb_get_target,$*),$@) + +$(call gb_TypesRdb_get_target,%) : + $(call gb_TypesRdb__command,$@,$*,$<,$?) + +.PHONY : $(call gb_TypesRdb_get_clean_target,%) +$(call gb_TypesRdb_get_clean_target,%) : + $(call gb_Output_announce,$*,$(false),RDB,3) + $(call gb_Helper_convert_native,\ + rm -f $(call gb_TypesRdb_get_target,$*) $(call gb_TypesRdb_get_outdir_target,$*)) + +define gb_TypesRdb_TypesRdb +$(call gb_TypesRdb_get_outdir_target,$(1)) : $(call gb_TypesRdb_get_target,$(1)) +$(call gb_TypesRdb_get_target,$(1)) : TYPESRDB_FILES := +$(call gb_TypesRdb_get_target,$(1)) : TYPESRDB_MERGE := + +$(call gb_Deliver_add_deliverable,$(call gb_TypesRdb_get_outdir_target,$(1)),$(call gb_TypesRdb_get_target,$(1)),$(1)) + +$$(eval $$(call gb_Module_register_target,$(call gb_TypesRdb_get_outdir_target,$(1)),$(call gb_TypesRdb_get_clean_target,$(1)))) + +endef + +define gb_TypesRdb_add_urdfile +$(call gb_TypesRdb_get_target,$(1)) : TYPESRDB_FILES += $(2) +$(call gb_TypesRdb_get_target,$(1)) : $(2) + +endef + +define gb_TypesRdb_add_urdfiles +$(foreach urd,$(2),$(call gb_TypesRdb_add_urdfile,$(1),$(urd))) + +endef + +define gb_TypesRdb_add_rdbfile +$(call gb_TypesRdb_get_target,$(1)) : TYPESRDB_MERGE += $(call gb_TypesRdb_get_outdir_target,$(2)) +$(call gb_TypesRdb_get_target,$(1)) : $(call gb_TypesRdb_get_outdir_target,$(2)) + +endef + +define gb_TypesRdb_add_rdbfiles +$(foreach rdb,$(2),$(call gb_TypesRdb_add_rdbfile,$(1),$(rdb))) + +endef + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk index 4614fc6df304..8d8ed4703901 100644 --- a/solenv/gbuild/UnoApiTarget.mk +++ b/solenv/gbuild/UnoApiTarget.mk @@ -28,8 +28,6 @@ gb_UnoApiTarget_IDLCTARGET := $(OUTDIR_FOR_BUILD)/bin/idlc$(gb_Executable_EXT_for_build) gb_UnoApiTarget_IDLCCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_IDLCTARGET) -gb_UnoApiTarget_REGMERGETARGET := $(OUTDIR_FOR_BUILD)/bin/regmerge$(gb_Executable_EXT_for_build) -gb_UnoApiTarget_REGMERGECOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_REGMERGETARGET) gb_UnoApiTarget_REGCOMPARETARGET := $(OUTDIR_FOR_BUILD)/bin/regcompare$(gb_Executable_EXT_for_build) gb_UnoApiTarget_REGCOMPARECOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_REGCOMPARETARGET) gb_UnoApiTarget_CPPUMAKERTARGET := $(OUTDIR_FOR_BUILD)/bin/cppumaker$(gb_Executable_EXT_for_build) @@ -37,6 +35,9 @@ gb_UnoApiTarget_CPPUMAKERCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDI gb_UnoApiTarget_REGVIEWTARGET := $(OUTDIR_FOR_BUILD)/bin/regview$(gb_Executable_EXT_for_build) gb_UnoApiTarget_REGVIEWCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_REGVIEWTARGET) +$(call gb_UnoApiOutTarget_get_target,%) : + $(call gb_Deliver_deliver,$(call gb_TypesRdb_get_target,$*),$@) + define gb_UnoApiTarget_autopackage_inc $$(eval $$(call gb_Package_Package,$(1)_inc,$$(patsubst %/empty,%,$$(call gb_UnoApiTarget_get_header_target,empty)))) $(foreach onefile,$(gb_UnoApiTarget_HPPFILES_$(1)), \ @@ -54,12 +55,15 @@ $(foreach onefile,$(gb_UnoApiTarget_IDLFILES_$(1)), \ endef define gb_UnoApiTarget_UnoApiTarget +$(call gb_TypesRdb_TypesRdb,$(1)) $$(eval $$(call gb_Module_register_target,$(call gb_UnoApiOutTarget_get_target,$(1)),$(call gb_UnoApiOutTarget_get_clean_target,$(1)))) $(call gb_UnoApiOutTarget_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) +$(call gb_UnoApiOutTarget_get_target,$(1)) : $(call gb_TypesRdb_get_outdir_target,$(1)) $(call gb_UnoApiOutTarget_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_clean_target,$(1)) +$(call gb_UnoApiTarget_get_target,$(1)) : $(call gb_TypesRdb_get_target,$(1)) +$(call gb_UnoApiTarget_get_clean_target,$(1)) : $(call gb_TypesRdb_get_clean_target,$(1)) $(call gb_UnoApiTarget_get_target,$(1)) : INCLUDE := $(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_DEPS := -$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_MERGE := $(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_REFERENCE := gb_UnoApiTarget_HPPFILES_$(1) := gb_UnoApiTarget_IDLFILES_$(1) := @@ -73,6 +77,7 @@ define gb_UnoApiTarget__add_idlfile $(call gb_UnoApiPartTarget_get_target,$(2)/idl.done) : \ $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd) gb_UnoApiTarget_IDLFILES_$(1) += $(2)/$(3).idl +$(call gb_TypesRdb_add_urdfile,$(1),$(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)) ifeq ($(gb_FULLDEPS),$(true)) $(call gb_UnoApiTarget_get_dep_target,$(1)) : \ @@ -145,9 +150,9 @@ $(foreach rdb,$(2),$(call gb_UnoApiTarget_add_rdbfile,$(1),$(rdb))) endef define gb_UnoApiTarget_add_rdbfile -$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_DEPS += -X$(call gb_UnoApiOutTarget_get_target,$(2)) +$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_DEPS += -X$(call gb_TypesRdb_get_outdir_target,$(2)) $(call gb_UnoApiTarget_get_target,$(1)) : \ - $(call gb_UnoApiOutTarget_get_target,$(2)) \ + $(call gb_TypesRdb_get_outdir_target,$(2)) \ $(call gb_Package_get_target,$(2)_idl) endef @@ -158,8 +163,7 @@ $(foreach rdb,$(2),$(call gb_UnoApiTarget_add_merge_rdbfile,$(1),$(rdb))) endef define gb_UnoApiTarget_add_merge_rdbfile -$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_MERGE += $(call gb_UnoApiOutTarget_get_target,$(2)) -$(call gb_UnoApiTarget_get_target,$(1)) : $(call gb_UnoApiOutTarget_get_target,$(2)) +$(call gb_TypesRdb_add_rdbfile,$(1),$(2)) endef @@ -175,13 +179,12 @@ endef .PHONY : $(call gb_UnoApiOutTarget_get_clean_target,%) $(call gb_UnoApiOutTarget_get_clean_target,%) : - $(call gb_Output_announce,$*,$(false),UNO,1) -$(call gb_Helper_abbreviate_dirs,\ rm -f $(call gb_UnoApiOutTarget_get_target,$*)) .PHONY : $(call gb_UnoApiTarget_get_clean_target,%) $(call gb_UnoApiTarget_get_clean_target,%) : - $(call gb_Output_announce,$*,$(false),UNO,1) + $(call gb_Output_announce,$*,$(false),UNO,2) -$(call gb_Helper_abbreviate_dirs,\ rm -f $(call gb_UnoApiTarget_get_target,$*)) -rm -rf $(call gb_UnoApiTarget_get_header_target,$*)\ @@ -221,15 +224,12 @@ define gb_UnoApiPartTarget__command endef define gb_UnoApiTarget__command - mkdir -p $(dir $(1)) && \ - RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,$(call gb_Helper_convert_native,$(1) $(4) $(5))) && \ - $(gb_UnoApiTarget_REGMERGECOMMAND) @$${RESPONSEFILE} && \ - rm -f $${RESPONSEFILE} - +$(call gb_Output_announce,$*,$(true),UNO,2) +$(call gb_Helper_abbreviate_dirs_native,\ + mkdir -p $(dir $(1)) && touch $(1)) endef define gb_UnoApiHeaderTarget__command - mkdir -p $(dir $(1)) && \ RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,\ $(call gb_Helper_convert_native,-Gc -L -BUCR \ -O$(call gb_UnoApiTarget_get_header_target,$(2)) $(3) $(1))) && \ @@ -265,14 +265,12 @@ endif # - empty $? in headertarget? $(call gb_UnoApiTarget_get_target,%): - $(call gb_Output_announce,$*,$(true),RDB,3) - $(if $(gb_UnoApiTarget_IDLFILES_$*),$(call gb_UnoApiTarget__command,$@,$*,$<,UCR,$(addprefix $(call gb_UnoApiPartTarget_get_target,),$(patsubst %.idl,%.urd,$(gb_UnoApiTarget_IDLFILES_$*))))) - $(if $(UNOAPI_MERGE),$(call gb_UnoApiTarget__command,$@,$*,$<,/,$(UNOAPI_MERGE))) + $(call gb_UnoApiTarget__command,$@,$*,$<,$?) $(if $(UNOAPI_REFERENCE), \ $(call gb_Output_announce,$*,$(true),DBc,4) \ - $(gb_UnoApiTarget_REGCOMPARECOMMAND) -f -t -r1 $(call gb_Helper_convert_native,$(UNOAPI_REFERENCE)) -r2 $(call gb_Helper_convert_native,$@)) + $(gb_UnoApiTarget_REGCOMPARECOMMAND) -f -t -r1 $(call gb_Helper_convert_native,$(UNOAPI_REFERENCE)) -r2 $(call gb_Helper_convert_native,$(call gb_TypesRdb_get_target,$*))) $(if $(gb_UnoApiTarget_IDLFILES_$*), \ $(call gb_Output_announce,$*,$(true),HPP,4) \ - $(call gb_UnoApiHeaderTarget__command,$@,$*,$(UNOAPI_DEPS))) + $(call gb_UnoApiHeaderTarget__command,$(call gb_TypesRdb_get_target,$*),$*,$(UNOAPI_DEPS))) # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index 1633bd936f2f..6884b34520f8 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -289,6 +289,7 @@ include $(foreach class, \ JavaClassSet \ JunitTest \ Module \ + TypesRdb \ UnoApiTarget \ Zip \ Configuration \ -- cgit From 7b2331fef6518817934c2582a9ffa0bf55057a0f Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sun, 29 Jan 2012 15:33:16 +0100 Subject: simplify UnoApiTarget's targets --- solenv/gbuild/TargetLocations.mk | 3 +-- solenv/gbuild/UnoApiTarget.mk | 17 ++++++----------- 2 files changed, 7 insertions(+), 13 deletions(-) (limited to 'solenv') diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index c5c7d8635975..3bce08d293d9 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -47,6 +47,7 @@ gb_Rdb_get_outdir_target = $(OUTDIR)/xml/$(1).rdb gb_ResTarget_get_outdir_imagelist_target = $(OUTDIR)/res/img/$(1).ilst gb_ResTarget_get_outdir_target = $(OUTDIR)/bin/$(1).res gb_TypesRdb_get_outdir_target = $(OUTDIR)/rdb/$(1).rdb +gb_UnoApiTarget_get_outdir_target = $(OUTDIR)/bin/$(1).rdb gb_Jar_get_outdir_target = $(OUTDIR)/bin/$(1).jar gb_Zip_get_outdir_target = $(OUTDIR)/pck/$(1).zip # outdir targets: $(1) is path @@ -120,7 +121,6 @@ gb_SrsTemplatePartTarget_get_target = $(WORKDIR)/inc/$(firstword $(subst /, ,$(1 gb_SrsTemplateTarget_get_target = $(WORKDIR)/SrsTemplateTarget/$(1) gb_TypesRdb_get_target = $(WORKDIR)/TypesRdb/$(1).rdb gb_UnoApiTarget_get_target = $(WORKDIR)/UnoApiTarget/$(1).done -gb_UnoApiOutTarget_get_target = $(OUTDIR)/bin/$(1).rdb gb_UnoApiPartTarget_get_target = $(WORKDIR)/UnoApiPartTarget/$(1) gb_UnoApiTarget_get_header_target = $(WORKDIR)/UnoApiHeaders/$(1) gb_WinResTarget_get_target = $(WORKDIR)/WinResTarget/$(1)$(gb_WinResTarget_POSTFIX) @@ -195,7 +195,6 @@ $(eval $(call gb_Helper_make_outdir_clean_targets,\ Executable \ Library \ StaticLibrary \ - UnoApiOutTarget \ )) $(eval $(call gb_Helper_make_dep_targets,\ diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk index 8d8ed4703901..0747655360d8 100644 --- a/solenv/gbuild/UnoApiTarget.mk +++ b/solenv/gbuild/UnoApiTarget.mk @@ -35,7 +35,7 @@ gb_UnoApiTarget_CPPUMAKERCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDI gb_UnoApiTarget_REGVIEWTARGET := $(OUTDIR_FOR_BUILD)/bin/regview$(gb_Executable_EXT_for_build) gb_UnoApiTarget_REGVIEWCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_REGVIEWTARGET) -$(call gb_UnoApiOutTarget_get_target,%) : +$(call gb_UnoApiTarget_get_outdir_target,%) : $(call gb_Deliver_deliver,$(call gb_TypesRdb_get_target,$*),$@) define gb_UnoApiTarget_autopackage_inc @@ -56,10 +56,9 @@ endef define gb_UnoApiTarget_UnoApiTarget $(call gb_TypesRdb_TypesRdb,$(1)) -$$(eval $$(call gb_Module_register_target,$(call gb_UnoApiOutTarget_get_target,$(1)),$(call gb_UnoApiOutTarget_get_clean_target,$(1)))) -$(call gb_UnoApiOutTarget_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) -$(call gb_UnoApiOutTarget_get_target,$(1)) : $(call gb_TypesRdb_get_outdir_target,$(1)) -$(call gb_UnoApiOutTarget_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_clean_target,$(1)) +$$(eval $$(call gb_Module_register_target,$(call gb_UnoApiTarget_get_outdir_target,$(1)),$(call gb_UnoApiTarget_get_clean_target,$(1)))) +$(call gb_UnoApiTarget_get_outdir_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) +$(call gb_UnoApiTarget_get_outdir_target,$(1)) : $(call gb_TypesRdb_get_outdir_target,$(1)) $(call gb_UnoApiTarget_get_target,$(1)) : $(call gb_TypesRdb_get_target,$(1)) $(call gb_UnoApiTarget_get_clean_target,$(1)) : $(call gb_TypesRdb_get_clean_target,$(1)) $(call gb_UnoApiTarget_get_target,$(1)) : INCLUDE := @@ -177,16 +176,12 @@ $(call gb_UnoApiTarget_get_target,$(1)) : INCLUDE := $(2) endef -.PHONY : $(call gb_UnoApiOutTarget_get_clean_target,%) -$(call gb_UnoApiOutTarget_get_clean_target,%) : - -$(call gb_Helper_abbreviate_dirs,\ - rm -f $(call gb_UnoApiOutTarget_get_target,$*)) - .PHONY : $(call gb_UnoApiTarget_get_clean_target,%) $(call gb_UnoApiTarget_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),UNO,2) -$(call gb_Helper_abbreviate_dirs,\ - rm -f $(call gb_UnoApiTarget_get_target,$*)) + rm -f $(call gb_UnoApiTarget_get_target,$*) \ + $(call gb_UnoApiTarget_get_outdir_target,$*)) -rm -rf $(call gb_UnoApiTarget_get_header_target,$*)\ $(call gb_UnoApiTarget_get_dep_target,$*) \ $(basename $(call gb_UnoApiPartTarget_get_dep_target,$*)) \ -- cgit From 5d4f2cf9a449535e5365613ae50a1c3cca030eb0 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sun, 29 Jan 2012 15:36:59 +0100 Subject: add add_deliverable call --- solenv/gbuild/UnoApiTarget.mk | 3 +++ 1 file changed, 3 insertions(+) (limited to 'solenv') diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk index 0747655360d8..3fc9cfe0d592 100644 --- a/solenv/gbuild/UnoApiTarget.mk +++ b/solenv/gbuild/UnoApiTarget.mk @@ -66,6 +66,9 @@ $(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_DEPS := $(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_REFERENCE := gb_UnoApiTarget_HPPFILES_$(1) := gb_UnoApiTarget_IDLFILES_$(1) := + +$(call gb_Deliver_add_deliverable,$(call gb_UnoApiTarget_get_outdir_target,$(1)),$(call gb_TypesRdb_get_target,$(1)),$(1)) + ifeq ($(gb_FULLDEPS),$(true)) -include $(call gb_UnoApiTarget_get_dep_target,$(1)) endif -- cgit From 295b09a63240d0a591921a40dc949784a441ce99 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sun, 11 Mar 2012 15:28:34 +0100 Subject: refactor UnoApi class --- solenv/gbuild/TargetLocations.mk | 18 ++- solenv/gbuild/TypesRdb.mk | 89 ----------- solenv/gbuild/UnoApi.mk | 156 ++++++++++++++++++ solenv/gbuild/UnoApiMerge.mk | 59 +++++++ solenv/gbuild/UnoApiTarget.mk | 333 ++++++++++++++++++++------------------- solenv/gbuild/gbuild.mk | 3 +- 6 files changed, 401 insertions(+), 257 deletions(-) delete mode 100644 solenv/gbuild/TypesRdb.mk create mode 100644 solenv/gbuild/UnoApi.mk create mode 100644 solenv/gbuild/UnoApiMerge.mk (limited to 'solenv') diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 3bce08d293d9..858045e7fd8e 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -46,8 +46,8 @@ gb_PackagePart_get_target = $(OUTDIR)/$(1) gb_Rdb_get_outdir_target = $(OUTDIR)/xml/$(1).rdb gb_ResTarget_get_outdir_imagelist_target = $(OUTDIR)/res/img/$(1).ilst gb_ResTarget_get_outdir_target = $(OUTDIR)/bin/$(1).res -gb_TypesRdb_get_outdir_target = $(OUTDIR)/rdb/$(1).rdb -gb_UnoApiTarget_get_outdir_target = $(OUTDIR)/bin/$(1).rdb +gb_UnoApi_get_target = $(OUTDIR)/bin/$(1).rdb +gb_UnoApiMerge_get_target = $(OUTDIR)/bin/$(1).rdb gb_Jar_get_outdir_target = $(OUTDIR)/bin/$(1).jar gb_Zip_get_outdir_target = $(OUTDIR)/pck/$(1).zip # outdir targets: $(1) is path @@ -119,10 +119,14 @@ gb_SrsPartTarget_get_target = $(WORKDIR)/SrsPartTarget/$(1) gb_SrsTarget_get_target = $(WORKDIR)/SrsTarget/$(1).srs gb_SrsTemplatePartTarget_get_target = $(WORKDIR)/inc/$(firstword $(subst /, ,$(1)))/$(subst _tmpl,,$(notdir $(1))) gb_SrsTemplateTarget_get_target = $(WORKDIR)/SrsTemplateTarget/$(1) -gb_TypesRdb_get_target = $(WORKDIR)/TypesRdb/$(1).rdb -gb_UnoApiTarget_get_target = $(WORKDIR)/UnoApiTarget/$(1).done +gb_UnoApiTarget_get_target = $(WORKDIR)/UnoApiTarget/$(1).rdb +gb_UnoApiHeadersTarget_get_comprehensive_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/comprehensive +gb_UnoApiHeadersTarget_get_lightweight_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/lightweight +gb_UnoApiHeadersTarget_get_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/normal +gb_UnoApiHeadersTarget_get_comprehensive_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/comprehensive.done +gb_UnoApiHeadersTarget_get_lightweight_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/lightweight.done +gb_UnoApiHeadersTarget_get_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/normal.done gb_UnoApiPartTarget_get_target = $(WORKDIR)/UnoApiPartTarget/$(1) -gb_UnoApiTarget_get_header_target = $(WORKDIR)/UnoApiHeaders/$(1) gb_WinResTarget_get_target = $(WORKDIR)/WinResTarget/$(1)$(gb_WinResTarget_POSTFIX) # workdir targets: $(1) is prefix/path gb_Configuration_get_target = $(WORKDIR)/Configuration/$(1).done @@ -174,10 +178,10 @@ $(eval $(call gb_Helper_make_clean_targets,\ SdiTarget \ SrsTarget \ SrsTemplateTarget \ - TypesRdb \ CppunitTest \ CustomTarget \ ExternalLib \ + UnoApiHeadersTarget \ UnoApiTarget \ WinResTarget \ YaccTarget \ @@ -195,6 +199,8 @@ $(eval $(call gb_Helper_make_outdir_clean_targets,\ Executable \ Library \ StaticLibrary \ + UnoApi \ + UnoApiMerge \ )) $(eval $(call gb_Helper_make_dep_targets,\ diff --git a/solenv/gbuild/TypesRdb.mk b/solenv/gbuild/TypesRdb.mk deleted file mode 100644 index 9beb9218a07a..000000000000 --- a/solenv/gbuild/TypesRdb.mk +++ /dev/null @@ -1,89 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# Version: MPL 1.1 / GPLv3+ / LGPLv3+ -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License or as specified alternatively below. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# Major Contributor(s): -# Copyright (C) 2010 Red Hat, Inc., David Tardon -# (initial developer) -# -# All Rights Reserved. -# -# For minor contributions see the git repository. -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 3 or later (the "GPLv3+"), or -# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), -# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable -# instead of those above. - -gb_TypesRdb_REGMERGETARGET := $(call gb_Executable_get_target_for_build,regmerge) -gb_TypesRdb_REGMERGECOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_TypesRdb_REGMERGETARGET) - -define gb_TypesRdb__command_impl -RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,$(call gb_Helper_convert_native,$(1) $(2) $(3))) && \ -$(gb_TypesRdb_REGMERGECOMMAND) @$${RESPONSEFILE} && \ -rm -f $${RESPONSEFILE} -endef - -define gb_TypesRdb__command -$(call gb_Output_announce,$*,$(true),RDB,3) -mkdir -p $(dir $(1)) && \ -$(if $(TYPESRDB_FILES),$(call gb_TypesRdb__command_impl,$(1),UCR,$(TYPESRDB_FILES)),true) && \ -$(if $(TYPESRDB_MERGE),$(call gb_TypesRdb__command_impl,$(1),/,$(TYPESRDB_MERGE)),true) -endef - -$(call gb_TypesRdb_get_outdir_target,%) : - $(call gb_Deliver_deliver,$(call gb_TypesRdb_get_target,$*),$@) - -$(call gb_TypesRdb_get_target,%) : - $(call gb_TypesRdb__command,$@,$*,$<,$?) - -.PHONY : $(call gb_TypesRdb_get_clean_target,%) -$(call gb_TypesRdb_get_clean_target,%) : - $(call gb_Output_announce,$*,$(false),RDB,3) - $(call gb_Helper_convert_native,\ - rm -f $(call gb_TypesRdb_get_target,$*) $(call gb_TypesRdb_get_outdir_target,$*)) - -define gb_TypesRdb_TypesRdb -$(call gb_TypesRdb_get_outdir_target,$(1)) : $(call gb_TypesRdb_get_target,$(1)) -$(call gb_TypesRdb_get_target,$(1)) : TYPESRDB_FILES := -$(call gb_TypesRdb_get_target,$(1)) : TYPESRDB_MERGE := - -$(call gb_Deliver_add_deliverable,$(call gb_TypesRdb_get_outdir_target,$(1)),$(call gb_TypesRdb_get_target,$(1)),$(1)) - -$$(eval $$(call gb_Module_register_target,$(call gb_TypesRdb_get_outdir_target,$(1)),$(call gb_TypesRdb_get_clean_target,$(1)))) - -endef - -define gb_TypesRdb_add_urdfile -$(call gb_TypesRdb_get_target,$(1)) : TYPESRDB_FILES += $(2) -$(call gb_TypesRdb_get_target,$(1)) : $(2) - -endef - -define gb_TypesRdb_add_urdfiles -$(foreach urd,$(2),$(call gb_TypesRdb_add_urdfile,$(1),$(urd))) - -endef - -define gb_TypesRdb_add_rdbfile -$(call gb_TypesRdb_get_target,$(1)) : TYPESRDB_MERGE += $(call gb_TypesRdb_get_outdir_target,$(2)) -$(call gb_TypesRdb_get_target,$(1)) : $(call gb_TypesRdb_get_outdir_target,$(2)) - -endef - -define gb_TypesRdb_add_rdbfiles -$(foreach rdb,$(2),$(call gb_TypesRdb_add_rdbfile,$(1),$(rdb))) - -endef - -# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/UnoApi.mk b/solenv/gbuild/UnoApi.mk new file mode 100644 index 000000000000..8348826ee903 --- /dev/null +++ b/solenv/gbuild/UnoApi.mk @@ -0,0 +1,156 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# Major Contributor(s): +# Copyright (C) 2012 Red Hat, Inc., David Tardon +# (initial developer) +# +# All Rights Reserved. +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +$(call gb_UnoApi_get_target,%) : + $(call gb_Output_announce,$*,$(true),UNO,4) + $(call gb_Deliver_deliver,$(call gb_UnoApiTarget_get_target,$*),$@) + +.PHONY : $(call gb_UnoApi_get_clean_target,%) +$(call gb_UnoApi_get_clean_target,%) : + $(call gb_Output_announce,$*,$(false),UNO,4) + $(call gb_Helper_abbreviate_dirs_native,\ + rm -f $(call gb_UnoApi_get_target,$*)) + +define gb_UnoApi_UnoApi +$(call gb_UnoApiTarget_UnoApiTarget,$(1)) +$(call gb_UnoApiHeadersTarget_UnoApiHeadersTarget,$(1)) +$(call gb_Package_Package,$(1)_idl,$(SRCDIR)) +$(call gb_Package_Package,$(1)_inc,$(call gb_UnoApiHeadersTarget_get_lightweight_dir,$(1))) + +$(call gb_UnoApi_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) +$(call gb_UnoApi_get_target,$(1)) : $(call gb_UnoApiHeadersTarget_get_lightweight_target,$(1)) +$(call gb_UnoApi_get_target,$(1)) : $(call gb_Package_get_target,$(1)_idl) +$(call gb_UnoApi_get_target,$(1)) : $(call gb_Package_get_target,$(1)_inc) +$(call gb_UnoApi_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_clean_target,$(1)) +$(call gb_UnoApi_get_clean_target,$(1)) : $(call gb_UnoApiHeadersTarget_get_clean_target,$(1)) +$(call gb_UnoApi_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(1)_idl) +$(call gb_UnoApi_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(1)_inc) + +$(call gb_Package_get_preparation_target,$(1)_inc) : $(call gb_UnoApiHeadersTarget_get_lightweight_target,$(1)) + +$(call gb_Deliver_add_deliverable,$(call gb_UnoApi_get_target,$(1)),$(call gb_UnoApiTarget_get_target,$(1)),$(1)) + +$$(eval $$(call gb_Module_register_target,$(call gb_UnoApi_get_target,$(1)),$(call gb_UnoApi_get_clean_target,$(1)))) + +endef + +define gb_UnoApi__add_idlfile +$(call gb_Package_add_file,$(1)_idl,$(patsubst $(1)/%,idl/%,$(2)),$(2)) + +endef + +define gb_UnoApi__add_headerfile_impl +$(call gb_Package_add_file,$(1)_inc,inc/$(2),$(3)) +$(call gb_UnoApiHeadersTarget_add_headerfile,$(1),$(3)) + +endef + +# Note: the expression in 3rd arg of call of gb_UnoApi__add_headerfile_impl +# removes the leftmost dir in the subpath .-) +define gb_UnoApi__add_headerfile +$(call gb_UnoApi__add_headerfile_impl,$(1),$(2),$(subst $() $(),/,$(wordlist 2,$(words $(subst /, ,$(2))),$(subst /, ,$(2))))) + +endef + +define gb_UnoApi__add_idlfile_noheader +$(call gb_UnoApi__add_idlfile,$(1),$(2).idl) + +endef + +define gb_UnoApi__add_idlfile_nohdl +$(call gb_UnoApi__add_idlfile_noheader,$(1),$(2)) +$(call gb_UnoApi__add_headerfile,$(1),$(2).hpp) + +endef + +define gb_UnoApi__add_idlfile_full +$(call gb_UnoApi__add_idlfile_nohdl,$(1),$(2)) +$(call gb_UnoApi__add_headerfile,$(1),$(2).hdl) + +endef + +# for interfaces, exceptions, structs, enums, constant groups +define gb_UnoApi_add_idlfile +$(call gb_UnoApiTarget_add_idlfile,$(1),$(2),$(3)) +$(call gb_UnoApi__add_idlfile_full,$(1),$(2)/$(3)) + +endef + +define gb_UnoApi_add_idlfiles +$(call gb_UnoApiTarget_add_idlfiles,$(1),$(2),$(3)) +$(foreach idl,$(3),$(call gb_UnoApi__add_idlfile_full,$(1),$(2)/$(idl))) + +endef + +# for new-style services +define gb_UnoApi_add_idlfile_nohdl +$(call gb_UnoApiTarget_add_idlfile,$(1),$(2),$(3)) +$(call gb_UnoApi__add_idlfile_nohdl,$(1),$(2)/$(3)) + +endef + +define gb_UnoApi_add_idlfiles_nohdl +$(call gb_UnoApiTarget_add_idlfiles,$(1),$(2),$(3)) +$(foreach idl,$(3),$(call gb_UnoApi__add_idlfile_nohdl,$(1),$(2)/$(idl))) + +endef + +# for old-style services and modules +define gb_UnoApi_add_idlfile_noheader +$(call gb_UnoApiTarget_add_idlfile,$(1),$(2),$(3)) +$(call gb_UnoApi__add_idlfile_noheader,$(1),$(2)/$(3)) + +endef + +define gb_UnoApi_add_idlfiles_noheader +$(call gb_UnoApiTarget_add_idlfiles,$(1),$(2),$(3)) +$(foreach idl,$(3),$(call gb_UnoApi__add_idlfile_noheader,$(1),$(2)/$(idl))) + +endef + +define gb_UnoApi__add_api +$(call gb_UnoApiHeadersTarget_add_rdbfile,$(1),$(2)) +$(call gb_UnoApi_get_target,$(1)) : $(call gb_UnoApi_get_target,$(2)) + +endef + +define gb_UnoApi_add_api +$(foreach rdb,$(2),$(call gb_UnoApi__add_api,$(1),$(rdb))) + +endef + +define gb_UnoApi_add_reference_rdbfile +$(call gb_UnoApiTarget_add_reference_rdbfile,$(1),$(2)) + +endef + +define gb_UnoApi_set_include +$(call gb_UnoApiTarget_set_include,$(1),$(2)) + +endef + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/UnoApiMerge.mk b/solenv/gbuild/UnoApiMerge.mk new file mode 100644 index 000000000000..d23ce75bc429 --- /dev/null +++ b/solenv/gbuild/UnoApiMerge.mk @@ -0,0 +1,59 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# Major Contributor(s): +# Copyright (C) 2012 Red Hat, Inc., David Tardon +# (initial developer) +# +# All Rights Reserved. +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +# Note: targets for this class are the same as for UnoApi, therefore +# there is no need to define them again (and if we did, they would +# overwrite the UnoApi targets anyway...) + +define gb_UnoApiMerge_UnoApiMerge +$(call gb_UnoApiTarget_UnoApiTarget,$(1)) + +$(call gb_UnoApiMerge_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) +$(call gb_UnoApiMerge_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_clean_target,$(1)) + +$(call gb_Deliver_add_deliverable,$(call gb_UnoApiMerge_get_target,$(1)),$(call gb_UnoApiTarget_get_target,$(1)),$(1)) + +$$(eval $$(call gb_Module_register_target,$(call gb_UnoApiMerge_get_target,$(1)),$(call gb_UnoApiMerge_get_clean_target,$(1)))) + +endef + +define gb_UnoApiMerge_add_rdbfile +$(call gb_UnoApiTarget_merge_rdbfile,$(1),$(2)) + +endef + +define gb_UnoApiMerge_add_rdbfiles +$(foreach rdb,$(2),$(call gb_UnoApiMerge_add_rdbfile,$(1),$(rdb))) + +endef + +define gb_UnoApiMerge_add_reference_rdbfile +$(call gb_UnoApiTarget_add_reference_rdbfile,$(1),$(2)) + +endef + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk index 3fc9cfe0d592..eaf4aa204b70 100644 --- a/solenv/gbuild/UnoApiTarget.mk +++ b/solenv/gbuild/UnoApiTarget.mk @@ -26,62 +26,141 @@ # #************************************************************************* -gb_UnoApiTarget_IDLCTARGET := $(OUTDIR_FOR_BUILD)/bin/idlc$(gb_Executable_EXT_for_build) -gb_UnoApiTarget_IDLCCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_IDLCTARGET) -gb_UnoApiTarget_REGCOMPARETARGET := $(OUTDIR_FOR_BUILD)/bin/regcompare$(gb_Executable_EXT_for_build) -gb_UnoApiTarget_REGCOMPARECOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_REGCOMPARETARGET) -gb_UnoApiTarget_CPPUMAKERTARGET := $(OUTDIR_FOR_BUILD)/bin/cppumaker$(gb_Executable_EXT_for_build) -gb_UnoApiTarget_CPPUMAKERCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_CPPUMAKERTARGET) -gb_UnoApiTarget_REGVIEWTARGET := $(OUTDIR_FOR_BUILD)/bin/regview$(gb_Executable_EXT_for_build) -gb_UnoApiTarget_REGVIEWCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_REGVIEWTARGET) +# UnoApiPartTarget + +gb_UnoApiPartTarget_IDLCTARGET := $(call gb_Executable_get_target_for_build,idlc) +gb_UnoApiPartTarget_IDLCCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiPartTarget_IDLCTARGET) -$(call gb_UnoApiTarget_get_outdir_target,%) : - $(call gb_Deliver_deliver,$(call gb_TypesRdb_get_target,$*),$@) +# The .urd files are actually created by the gb_UnoApiPartTarget__command, +# invoked for the per-directory .done files. +# The reason why .urd files are tracked is so new files that are added are +# picked up and cause a rebuild, even if older than the .done file (also, as a +# convenience for users who delete them from the workdir by hand; this dummy +# rule plus the dependency from the .done target to the .urd file plus the +# sort/patsubst call in gb_UnoApiPartTarget__command cause command to be +# invoked with the .idl file corresponding to the .urd in that case. +# Touch the .urd file, so it is newer than the .done file, causing that to +# be rebuilt and overwriting the .urd file again. +$(call gb_UnoApiPartTarget_get_target,%.urd) : + mkdir -p $(dir $@) && touch $@ -define gb_UnoApiTarget_autopackage_inc -$$(eval $$(call gb_Package_Package,$(1)_inc,$$(patsubst %/empty,%,$$(call gb_UnoApiTarget_get_header_target,empty)))) -$(foreach onefile,$(gb_UnoApiTarget_HPPFILES_$(1)), \ - $$(eval $$(call gb_Package_add_file,$(1)_inc,$(patsubst $(1)/%,inc/$(1)/%,$(onefile)),$(onefile)))) +# TODO: +# - get idlc switch "-P" (generate .urd into package dir) +# - empty $? in headertarget? -$(call gb_Package_get_target,$(1)_inc) : $(call gb_UnoApiTarget_get_target,$(1)) +define gb_UnoApiPartTarget__command + $(call gb_Output_announce,$(2),$(true),IDL,2) + mkdir -p $(call gb_UnoApiPartTarget_get_target,$(dir $(2))) && \ + RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,\ + $(call gb_Helper_convert_native,$(INCLUDE) $(DEFS) \ + -M $(basename $(call gb_UnoApiPartTarget_get_dep_target,$(dir $(2)))) \ + -O $(call gb_UnoApiPartTarget_get_target,$(dir $(2))) -verbose -C \ + $(sort $(patsubst $(call gb_UnoApiPartTarget_get_target,%.urd),$(SRCDIR)/%.idl,$(3))))) && \ + $(gb_UnoApiPartTarget_IDLCCOMMAND) @$${RESPONSEFILE} > /dev/null && \ + rm -f $${RESPONSEFILE} && \ + touch $(1) endef -define gb_UnoApiTarget_autopackage_idl -$$(eval $$(call gb_Package_Package,$(1)_idl,$(SRCDIR))) -$(foreach onefile,$(gb_UnoApiTarget_IDLFILES_$(1)), \ - $$(eval $$(call gb_Package_add_file,$(1)_idl,$(patsubst $(1)/%,idl/%,$(onefile)),$(onefile)))) +$(call gb_UnoApiPartTarget_get_target,%.done) : + $(call gb_UnoApiPartTarget__command,$@,$*,$?) + +ifeq ($(gb_FULLDEPS),$(true)) + +$(call gb_UnoApiPartTarget_get_dep_target,%) : + $(if $(realpath $@),touch $@,\ + $(call gb_Object__command_dep,$@,$(call gb_UnoApiPartTarget_get_target,$*.urd))) + +endif + +# UnoApiTarget + +gb_UnoApiTarget_REGCOMPARETARGET := $(call gb_Executable_get_target_for_build,regcompare) +gb_UnoApiTarget_REGCOMPARECOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_REGCOMPARETARGET) +gb_UnoApiTarget_REGMERGETARGET := $(call gb_Executable_get_target_for_build,regmerge) +gb_UnoApiTarget_REGMERGECOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_REGMERGETARGET) +define gb_UnoApiTarget__command_impl +RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,$(call gb_Helper_convert_native,$(1) $(2) $(3))) && \ +$(gb_UnoApiTarget_REGMERGECOMMAND) @$${RESPONSEFILE} && \ +rm -f $${RESPONSEFILE} endef +define gb_UnoApiTarget__command +$(call gb_Output_announce,$*,$(true),RDB,3) +mkdir -p $(dir $(1)) && \ +$(if $(UNOAPI_FILES),\ + $(call gb_UnoApiTarget__command_impl,$(1),UCR,$(UNOAPI_FILES)),\ + $(call gb_UnoApiTarget__command_impl,$(1),/,$(UNOAPI_MERGE))) \ +$(if $(UNOAPI_REFERENCE), \ + $(call gb_Output_announce,$*,$(true),DBc,3) \ + && $(gb_UnoApiTarget_REGCOMPARECOMMAND) \ + -f -t \ + -r1 $(call gb_Helper_convert_native,$(UNOAPI_REFERENCE)) \ + -r2 $(call gb_Helper_convert_native,$(1))) +endef + +$(call gb_UnoApiTarget_get_target,%): + $(if $(and $(UNOAPI_FILES),$(UNOAPI_MERGE)),\ + $(error Both IDL files and merged RDBs were added: this is not supported),\ + $(if $(or $(UNOAPI_FILES),$(UNOAPI_MERGE)),,\ + $(error Neither IDL files nor merged RDBs were added: nothing will be produced))) + $(call gb_UnoApiTarget__command,$@,$*,$<,$?) + +.PHONY : $(call gb_UnoApiTarget_get_clean_target,%) +$(call gb_UnoApiTarget_get_clean_target,%) : + $(call gb_Output_announce,$*,$(false),RDB,3) + -$(call gb_Helper_abbreviate_dirs,\ + rm -f $(call gb_UnoApiTarget_get_target,$*)) + -rm -rf $(call gb_UnoApiTarget_get_dep_target,$*) \ + $(basename $(call gb_UnoApiPartTarget_get_dep_target,$*)) \ + $(call gb_UnoApiPartTarget_get_target,$*) + +# cat the deps of all IDLs in one file, then we need only open that one file +define gb_UnoApiTarget__command_dep +$(call gb_Output_announce,IDL:$(2),$(true),DEP,1) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) && \ + RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\ + $(foreach idl,$(patsubst %.idl,%,$(3)),$(call gb_UnoApiPartTarget_get_dep_target,$(idl)))) && \ + $(SOLARENV)/bin/concat-deps $${RESPONSEFILE} > $(1)) && \ + rm -f $${RESPONSEFILE} + +endef + +ifeq ($(gb_FULLDEPS),$(true)) + +$(call gb_UnoApiTarget_get_dep_target,%) : $(call gb_UnoApiTarget_get_target,%) + $(call gb_UnoApiTarget__command_dep,$@,$*,$(UNOAPI_IDLFILES)) + +endif + define gb_UnoApiTarget_UnoApiTarget -$(call gb_TypesRdb_TypesRdb,$(1)) -$$(eval $$(call gb_Module_register_target,$(call gb_UnoApiTarget_get_outdir_target,$(1)),$(call gb_UnoApiTarget_get_clean_target,$(1)))) -$(call gb_UnoApiTarget_get_outdir_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) -$(call gb_UnoApiTarget_get_outdir_target,$(1)) : $(call gb_TypesRdb_get_outdir_target,$(1)) -$(call gb_UnoApiTarget_get_target,$(1)) : $(call gb_TypesRdb_get_target,$(1)) -$(call gb_UnoApiTarget_get_clean_target,$(1)) : $(call gb_TypesRdb_get_clean_target,$(1)) $(call gb_UnoApiTarget_get_target,$(1)) : INCLUDE := -$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_DEPS := +$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_FILES := +$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_MERGE := $(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_REFERENCE := -gb_UnoApiTarget_HPPFILES_$(1) := -gb_UnoApiTarget_IDLFILES_$(1) := - -$(call gb_Deliver_add_deliverable,$(call gb_UnoApiTarget_get_outdir_target,$(1)),$(call gb_TypesRdb_get_target,$(1)),$(1)) ifeq ($(gb_FULLDEPS),$(true)) +$(call gb_UnoApiTarget_get_dep_target,$(1)) : UNOAPI_IDLFILES := -include $(call gb_UnoApiTarget_get_dep_target,$(1)) endif endef +define gb_UnoApiTarget__add_urdfile +$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_FILES += $(2) +$(call gb_UnoApiTarget_get_target,$(1)) : $(2) + +endef + define gb_UnoApiTarget__add_idlfile $(call gb_UnoApiPartTarget_get_target,$(2)/idl.done) : \ $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd) -gb_UnoApiTarget_IDLFILES_$(1) += $(2)/$(3).idl -$(call gb_TypesRdb_add_urdfile,$(1),$(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)) +$(call gb_UnoApiTarget__add_urdfile,$(1),$(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)) ifeq ($(gb_FULLDEPS),$(true)) +$(call gb_UnoApiTarget_get_dep_target,$(1)) : UNOAPI_IDLFILES += $(2)/$(3).idl $(call gb_UnoApiTarget_get_dep_target,$(1)) : \ $(call gb_UnoApiPartTarget_get_dep_target,$(2)/$(3)) $(call gb_UnoApiPartTarget_get_dep_target,$(2)/$(3)) : \ @@ -104,68 +183,19 @@ $(call gb_UnoApiTarget__add_idlfiles,$(1),$(2),$(3)) endef -# for interfaces, exceptions, structs, enums, constant groups define gb_UnoApiTarget_add_idlfile -gb_UnoApiTarget_HPPFILES_$(1) += $(2)/$(3).hdl $(2)/$(3).hpp - -$(call gb_UnoApiTarget_get_header_target,$(2)/$(3).hpp) :| \ - $(call gb_UnoApiTarget_get_target,$(1)) -$(call gb_UnoApiTarget_get_header_target,$(2)/$(3).hdl) :| \ - $(call gb_UnoApiTarget_get_target,$(1)) - -$(call gb_UnoApiTarget__add_idlfile,$(1),$(2),$(3)) - -endef - -define gb_UnoApiTarget_add_idlfiles_noheader -$(foreach idl,$(3),$(call gb_UnoApiTarget_add_idlfile_noheader,$(1),$(2),$(idl))) -$(call gb_UnoApiTarget__add_idlfiles,$(1),$(2),$(3)) - -endef - -# for old-style services and modules -define gb_UnoApiTarget_add_idlfile_noheader -$(call gb_UnoApiTarget__add_idlfile,$(1),$(2),$(3)) - -endef - -define gb_UnoApiTarget_add_idlfiles_nohdl -$(foreach idl,$(3),$(call gb_UnoApiTarget_add_idlfile_nohdl,$(1),$(2),$(idl))) -$(call gb_UnoApiTarget__add_idlfiles,$(1),$(2),$(3)) - -endef - -# for new-style services -define gb_UnoApiTarget_add_idlfile_nohdl -gb_UnoApiTarget_HPPFILES_$(1) += $(2)/$(3).hpp - -$(call gb_UnoApiTarget_get_header_target,$(2)/$(3).hpp) :| \ - $(call gb_UnoApiTarget_get_target,$(1)) - $(call gb_UnoApiTarget__add_idlfile,$(1),$(2),$(3)) endef -define gb_UnoApiTarget_add_rdbfiles -$(foreach rdb,$(2),$(call gb_UnoApiTarget_add_rdbfile,$(1),$(rdb))) - -endef - -define gb_UnoApiTarget_add_rdbfile -$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_DEPS += -X$(call gb_TypesRdb_get_outdir_target,$(2)) -$(call gb_UnoApiTarget_get_target,$(1)) : \ - $(call gb_TypesRdb_get_outdir_target,$(2)) \ - $(call gb_Package_get_target,$(2)_idl) - -endef - -define gb_UnoApiTarget_add_merge_rdbfiles -$(foreach rdb,$(2),$(call gb_UnoApiTarget_add_merge_rdbfile,$(1),$(rdb))) +define gb_UnoApiTarget_merge_rdbfiles +$(foreach rdb,$(2),$(call gb_UnoApiTarget_merge_rdbfile,$(1),$(rdb))) endef -define gb_UnoApiTarget_add_merge_rdbfile -$(call gb_TypesRdb_add_rdbfile,$(1),$(2)) +define gb_UnoApiTarget_merge_rdbfile +$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_MERGE += $(call gb_UnoApiTarget_get_target,$(2)) +$(call gb_UnoApiTarget_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(2)) endef @@ -179,96 +209,77 @@ $(call gb_UnoApiTarget_get_target,$(1)) : INCLUDE := $(2) endef -.PHONY : $(call gb_UnoApiTarget_get_clean_target,%) -$(call gb_UnoApiTarget_get_clean_target,%) : - $(call gb_Output_announce,$*,$(false),UNO,2) - -$(call gb_Helper_abbreviate_dirs,\ - rm -f $(call gb_UnoApiTarget_get_target,$*) \ - $(call gb_UnoApiTarget_get_outdir_target,$*)) - -rm -rf $(call gb_UnoApiTarget_get_header_target,$*)\ - $(call gb_UnoApiTarget_get_dep_target,$*) \ - $(basename $(call gb_UnoApiPartTarget_get_dep_target,$*)) \ - $(call gb_UnoApiPartTarget_get_target,$*) +# UnoApiHeadersTarget -# The .urd files are actually created by the gb_UnoApiPartTarget__command, -# invoked for the per-directory .done files. -# The reason why .urd files are tracked is so new files that are added are -# picked up and cause a rebuild, even if older than the .done file (also, as a -# convenience for users who delete them from the workdir by hand; this dummy -# rule plus the dependency from the .done target to the .urd file plus the -# sort/patsubst call in gb_UnoApiPartTarget__command cause command to be -# invoked with the .idl file corresponding to the .urd in that case. -# Touch the .urd file, so it is newer than the .done file, causing that to -# be rebuilt and overwriting the .urd file again. -$(call gb_UnoApiPartTarget_get_target,%.urd) : - mkdir -p $(dir $@) && touch $@ +gb_UnoApiHeadersTarget_CPPUMAKERTARGET := $(call gb_Executable_get_target_for_build,cppumaker) +gb_UnoApiHeadersTarget_CPPUMAKERCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiHeadersTarget_CPPUMAKERTARGET) -$(call gb_UnoApiPartTarget_get_target,%.done) : - $(call gb_UnoApiPartTarget__command,$@,$*,$?) - - -define gb_UnoApiPartTarget__command - $(call gb_Output_announce,$(2),$(true),IDL,2) - mkdir -p $(call gb_UnoApiPartTarget_get_target,$(dir $(2))) && \ - RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,\ - $(call gb_Helper_convert_native,$(INCLUDE) $(DEFS) \ - -M $(basename $(call gb_UnoApiPartTarget_get_dep_target,$(dir $(2)))) \ - -O $(call gb_UnoApiPartTarget_get_target,$(dir $(2))) -verbose -C \ - $(sort $(patsubst $(call gb_UnoApiPartTarget_get_target,%.urd),$(SRCDIR)/%.idl,$(3))))) && \ - $(gb_UnoApiTarget_IDLCCOMMAND) @$${RESPONSEFILE} > /dev/null && \ - rm -f $${RESPONSEFILE} && \ - touch $(1) +define gb_UnoApiHeadersTarget__command +RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,\ + $(call gb_Helper_convert_native,-Gc $(4) -BUCR \ + -O$(3) $(call gb_UnoApiTarget_get_target,$(2)) $(UNOAPI_DEPS))) && \ +$(gb_UnoApiHeadersTarget_CPPUMAKERCOMMAND) @$${RESPONSEFILE} && \ +rm -f $${RESPONSEFILE} && \ +touch $(1) endef -define gb_UnoApiTarget__command -$(call gb_Output_announce,$*,$(true),UNO,2) -$(call gb_Helper_abbreviate_dirs_native,\ - mkdir -p $(dir $(1)) && touch $(1)) +$(call gb_UnoApiHeadersTarget_get_target,%) : + $(call gb_Output_announce,$*,$(true),HPP,3) + $(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_dir,$*)) + +$(call gb_UnoApiHeadersTarget_get_comprehensive_target,%) : + $(call gb_Output_announce,$*,$(true),HPC,3) + $(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_comprehensive_dir,$*),-C) + +$(call gb_UnoApiHeadersTarget_get_lightweight_target,%) : + $(call gb_Output_announce,$*,$(true),HPL,3) + $(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_lightweight_dir,$*),-L) + +.PHONY : $(call gb_UnoApiHeadersTarget_get_clean_target,%) +$(call gb_UnoApiHeadersTarget_get_clean_target,%) : + $(call gb_Output_announce,$*,$(false),HPP,3) + $(call gb_Helper_abbreviate_dirs_native,\ + rm -rf \ + $(call gb_UnoApiHeadersTarget_get_comprehensive_dir,$*) \ + $(call gb_UnoApiHeadersTarget_get_lightweight_dir,$*) \ + $(call gb_UnoApiHeadersTarget_get_dir,$*) \ + $(call gb_UnoApiHeadersTarget_get_comprehensive_target,$*) \ + $(call gb_UnoApiHeadersTarget_get_lightweight_target,$*) \ + $(call gb_UnoApiHeadersTarget_get_target,$*)) + +define gb_UnoApiHeadersTarget_UnoApiHeadersTarget +$(call gb_UnoApiHeadersTarget_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) +$(call gb_UnoApiHeadersTarget_get_comprehensive_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) +$(call gb_UnoApiHeadersTarget_get_lightweight_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) +$(call gb_UnoApiHeadersTarget_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_clean_target,$(1)) + +$(call gb_UnoApiHeadersTarget_get_target,$(1)) : UNOAPI_DEPS := +$(call gb_UnoApiHeadersTarget_get_comprehensive_target,$(1)) : UNOAPI_DEPS := +$(call gb_UnoApiHeadersTarget_get_lightweight_target,$(1)) : UNOAPI_DEPS := + endef -define gb_UnoApiHeaderTarget__command - RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,\ - $(call gb_Helper_convert_native,-Gc -L -BUCR \ - -O$(call gb_UnoApiTarget_get_header_target,$(2)) $(3) $(1))) && \ - $(gb_UnoApiTarget_CPPUMAKERCOMMAND) @$${RESPONSEFILE} && \ - rm -f $${RESPONSEFILE} +define gb_UnoApiHeadersTarget_add_headerfile endef -# cat the deps of all IDLs in one file, then we need only open that one file -define gb_UnoApiTarget__command_dep -$(call gb_Output_announce,IDL:$(2),$(true),DEP,1) -$(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $(1)) && \ - RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\ - $(foreach idl,$(patsubst %.idl,%,$(3)),$(call gb_UnoApiPartTarget_get_dep_target,$(idl)))) && \ - $(SOLARENV)/bin/concat-deps $${RESPONSEFILE} > $(1)) && \ - rm -f $${RESPONSEFILE} +define gb_UnoApiHeadersTarget__add_rdbfile +$(call gb_UnoApiHeadersTarget_get_$(3),$(1)) : $(call gb_UnoApiTarget_get_target,$(2)) +$(call gb_UnoApiHeadersTarget_get_$(3),$(1)) : UNOAPI_DEPS += -X$(call gb_UnoApiTarget_get_target,$(2)) endef -ifeq ($(gb_FULLDEPS),$(true)) -$(call gb_UnoApiPartTarget_get_dep_target,%) : - $(if $(realpath $@),touch $@,\ - $(call gb_Object__command_dep,$@,$(call gb_UnoApiPartTarget_get_target,$*.urd))) +define gb_UnoApiHeadersTarget_add_rdbfile +$(call gb_UnoApiHeadersTarget__add_rdbfile,$(1),$(2),target) +$(call gb_UnoApiHeadersTarget__add_rdbfile,$(1),$(2),comprehensive_target) +$(call gb_UnoApiHeadersTarget__add_rdbfile,$(1),$(2),lightweight_target) -$(call gb_UnoApiTarget_get_dep_target,%) : $(call gb_UnoApiTarget_get_target,%) - $(call gb_UnoApiTarget__command_dep,$@,$*,$(gb_UnoApiTarget_IDLFILES_$*)) +endef -endif +define gb_UnoApiHeadersTarget_add_rdbfiles +$(foreach rdb,$(2),$(call gb_UnoApiHeadersTarget_add_rdbfile,$(1),$(rdb))) -# TODO: -# - get idlc switch "-P" (generate .urd into package dir) -# - empty $? in headertarget? - -$(call gb_UnoApiTarget_get_target,%): - $(call gb_UnoApiTarget__command,$@,$*,$<,$?) - $(if $(UNOAPI_REFERENCE), \ - $(call gb_Output_announce,$*,$(true),DBc,4) \ - $(gb_UnoApiTarget_REGCOMPARECOMMAND) -f -t -r1 $(call gb_Helper_convert_native,$(UNOAPI_REFERENCE)) -r2 $(call gb_Helper_convert_native,$(call gb_TypesRdb_get_target,$*))) - $(if $(gb_UnoApiTarget_IDLFILES_$*), \ - $(call gb_Output_announce,$*,$(true),HPP,4) \ - $(call gb_UnoApiHeaderTarget__command,$(call gb_TypesRdb_get_target,$*),$*,$(UNOAPI_DEPS))) +endef # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index 6884b34520f8..198e167c886f 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -289,8 +289,9 @@ include $(foreach class, \ JavaClassSet \ JunitTest \ Module \ - TypesRdb \ UnoApiTarget \ + UnoApi \ + UnoApiMerge \ Zip \ Configuration \ Extension \ -- cgit From f24ccecbeef52ecb822f1bd111ffe573ec41c142 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Mon, 12 Mar 2012 10:03:03 +0100 Subject: add InternalUnoApi class --- solenv/gbuild/InternalUnoApi.mk | 83 ++++++++++++++++++++++++++++++++++++++++ solenv/gbuild/Library.mk | 3 ++ solenv/gbuild/LinkTarget.mk | 30 +++++++++++++++ solenv/gbuild/TargetLocations.mk | 2 + solenv/gbuild/UnoApiTarget.mk | 53 +++++++++++++++++++++---- solenv/gbuild/gbuild.mk | 1 + 6 files changed, 164 insertions(+), 8 deletions(-) create mode 100644 solenv/gbuild/InternalUnoApi.mk (limited to 'solenv') diff --git a/solenv/gbuild/InternalUnoApi.mk b/solenv/gbuild/InternalUnoApi.mk new file mode 100644 index 000000000000..0c1b3f6604d7 --- /dev/null +++ b/solenv/gbuild/InternalUnoApi.mk @@ -0,0 +1,83 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# Major Contributor(s): +# Copyright (C) 2010 Red Hat, Inc., David Tardon +# (initial developer) +# +# All Rights Reserved. +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +$(call gb_InternalUnoApi_get_target,%) : + $(call gb_Output_announce,$*,$(true),UNI,4) + $(call gb_Deliver_deliver,$(call gb_UnoApiTarget_get_target,$*),$@) + +.PHONY : $(call gb_InternalUnoApi_get_clean_target,%) +$(call gb_InternalUnoApi_get_clean_target,%) : + $(call gb_Output_announce,$*,$(false),UNI,4) + $(call gb_Helper_abbreviate_dirs_native,\ + rm -f $(call gb_InternalUnoApi_get_target,$*)) + +define gb_InternalUnoApi_InternalUnoApi +$(call gb_UnoApiTarget_UnoApiTarget,$(1)) +$(call gb_UnoApiHeadersTarget_UnoApiHeadersTarget,$(1)) + +$(call gb_InternalUnoApi_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) +$(call gb_InternalUnoApi_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_clean_target,$(1)) +$(call gb_InternalUnoApi_get_clean_target,$(1)) : $(call gb_UnoApiHeadersTarget_get_clean_target,$(1)) + +$(call gb_Deliver_add_deliverable,$(call gb_InternalUnoApi_get_target,$(1)),$(call gb_UnoApiTarget_get_target,$(1)),$(1)) + +$$(eval $$(call gb_Module_register_target,$(call gb_InternalUnoApi_get_target,$(1)),$(call gb_InternalUnoApi_get_clean_target,$(1)))) + +endef + +define gb_InternalUnoApi_add_idlfile +$(call gb_UnoApiTarget_add_idlfile,$(1),$(2)) + +endef + +define gb_InternalUnoApi_add_idlfiles +$(call gb_UnoApiTarget_add_idlfiles,$(1),$(2)) + +endef + +define gb_InternalUnoApi__add_api +$(call gb_UnoApiHeadersTarget_add_rdbfile,$(1),$(2)) +$(call gb_InternalUnoApi_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(2)) + +endef + +define gb_InternalUnoApi_add_api +$(foreach rdb,$(2),$(call gb_InternalUnoApi__add_api,$(1),$(rdb))) + +endef + +define gb_InternalUnoApi_set_xmlfile +$(call gb_UnoApiTarget_set_xmlfile,$(1),$(2)) + +endef + +define gb_InternalUnoApi_set_include +$(call gb_UnoApiTarget_set_include,$(1),$(2)) + +endef + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk index 72599c69704c..8cc71b56562d 100644 --- a/solenv/gbuild/Library.mk +++ b/solenv/gbuild/Library.mk @@ -172,6 +172,9 @@ $(eval $(foreach method,\ add_libs \ set_library_path_flags \ add_api \ + add_internal_api \ + add_internal_bootstrap_api \ + add_internal_comprehensive_api \ add_linked_libs \ add_linked_static_libs \ use_external \ diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 227fe96f3c81..a0a63e385cb7 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -634,6 +634,36 @@ endif endef +define gb_LinkTarget__add_internal_api_one +$(call gb_LinkTarget__add_internal_headers,$(1),$(call gb_UnoApiHeadersTarget_get_$(3)target,$(api))) +$(call gb_LinkTarget_get_headers_target,$(1)) \ +$(call gb_LinkTarget_get_target,$(1)) : INCLUDE += -I$(call gb_UnoApiHeadersTarget_get_$(3)dir,$(api)) +ifeq ($(gb_FULLDEPS),$(true)) +$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE += -I$(call gb_UnoApiHeadersTarget_get_$(3)dir,$(api)) +endif + +endef + +define gb_LinkTarget__add_internal_api +$(foreach api,$(2),$(call gb_LinkTarget__add_internal_api_one,$(1),$(api),$(3))) + +endef + +define gb_LinkTarget_add_internal_api +$(call gb_LinkTarget__add_internal_api,$(1),$(2),lightweight_) + +endef + +define gb_LinkTarget_add_internal_bootstrap_api +$(call gb_LinkTarget__add_internal_api,$(1),$(2)) + +endef + +define gb_LinkTarget_add_internal_comprehensive_api +$(call gb_LinkTarget__add_internal_api,$(1),$(2),comprehensive_) + +endef + define gb_LinkTarget_add_linked_libs ifneq (,$$(filter-out $(gb_Library_KNOWNLIBS),$(2))) $$(eval $$(call gb_Output_info,currently known libraries are: $(sort $(gb_Library_KNOWNLIBS)),ALL)) diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 858045e7fd8e..b22931059349 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -42,6 +42,7 @@ gb_PackagePart_get_destinations = \ $(OUTDIR)/unittest \ $(OUTDIR)/xml \ +gb_InternalUnoApi_get_target = $(OUTDIR)/rdb/$(1).rdb gb_PackagePart_get_target = $(OUTDIR)/$(1) gb_Rdb_get_outdir_target = $(OUTDIR)/xml/$(1).rdb gb_ResTarget_get_outdir_imagelist_target = $(OUTDIR)/res/img/$(1).ilst @@ -197,6 +198,7 @@ $(eval $(call gb_Helper_make_clean_targets,\ $(eval $(call gb_Helper_make_outdir_clean_targets,\ Executable \ + InternalUnoApi \ Library \ StaticLibrary \ UnoApi \ diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk index eaf4aa204b70..0fa2857d2848 100644 --- a/solenv/gbuild/UnoApiTarget.mk +++ b/solenv/gbuild/UnoApiTarget.mk @@ -75,23 +75,46 @@ endif # UnoApiTarget +gb_UnoApiTarget_RDBMAKERTARGET := $(call gb_Executable_get_target_for_build,rdbmaker) +gb_UnoApiTarget_RDBMAKERCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_RDBMAKERTARGET) gb_UnoApiTarget_REGCOMPARETARGET := $(call gb_Executable_get_target_for_build,regcompare) gb_UnoApiTarget_REGCOMPARECOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_REGCOMPARETARGET) gb_UnoApiTarget_REGMERGETARGET := $(call gb_Executable_get_target_for_build,regmerge) gb_UnoApiTarget_REGMERGECOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(gb_UnoApiTarget_REGMERGETARGET) +gb_UnoApiTarget_XML2CMPTARGET := $(call gb_Executable_get_target_for_build,xml2cmp) +gb_UnoApiTarget_XML2CMPCOMMAND := $(gb_Helper_set_ld_path) $(gb_UnoApiTarget_XML2CMPTARGET) + +gb_UnoApiTarget_XMLRDB := $(call gb_UnoApiTarget_get_target,types) + +define gb_UnoApiTarget__get_types +$(if $(1),$(foreach type,$(shell $(gb_UnoApiTarget_XML2CMPCOMMAND) -types stdout $(1)),$(addprefix -T,$(type)))) +endef define gb_UnoApiTarget__command_impl -RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,$(call gb_Helper_convert_native,$(1) $(2) $(3))) && \ -$(gb_UnoApiTarget_REGMERGECOMMAND) @$${RESPONSEFILE} && \ +RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,$(call gb_Helper_convert_native,$(2))) && \ +$(1) @$${RESPONSEFILE} && \ rm -f $${RESPONSEFILE} endef +define gb_UnoApiTarget__regmerge_command_impl +$(call gb_UnoApiTarget__command_impl,$(gb_UnoApiTarget_REGMERGECOMMAND),$(1) $(2) $(3)) +endef + +# TODO: -bUCR changes content of the RDB files; the old build system +# uses -b/ (by default) +define gb_UnoApiTarget__rdbmaker_command_impl +$(call gb_UnoApiTarget__command_impl,$(gb_UnoApiTarget_RDBMAKERCOMMAND),-O$(1) -B$(2) -b$(2) $(3) $(4)) +endef + define gb_UnoApiTarget__command $(call gb_Output_announce,$*,$(true),RDB,3) mkdir -p $(dir $(1)) && \ $(if $(UNOAPI_FILES),\ - $(call gb_UnoApiTarget__command_impl,$(1),UCR,$(UNOAPI_FILES)),\ - $(call gb_UnoApiTarget__command_impl,$(1),/,$(UNOAPI_MERGE))) \ + $(call gb_UnoApiTarget__regmerge_command_impl,$(1),UCR,$(UNOAPI_FILES)),\ + $(if $(UNOAPI_MERGE),\ + $(call gb_UnoApiTarget__regmerge_command_impl,$(1),/,$(UNOAPI_MERGE)),\ + $(call gb_UnoApiTarget__rdbmaker_command_impl,$(1),UCR,\ + $(call gb_UnoApiTarget__get_types,$(UNOAPI_XML)),$(gb_UnoApiTarget_XMLRDB)))) \ $(if $(UNOAPI_REFERENCE), \ $(call gb_Output_announce,$*,$(true),DBc,3) \ && $(gb_UnoApiTarget_REGCOMPARECOMMAND) \ @@ -100,11 +123,15 @@ $(if $(UNOAPI_REFERENCE), \ -r2 $(call gb_Helper_convert_native,$(1))) endef +define gb_UnoApiTarget__check_mode +$(if $(or $(and $(1),$(2),$(3)),$(and $(1),$(2)),$(and $(2),$(3)),$(and $(1),$(3))),\ + $(error More than one mode of function of UnoApiTarget used: this is not supported),\ + $(if $(or $(1),$(2),$(3)),,\ + $(error Neither IDL files nor merged RDBs nor XML desc. were used: nothing will be produced))) +endef + $(call gb_UnoApiTarget_get_target,%): - $(if $(and $(UNOAPI_FILES),$(UNOAPI_MERGE)),\ - $(error Both IDL files and merged RDBs were added: this is not supported),\ - $(if $(or $(UNOAPI_FILES),$(UNOAPI_MERGE)),,\ - $(error Neither IDL files nor merged RDBs were added: nothing will be produced))) + $(call gb_UnoApiTarget__check_mode,$(UNOAPI_FILES),$(UNOAPI_MERGE),$(UNOAPI_XML)) $(call gb_UnoApiTarget__command,$@,$*,$<,$?) .PHONY : $(call gb_UnoApiTarget_get_clean_target,%) @@ -139,6 +166,7 @@ define gb_UnoApiTarget_UnoApiTarget $(call gb_UnoApiTarget_get_target,$(1)) : INCLUDE := $(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_FILES := $(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_MERGE := +$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_XML := $(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_REFERENCE := ifeq ($(gb_FULLDEPS),$(true)) @@ -199,6 +227,14 @@ $(call gb_UnoApiTarget_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(2) endef +# Set XML component dependencies description. +define gb_UnoApiTarget_set_xmlfile +$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_XML := $(SRCDIR)/$(2) +$(call gb_UnoApiTarget_get_target,$(1)) : $(SRCDIR)/$(2) +$(call gb_UnoApiTarget_get_target,$(1)) : $(gb_UnoApiTarget_XMLRDB) + +endef + define gb_UnoApiTarget_add_reference_rdbfile $(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_REFERENCE := $(SRCDIR)/$(strip $(2)).rdb @@ -248,6 +284,7 @@ $(call gb_UnoApiHeadersTarget_get_clean_target,%) : $(call gb_UnoApiHeadersTarget_get_lightweight_target,$*) \ $(call gb_UnoApiHeadersTarget_get_target,$*)) +# TODO: add second parameter: root of rdb file (UCR vs. /) define gb_UnoApiHeadersTarget_UnoApiHeadersTarget $(call gb_UnoApiHeadersTarget_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) $(call gb_UnoApiHeadersTarget_get_comprehensive_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index 198e167c886f..f35a84b77917 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -292,6 +292,7 @@ include $(foreach class, \ UnoApiTarget \ UnoApi \ UnoApiMerge \ + InternalUnoApi \ Zip \ Configuration \ Extension \ -- cgit From 80556d91cc422d10c675a209d223940b7f101935 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sun, 18 Mar 2012 19:07:42 +0100 Subject: fix number of arguments --- solenv/gbuild/InternalUnoApi.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'solenv') diff --git a/solenv/gbuild/InternalUnoApi.mk b/solenv/gbuild/InternalUnoApi.mk index 0c1b3f6604d7..f0c8fc37d7fb 100644 --- a/solenv/gbuild/InternalUnoApi.mk +++ b/solenv/gbuild/InternalUnoApi.mk @@ -50,12 +50,12 @@ $$(eval $$(call gb_Module_register_target,$(call gb_InternalUnoApi_get_target,$( endef define gb_InternalUnoApi_add_idlfile -$(call gb_UnoApiTarget_add_idlfile,$(1),$(2)) +$(call gb_UnoApiTarget_add_idlfile,$(1),$(2),$(3)) endef define gb_InternalUnoApi_add_idlfiles -$(call gb_UnoApiTarget_add_idlfiles,$(1),$(2)) +$(call gb_UnoApiTarget_add_idlfiles,$(1),$(2),$(3)) endef -- cgit From e5b618969990c00c3fca4b06dafa7cd065444148 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sun, 18 Mar 2012 19:42:10 +0100 Subject: allow to express transitive dep for rdbs --- solenv/gbuild/InternalUnoApi.mk | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'solenv') diff --git a/solenv/gbuild/InternalUnoApi.mk b/solenv/gbuild/InternalUnoApi.mk index f0c8fc37d7fb..efffa9ff87a3 100644 --- a/solenv/gbuild/InternalUnoApi.mk +++ b/solenv/gbuild/InternalUnoApi.mk @@ -70,6 +70,26 @@ $(foreach rdb,$(2),$(call gb_InternalUnoApi__add_api,$(1),$(rdb))) endef +# Express that the rdb $(2) depends on rdb $(3). +# +# This information is already available in the UnoApiTarget definition +# for $(2), but this may not be loaded if we are building from a +# different module. Thus, this is a necessary hack to make generation of +# headers on demand work. +# +# I suppose it would be possible to store the list of required rdbs for +# a rdb to a file and then load it when headers' generation is requested, +# but it feels like overkill... +define gb_InternalUnoApi_add_api_dependency +$(call gb_UnoApiHeadersTarget_add_rdbfile,$(2),$(3)) + +endef + +define gb_InternalUnoApi_add_api_dependencies +$(foreach dep,$(3),$(call gb_InternalUnoApi_add_api_dependency,$(1),$(2),$(dep))) + +endef + define gb_InternalUnoApi_set_xmlfile $(call gb_UnoApiTarget_set_xmlfile,$(1),$(2)) -- cgit From 15396990cf0aa73bc8afd592bb338c9af2604609 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sat, 24 Mar 2012 07:22:39 +0100 Subject: update copyright date --- solenv/gbuild/InternalUnoApi.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'solenv') diff --git a/solenv/gbuild/InternalUnoApi.mk b/solenv/gbuild/InternalUnoApi.mk index efffa9ff87a3..68e29bae52b3 100644 --- a/solenv/gbuild/InternalUnoApi.mk +++ b/solenv/gbuild/InternalUnoApi.mk @@ -12,7 +12,7 @@ # License. # # Major Contributor(s): -# Copyright (C) 2010 Red Hat, Inc., David Tardon +# Copyright (C) 2012 Red Hat, Inc., David Tardon # (initial developer) # # All Rights Reserved. -- cgit From 1a00658cd3867fe1a7a306aa309850796ca7a7a4 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sat, 24 Mar 2012 13:36:46 +0100 Subject: use the default deliver rule --- solenv/gbuild/InternalUnoApi.mk | 5 ----- solenv/gbuild/UnoApi.mk | 5 ----- 2 files changed, 10 deletions(-) (limited to 'solenv') diff --git a/solenv/gbuild/InternalUnoApi.mk b/solenv/gbuild/InternalUnoApi.mk index 68e29bae52b3..5cfc0b5326a0 100644 --- a/solenv/gbuild/InternalUnoApi.mk +++ b/solenv/gbuild/InternalUnoApi.mk @@ -25,13 +25,8 @@ # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable # instead of those above. -$(call gb_InternalUnoApi_get_target,%) : - $(call gb_Output_announce,$*,$(true),UNI,4) - $(call gb_Deliver_deliver,$(call gb_UnoApiTarget_get_target,$*),$@) - .PHONY : $(call gb_InternalUnoApi_get_clean_target,%) $(call gb_InternalUnoApi_get_clean_target,%) : - $(call gb_Output_announce,$*,$(false),UNI,4) $(call gb_Helper_abbreviate_dirs_native,\ rm -f $(call gb_InternalUnoApi_get_target,$*)) diff --git a/solenv/gbuild/UnoApi.mk b/solenv/gbuild/UnoApi.mk index 8348826ee903..579d2fbddac3 100644 --- a/solenv/gbuild/UnoApi.mk +++ b/solenv/gbuild/UnoApi.mk @@ -25,13 +25,8 @@ # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable # instead of those above. -$(call gb_UnoApi_get_target,%) : - $(call gb_Output_announce,$*,$(true),UNO,4) - $(call gb_Deliver_deliver,$(call gb_UnoApiTarget_get_target,$*),$@) - .PHONY : $(call gb_UnoApi_get_clean_target,%) $(call gb_UnoApi_get_clean_target,%) : - $(call gb_Output_announce,$*,$(false),UNO,4) $(call gb_Helper_abbreviate_dirs_native,\ rm -f $(call gb_UnoApi_get_target,$*)) -- cgit From ac6e856a00f1546b00e612512cac7a8fad9d694a Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sat, 24 Mar 2012 15:11:56 +0100 Subject: use correct rdb root dirs --- solenv/gbuild/InternalUnoApi.mk | 27 ++++++++++++++++++++------- solenv/gbuild/UnoApi.mk | 2 ++ solenv/gbuild/UnoApiMerge.mk | 2 ++ solenv/gbuild/UnoApiTarget.mk | 20 ++++++++++++-------- 4 files changed, 36 insertions(+), 15 deletions(-) (limited to 'solenv') diff --git a/solenv/gbuild/InternalUnoApi.mk b/solenv/gbuild/InternalUnoApi.mk index 5cfc0b5326a0..1011d9c4bdbe 100644 --- a/solenv/gbuild/InternalUnoApi.mk +++ b/solenv/gbuild/InternalUnoApi.mk @@ -30,27 +30,40 @@ $(call gb_InternalUnoApi_get_clean_target,%) : $(call gb_Helper_abbreviate_dirs_native,\ rm -f $(call gb_InternalUnoApi_get_target,$*)) +# Note: The rdb root for the internal rdbs should be / . On the other +# side, UnoApiHeadersTarget expects UCR and it is really not easy to +# change, because the information would have to be duplicated at the +# calling side. So we simply do both .-) +# TODO: Should it come clear that these rdbs (installed into +# solver/$INPATH/rdb) are actually not needed for anything, this could +# be simplified. + define gb_InternalUnoApi_InternalUnoApi +$(call gb_UnoApiTarget_UnoApiTarget,$(1)_out) $(call gb_UnoApiTarget_UnoApiTarget,$(1)) $(call gb_UnoApiHeadersTarget_UnoApiHeadersTarget,$(1)) -$(call gb_InternalUnoApi_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) -$(call gb_InternalUnoApi_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_clean_target,$(1)) +$(call gb_UnoApiTarget_set_root,$(1)_out,/) +$(call gb_UnoApiTarget_set_root,$(1),UCR) +$(call gb_UnoApiTarget_merge_rdbfile,$(1),$(1)_out) + +$(call gb_InternalUnoApi_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)_out) +$(call gb_InternalUnoApi_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_clean_target,$(1)_out) $(call gb_InternalUnoApi_get_clean_target,$(1)) : $(call gb_UnoApiHeadersTarget_get_clean_target,$(1)) -$(call gb_Deliver_add_deliverable,$(call gb_InternalUnoApi_get_target,$(1)),$(call gb_UnoApiTarget_get_target,$(1)),$(1)) +$(call gb_Deliver_add_deliverable,$(call gb_InternalUnoApi_get_target,$(1)),$(call gb_UnoApiTarget_get_target,$(1)_out),$(1)) $$(eval $$(call gb_Module_register_target,$(call gb_InternalUnoApi_get_target,$(1)),$(call gb_InternalUnoApi_get_clean_target,$(1)))) endef define gb_InternalUnoApi_add_idlfile -$(call gb_UnoApiTarget_add_idlfile,$(1),$(2),$(3)) +$(call gb_UnoApiTarget_add_idlfile,$(1)_out,$(2),$(3)) endef define gb_InternalUnoApi_add_idlfiles -$(call gb_UnoApiTarget_add_idlfiles,$(1),$(2),$(3)) +$(call gb_UnoApiTarget_add_idlfiles,$(1)_out,$(2),$(3)) endef @@ -86,12 +99,12 @@ $(foreach dep,$(3),$(call gb_InternalUnoApi_add_api_dependency,$(1),$(2),$(dep)) endef define gb_InternalUnoApi_set_xmlfile -$(call gb_UnoApiTarget_set_xmlfile,$(1),$(2)) +$(call gb_UnoApiTarget_set_xmlfile,$(1)_out,$(2)) endef define gb_InternalUnoApi_set_include -$(call gb_UnoApiTarget_set_include,$(1),$(2)) +$(call gb_UnoApiTarget_set_include,$(1)_out,$(2)) endef diff --git a/solenv/gbuild/UnoApi.mk b/solenv/gbuild/UnoApi.mk index 579d2fbddac3..95b2766480ac 100644 --- a/solenv/gbuild/UnoApi.mk +++ b/solenv/gbuild/UnoApi.mk @@ -36,6 +36,8 @@ $(call gb_UnoApiHeadersTarget_UnoApiHeadersTarget,$(1)) $(call gb_Package_Package,$(1)_idl,$(SRCDIR)) $(call gb_Package_Package,$(1)_inc,$(call gb_UnoApiHeadersTarget_get_lightweight_dir,$(1))) +$(call gb_UnoApiTarget_set_root,$(1),UCR) + $(call gb_UnoApi_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) $(call gb_UnoApi_get_target,$(1)) : $(call gb_UnoApiHeadersTarget_get_lightweight_target,$(1)) $(call gb_UnoApi_get_target,$(1)) : $(call gb_Package_get_target,$(1)_idl) diff --git a/solenv/gbuild/UnoApiMerge.mk b/solenv/gbuild/UnoApiMerge.mk index d23ce75bc429..067a4c1b4fa4 100644 --- a/solenv/gbuild/UnoApiMerge.mk +++ b/solenv/gbuild/UnoApiMerge.mk @@ -32,6 +32,8 @@ define gb_UnoApiMerge_UnoApiMerge $(call gb_UnoApiTarget_UnoApiTarget,$(1)) +$(call gb_UnoApiTarget_set_root,$(1),/) + $(call gb_UnoApiMerge_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) $(call gb_UnoApiMerge_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_clean_target,$(1)) diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk index 0fa2857d2848..893e41632095 100644 --- a/solenv/gbuild/UnoApiTarget.mk +++ b/solenv/gbuild/UnoApiTarget.mk @@ -100,20 +100,18 @@ define gb_UnoApiTarget__regmerge_command_impl $(call gb_UnoApiTarget__command_impl,$(gb_UnoApiTarget_REGMERGECOMMAND),$(1) $(2) $(3)) endef -# TODO: -bUCR changes content of the RDB files; the old build system -# uses -b/ (by default) define gb_UnoApiTarget__rdbmaker_command_impl -$(call gb_UnoApiTarget__command_impl,$(gb_UnoApiTarget_RDBMAKERCOMMAND),-O$(1) -B$(2) -b$(2) $(3) $(4)) +$(call gb_UnoApiTarget__command_impl,$(gb_UnoApiTarget_RDBMAKERCOMMAND),-O$(1) -B$(2) -b$(3) $(4) $(5)) endef define gb_UnoApiTarget__command $(call gb_Output_announce,$*,$(true),RDB,3) mkdir -p $(dir $(1)) && \ $(if $(UNOAPI_FILES),\ - $(call gb_UnoApiTarget__regmerge_command_impl,$(1),UCR,$(UNOAPI_FILES)),\ + $(call gb_UnoApiTarget__regmerge_command_impl,$(1),$(UNOAPI_ROOT),$(UNOAPI_FILES)),\ $(if $(UNOAPI_MERGE),\ - $(call gb_UnoApiTarget__regmerge_command_impl,$(1),/,$(UNOAPI_MERGE)),\ - $(call gb_UnoApiTarget__rdbmaker_command_impl,$(1),UCR,\ + $(call gb_UnoApiTarget__regmerge_command_impl,$(1),$(UNOAPI_ROOT),$(UNOAPI_MERGE)),\ + $(call gb_UnoApiTarget__rdbmaker_command_impl,$(1),UCR,$(UNOAPI_ROOT),\ $(call gb_UnoApiTarget__get_types,$(UNOAPI_XML)),$(gb_UnoApiTarget_XMLRDB)))) \ $(if $(UNOAPI_REFERENCE), \ $(call gb_Output_announce,$*,$(true),DBc,3) \ @@ -128,10 +126,11 @@ $(if $(or $(and $(1),$(2),$(3)),$(and $(1),$(2)),$(and $(2),$(3)),$(and $(1),$(3 $(error More than one mode of function of UnoApiTarget used: this is not supported),\ $(if $(or $(1),$(2),$(3)),,\ $(error Neither IDL files nor merged RDBs nor XML desc. were used: nothing will be produced))) +$(if $(4),,$(error No root has been set for the rdb file)) endef $(call gb_UnoApiTarget_get_target,%): - $(call gb_UnoApiTarget__check_mode,$(UNOAPI_FILES),$(UNOAPI_MERGE),$(UNOAPI_XML)) + $(call gb_UnoApiTarget__check_mode,$(UNOAPI_FILES),$(UNOAPI_MERGE),$(UNOAPI_XML),$(UNOAPI_ROOT)) $(call gb_UnoApiTarget__command,$@,$*,$<,$?) .PHONY : $(call gb_UnoApiTarget_get_clean_target,%) @@ -168,6 +167,7 @@ $(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_FILES := $(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_MERGE := $(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_XML := $(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_REFERENCE := +$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_ROOT := ifeq ($(gb_FULLDEPS),$(true)) $(call gb_UnoApiTarget_get_dep_target,$(1)) : UNOAPI_IDLFILES := @@ -245,6 +245,11 @@ $(call gb_UnoApiTarget_get_target,$(1)) : INCLUDE := $(2) endef +define gb_UnoApiTarget_set_root +$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_ROOT := $(2) + +endef + # UnoApiHeadersTarget gb_UnoApiHeadersTarget_CPPUMAKERTARGET := $(call gb_Executable_get_target_for_build,cppumaker) @@ -284,7 +289,6 @@ $(call gb_UnoApiHeadersTarget_get_clean_target,%) : $(call gb_UnoApiHeadersTarget_get_lightweight_target,$*) \ $(call gb_UnoApiHeadersTarget_get_target,$*)) -# TODO: add second parameter: root of rdb file (UCR vs. /) define gb_UnoApiHeadersTarget_UnoApiHeadersTarget $(call gb_UnoApiHeadersTarget_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) $(call gb_UnoApiHeadersTarget_get_comprehensive_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) -- cgit From c6fc60d0739e1539e2efae23461f970eda7cf0f4 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sat, 24 Mar 2012 15:20:14 +0100 Subject: rename targets to match LinkTarget's functions --- solenv/gbuild/LinkTarget.mk | 4 ++-- solenv/gbuild/TargetLocations.mk | 4 ++-- solenv/gbuild/UnoApi.mk | 6 +++--- solenv/gbuild/UnoApiTarget.mk | 28 ++++++++++++++-------------- 4 files changed, 21 insertions(+), 21 deletions(-) (limited to 'solenv') diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index a0a63e385cb7..ec141c0ced77 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -650,12 +650,12 @@ $(foreach api,$(2),$(call gb_LinkTarget__add_internal_api_one,$(1),$(api),$(3))) endef define gb_LinkTarget_add_internal_api -$(call gb_LinkTarget__add_internal_api,$(1),$(2),lightweight_) +$(call gb_LinkTarget__add_internal_api,$(1),$(2)) endef define gb_LinkTarget_add_internal_bootstrap_api -$(call gb_LinkTarget__add_internal_api,$(1),$(2)) +$(call gb_LinkTarget__add_internal_api,$(1),$(2),bootstrap_) endef diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index b22931059349..2176746ac9a7 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -121,11 +121,11 @@ gb_SrsTarget_get_target = $(WORKDIR)/SrsTarget/$(1).srs gb_SrsTemplatePartTarget_get_target = $(WORKDIR)/inc/$(firstword $(subst /, ,$(1)))/$(subst _tmpl,,$(notdir $(1))) gb_SrsTemplateTarget_get_target = $(WORKDIR)/SrsTemplateTarget/$(1) gb_UnoApiTarget_get_target = $(WORKDIR)/UnoApiTarget/$(1).rdb +gb_UnoApiHeadersTarget_get_bootstrap_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/bootstrap gb_UnoApiHeadersTarget_get_comprehensive_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/comprehensive -gb_UnoApiHeadersTarget_get_lightweight_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/lightweight gb_UnoApiHeadersTarget_get_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/normal +gb_UnoApiHeadersTarget_get_bootstrap_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/bootstrap.done gb_UnoApiHeadersTarget_get_comprehensive_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/comprehensive.done -gb_UnoApiHeadersTarget_get_lightweight_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/lightweight.done gb_UnoApiHeadersTarget_get_target = $(WORKDIR)/UnoApiHeadersTarget/$(1)/normal.done gb_UnoApiPartTarget_get_target = $(WORKDIR)/UnoApiPartTarget/$(1) gb_WinResTarget_get_target = $(WORKDIR)/WinResTarget/$(1)$(gb_WinResTarget_POSTFIX) diff --git a/solenv/gbuild/UnoApi.mk b/solenv/gbuild/UnoApi.mk index 95b2766480ac..bb82ddba653a 100644 --- a/solenv/gbuild/UnoApi.mk +++ b/solenv/gbuild/UnoApi.mk @@ -34,12 +34,12 @@ define gb_UnoApi_UnoApi $(call gb_UnoApiTarget_UnoApiTarget,$(1)) $(call gb_UnoApiHeadersTarget_UnoApiHeadersTarget,$(1)) $(call gb_Package_Package,$(1)_idl,$(SRCDIR)) -$(call gb_Package_Package,$(1)_inc,$(call gb_UnoApiHeadersTarget_get_lightweight_dir,$(1))) +$(call gb_Package_Package,$(1)_inc,$(call gb_UnoApiHeadersTarget_get_dir,$(1))) $(call gb_UnoApiTarget_set_root,$(1),UCR) $(call gb_UnoApi_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) -$(call gb_UnoApi_get_target,$(1)) : $(call gb_UnoApiHeadersTarget_get_lightweight_target,$(1)) +$(call gb_UnoApi_get_target,$(1)) : $(call gb_UnoApiHeadersTarget_get_target,$(1)) $(call gb_UnoApi_get_target,$(1)) : $(call gb_Package_get_target,$(1)_idl) $(call gb_UnoApi_get_target,$(1)) : $(call gb_Package_get_target,$(1)_inc) $(call gb_UnoApi_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_clean_target,$(1)) @@ -47,7 +47,7 @@ $(call gb_UnoApi_get_clean_target,$(1)) : $(call gb_UnoApiHeadersTarget_get_clea $(call gb_UnoApi_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(1)_idl) $(call gb_UnoApi_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(1)_inc) -$(call gb_Package_get_preparation_target,$(1)_inc) : $(call gb_UnoApiHeadersTarget_get_lightweight_target,$(1)) +$(call gb_Package_get_preparation_target,$(1)_inc) : $(call gb_UnoApiHeadersTarget_get_target,$(1)) $(call gb_Deliver_add_deliverable,$(call gb_UnoApi_get_target,$(1)),$(call gb_UnoApiTarget_get_target,$(1)),$(1)) diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk index 893e41632095..388fe3c3bbe7 100644 --- a/solenv/gbuild/UnoApiTarget.mk +++ b/solenv/gbuild/UnoApiTarget.mk @@ -265,39 +265,39 @@ touch $(1) endef -$(call gb_UnoApiHeadersTarget_get_target,%) : - $(call gb_Output_announce,$*,$(true),HPP,3) - $(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_dir,$*)) +$(call gb_UnoApiHeadersTarget_get_bootstrap_target,%) : + $(call gb_Output_announce,$*,$(true),HPB,3) + $(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_bootstrap_dir,$*)) $(call gb_UnoApiHeadersTarget_get_comprehensive_target,%) : $(call gb_Output_announce,$*,$(true),HPC,3) $(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_comprehensive_dir,$*),-C) -$(call gb_UnoApiHeadersTarget_get_lightweight_target,%) : - $(call gb_Output_announce,$*,$(true),HPL,3) - $(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_lightweight_dir,$*),-L) +$(call gb_UnoApiHeadersTarget_get_target,%) : + $(call gb_Output_announce,$*,$(true),HPP,3) + $(call gb_UnoApiHeadersTarget__command,$@,$*,$(call gb_UnoApiHeadersTarget_get_dir,$*),-L) .PHONY : $(call gb_UnoApiHeadersTarget_get_clean_target,%) $(call gb_UnoApiHeadersTarget_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),HPP,3) $(call gb_Helper_abbreviate_dirs_native,\ rm -rf \ + $(call gb_UnoApiHeadersTarget_get_dir,$*) \ + $(call gb_UnoApiHeadersTarget_get_bootstrap_dir,$*) \ $(call gb_UnoApiHeadersTarget_get_comprehensive_dir,$*) \ - $(call gb_UnoApiHeadersTarget_get_lightweight_dir,$*) \ - $(call gb_UnoApiHeadersTarget_get_dir,$*) \ - $(call gb_UnoApiHeadersTarget_get_comprehensive_target,$*) \ - $(call gb_UnoApiHeadersTarget_get_lightweight_target,$*) \ - $(call gb_UnoApiHeadersTarget_get_target,$*)) + $(call gb_UnoApiHeadersTarget_get_target,$*) \ + $(call gb_UnoApiHeadersTarget_get_bootstrap_target,$*)) \ + $(call gb_UnoApiHeadersTarget_get_comprehensive_target,$*) define gb_UnoApiHeadersTarget_UnoApiHeadersTarget $(call gb_UnoApiHeadersTarget_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) +$(call gb_UnoApiHeadersTarget_get_bootstrap_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) $(call gb_UnoApiHeadersTarget_get_comprehensive_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) -$(call gb_UnoApiHeadersTarget_get_lightweight_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) $(call gb_UnoApiHeadersTarget_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_clean_target,$(1)) $(call gb_UnoApiHeadersTarget_get_target,$(1)) : UNOAPI_DEPS := +$(call gb_UnoApiHeadersTarget_get_bootstrap_target,$(1)) : UNOAPI_DEPS := $(call gb_UnoApiHeadersTarget_get_comprehensive_target,$(1)) : UNOAPI_DEPS := -$(call gb_UnoApiHeadersTarget_get_lightweight_target,$(1)) : UNOAPI_DEPS := endef @@ -313,8 +313,8 @@ endef define gb_UnoApiHeadersTarget_add_rdbfile $(call gb_UnoApiHeadersTarget__add_rdbfile,$(1),$(2),target) +$(call gb_UnoApiHeadersTarget__add_rdbfile,$(1),$(2),bootstrap_target) $(call gb_UnoApiHeadersTarget__add_rdbfile,$(1),$(2),comprehensive_target) -$(call gb_UnoApiHeadersTarget__add_rdbfile,$(1),$(2),lightweight_target) endef -- cgit From 7e94a37403aa4470bd7dad7c549ba8bc7485620a Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sun, 1 Apr 2012 17:11:57 +0200 Subject: add_internal_*_api for Executable too --- solenv/gbuild/Executable.mk | 3 +++ 1 file changed, 3 insertions(+) (limited to 'solenv') diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk index 8a7fc2601f83..174ddb662216 100644 --- a/solenv/gbuild/Executable.mk +++ b/solenv/gbuild/Executable.mk @@ -105,6 +105,9 @@ $(eval $(foreach method,\ add_libs \ set_library_path_flags \ add_api \ + add_internal_api \ + add_internal_bootstrap_api \ + add_internal_comprehensive_api \ add_linked_libs \ add_linked_static_libs \ use_external \ -- cgit