diff options
author | David Tardon <dtardon@redhat.com> | 2012-04-06 14:24:47 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2012-04-06 14:31:05 +0200 |
commit | 7545dbbf64e959cfb166556935946f442199e92b (patch) | |
tree | 8ffd1c318cd4c3ff1efc54b0683660033c6d0002 /solenv/gbuild/UnoApiTarget.mk | |
parent | 7d82fb18fe6ae68f6eb6a33c6030105f9e2fe232 (diff) | |
parent | 7e94a37403aa4470bd7dad7c549ba8bc7485620a (diff) |
merge feature/gbuild_components
Diffstat (limited to 'solenv/gbuild/UnoApiTarget.mk')
-rw-r--r-- | solenv/gbuild/UnoApiTarget.mk | 374 |
1 files changed, 211 insertions, 163 deletions
diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk index 8d851ef2d5ac..d2adfe993c27 100644 --- a/solenv/gbuild/UnoApiTarget.mk +++ b/solenv/gbuild/UnoApiTarget.mk @@ -26,58 +26,175 @@ # #************************************************************************* -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) +# 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) + +# 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. +# the .dir is for make 3.81, which ignores trailing / +$(dir $(call gb_UnoApiPartTarget_get_target,))%/.dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + +$(call gb_UnoApiPartTarget_get_target,%.urd) : + touch $@ + +# TODO: +# - get idlc switch "-P" (generate .urd into package dir) +# - empty $? in headertarget? + +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 + +$(call gb_UnoApiPartTarget_get_target,%.done) : + $(call gb_UnoApiPartTarget__command,$@,$*,$?) + +ifeq ($(gb_FULLDEPS),$(true)) + +$(call gb_UnoApiPartTarget_get_dep_target,%) : + $(if $(wildcard $@),touch $@,\ + $(call gb_Object__command_dep,$@,$(call gb_UnoApiPartTarget_get_target,$*.urd))) + +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_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) +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) -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)))) +gb_UnoApiTarget_XMLRDB := $(call gb_UnoApiTarget_get_target,types) -$(call gb_Package_get_target,$(1)_inc) : $(call gb_UnoApiTarget_get_target,$(1)) +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,$(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 +define gb_UnoApiTarget__rdbmaker_command_impl +$(call gb_UnoApiTarget__command_impl,$(gb_UnoApiTarget_RDBMAKERCOMMAND),-O$(1) -B$(2) -b$(3) $(4) $(5)) 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)))) +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),$(UNOAPI_ROOT),$(UNOAPI_FILES)),\ + $(if $(UNOAPI_MERGE),\ + $(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) \ + && $(gb_UnoApiTarget_REGCOMPARECOMMAND) \ + -f -t \ + -r1 $(call gb_Helper_convert_native,$(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))) +$(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),$(UNOAPI_ROOT)) + $(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 -$$(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)) \ - | $(dir $(call gb_UnoApiOutTarget_get_target,$(1))).dir -$(call gb_UnoApiOutTarget_get_clean_target,$(1)) : $(call gb_UnoApiTarget_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_XML := $(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_REFERENCE := -gb_UnoApiTarget_HPPFILES_$(1) := -gb_UnoApiTarget_IDLFILES_$(1) := +$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_ROOT := + 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) +$(call gb_UnoApiTarget__add_urdfile,$(1),$(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)) $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd) :| \ $(call gb_UnoApiPartTarget_get_target,$(2)/.dir) -gb_UnoApiTarget_IDLFILES_$(1) += $(2)/$(3).idl 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)) : \ @@ -100,69 +217,27 @@ $(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))) +define gb_UnoApiTarget_merge_rdbfiles +$(foreach rdb,$(2),$(call gb_UnoApiTarget_merge_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)) : \ - $(call gb_UnoApiOutTarget_get_target,$(2)) \ - $(call gb_Package_get_target,$(2)_idl) +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 -define gb_UnoApiTarget_add_merge_rdbfiles -$(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)) +# 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 @@ -176,109 +251,82 @@ $(call gb_UnoApiTarget_get_target,$(1)) : INCLUDE := $(2) 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_Helper_abbreviate_dirs,\ - rm -f $(call gb_UnoApiTarget_get_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,$*) - -# 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. -# the .dir is for make 3.81, which ignores trailing / -$(dir $(call gb_UnoApiPartTarget_get_target,))%/.dir : - $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) +define gb_UnoApiTarget_set_root +$(call gb_UnoApiTarget_get_target,$(1)) : UNOAPI_ROOT := $(2) -$(call gb_UnoApiPartTarget_get_target,%.urd) : - touch $@ +endef -$(call gb_UnoApiPartTarget_get_target,%.done) : - $(call gb_UnoApiPartTarget__command,$@,$*,$?) +# UnoApiHeadersTarget +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) -define gb_UnoApiPartTarget__command - $(call gb_Output_announce,$(2),$(true),IDL,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 - 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_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_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_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_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 := 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))) && \ - $(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 $(wildcard $@),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),bootstrap_target) +$(call gb_UnoApiHeadersTarget__add_rdbfile,$(1),$(2),comprehensive_target) -$(call gb_UnoApiTarget_get_dep_target,%) : $(call gb_UnoApiTarget_get_target,%) - $(call gb_UnoApiTarget__command_dep,$@,$*,$(gb_UnoApiTarget_IDLFILES_$*)) - -endif +endef -# TODO: -# - get idlc switch "-P" (generate .urd into package dir) -# - empty $? in headertarget? +define gb_UnoApiHeadersTarget_add_rdbfiles +$(foreach rdb,$(2),$(call gb_UnoApiHeadersTarget_add_rdbfile,$(1),$(rdb))) -$(call gb_UnoApiTarget_get_target,%): $(gb_UnoApiTarget_CPPUMAKERTARGET) - $(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))) - $(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,$@)) - $(if $(gb_UnoApiTarget_IDLFILES_$*), \ - $(call gb_Output_announce,$*,$(true),HPP,4) \ - $(call gb_UnoApiHeaderTarget__command,$@,$*,$(UNOAPI_DEPS))) +endef # vim: set noet sw=4 ts=4: |