summaryrefslogtreecommitdiff
path: root/solenv/gbuild/UnoApiTarget.mk
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-03-08 09:55:50 +0100
committerMichael Stahl <mstahl@redhat.com>2012-03-08 10:01:48 +0100
commit294b86e3dbbdb9b136cb17a51687f4e2762711cf (patch)
tree510d4355bdc4825d4b7e6ea5a1a102bdbd410fc3 /solenv/gbuild/UnoApiTarget.mk
parentf4926f2310be4870c948df806053f6573259e10f (diff)
gbuild: fix mkdir optimization with make 3.81
The problem is that make 3.81 does not match pattern rules whose target ends with '/' against directories. (regression from 408822b54724f8170a1296ddd67e50d8291c8ee1, 90491a073c5b5faee782ad5eab63276fda2342e6) So use a fake file ".dir" in the respective directory, and try not to spawn unnecessary mkdir processes by checking for existence via realpath. This is all quite ugly and should be reverted once support for make 3.81 is dropped. Also, fix a pre-existing problem of pattern rules with multiple targets that used to work by accident in Package.mk.
Diffstat (limited to 'solenv/gbuild/UnoApiTarget.mk')
-rw-r--r--solenv/gbuild/UnoApiTarget.mk9
1 files changed, 5 insertions, 4 deletions
diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk
index 9d0cfc6faeb2..c751dd451a93 100644
--- a/solenv/gbuild/UnoApiTarget.mk
+++ b/solenv/gbuild/UnoApiTarget.mk
@@ -56,7 +56,7 @@ endef
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_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 :=
@@ -74,7 +74,7 @@ define gb_UnoApiTarget__add_idlfile
$(call gb_UnoApiPartTarget_get_target,$(2)/idl.done) : \
$(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)
$(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd) :| \
- $(call gb_UnoApiPartTarget_get_target,$(2)/)
+ $(call gb_UnoApiPartTarget_get_target,$(2)/.dir)
gb_UnoApiTarget_IDLFILES_$(1) += $(2)/$(3).idl
ifeq ($(gb_FULLDEPS),$(true))
@@ -202,8 +202,9 @@ $(call gb_UnoApiTarget_get_clean_target,%) :
# 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,%/) :
- mkdir -p $@
+# the .dir is for make 3.81, which ignores trailing /
+$(dir $(call gb_UnoApiPartTarget_get_target,))%/.dir :
+ $(if $(realpath $(dir $@)),,mkdir -p $(dir $@))
$(call gb_UnoApiPartTarget_get_target,%.urd) :
touch $@