diff options
author | David Tardon <dtardon@redhat.com> | 2012-03-12 10:03:03 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2012-03-12 10:52:01 +0100 |
commit | f24ccecbeef52ecb822f1bd111ffe573ec41c142 (patch) | |
tree | 2dd36e57c83b84e5d809e18fb745d2789aa6a6c4 /solenv | |
parent | refactor UnoApi class (diff) | |
download | core-f24ccecbeef52ecb822f1bd111ffe573ec41c142.tar.gz core-f24ccecbeef52ecb822f1bd111ffe573ec41c142.zip |
add InternalUnoApi class
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/InternalUnoApi.mk | 83 | ||||
-rw-r--r-- | solenv/gbuild/Library.mk | 3 | ||||
-rw-r--r-- | solenv/gbuild/LinkTarget.mk | 30 | ||||
-rw-r--r-- | solenv/gbuild/TargetLocations.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/UnoApiTarget.mk | 53 | ||||
-rw-r--r-- | solenv/gbuild/gbuild.mk | 1 |
6 files changed, 164 insertions, 8 deletions
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 <dtardon@redhat.com> +# (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 \ |