split rdb generation out of UnoApiTarget

This commit is contained in:
David Tardon 2012-01-29 15:21:50 +01:00
parent bec18a80f5
commit 1deb3f6711
4 changed files with 113 additions and 21 deletions

View file

@ -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 \

89
solenv/gbuild/TypesRdb.mk Normal file
View file

@ -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 <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.
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:

View file

@ -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:

View file

@ -289,6 +289,7 @@ include $(foreach class, \
JavaClassSet \
JunitTest \
Module \
TypesRdb \
UnoApiTarget \
Zip \
Configuration \