Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On 6 March 2012 18:17, Takeshi Abe <tabe@fixedpoint.jp> wrote:
So I doubt 90491a073c5b5faee782ad5eab63276fda2342e6.
In my case (gmake 3.81 on Debian wheezy) reverting it makes `make sal`
work again.

Oh no, I guess I should start to use make 3.81 when doing such changes.

Unfortunately I don't know how to fix that.
make 3.81 just can't behave. It ignores the trailing '/' in $(OUTDIR)/%/ :
and I think it ignores even more (everything after % ?).

I created attached patch where
+$(OUTDIR)/% :
+   $(if $<,$(call gb_Deliver_deliver,$<,$@),mkdir -p $@)
was supposed to solve problems (and maybe bring others).

Then there was problem with cppunittester because it's in special
directory, but well, I can skip mentioning that. Can be solved.

The next problem is again with picking wrong rules:
$(gb_Library_OUTDIRLOCATION)/%$(gb_Library_PLAINEXT) :
    $(call gb_Helper_abbreviate_dirs,\
        $(call gb_Deliver_deliver,$<,$@) \
            $(foreach target,$(AUXTARGETS), && $(call
gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target))))

make 3.81 can't prefer this rule over the first seen $(OUTDIR)/% :
even if it is more specific (longer prefix and also there is suffix specified)

So I am giving up on hope I can hack around misbehaving of make 3.81
and we most probably want to revert nice improvement in
90491a073c5b5faee782ad5eab63276fda2342e6

Matus
From e086cf12524ff8ea325ec46002a3bd00cbfad009 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Kukan?= <matus.kukan@gmail.com>
Date: Tue, 6 Mar 2012 22:08:42 +0100
Subject: [PATCH] fix for make 3.81

Make 3.81 ignores trailing '/' in target, so distinguish between
directory and regular file by checking if there is any prerequisite.

The dark side is that now test in gb_Deliver_deliver is not doing it's
job and we can't error on files with missing prerequisite.
---
 solenv/gbuild/ComponentTarget.mk |    5 -----
 solenv/gbuild/Configuration.mk   |   28 ----------------------------
 solenv/gbuild/Helper.mk          |    6 ++++++
 solenv/gbuild/Package.mk         |    6 ------
 solenv/gbuild/Rdb.mk             |    6 ------
 solenv/gbuild/TargetLocations.mk |    9 ---------
 6 files changed, 6 insertions(+), 54 deletions(-)

diff --git a/solenv/gbuild/ComponentTarget.mk b/solenv/gbuild/ComponentTarget.mk
index adec783..97ca493 100644
--- a/solenv/gbuild/ComponentTarget.mk
+++ b/solenv/gbuild/ComponentTarget.mk
@@ -52,11 +52,6 @@ $(call gb_ComponentTarget_get_target,%) : $(call gb_ComponentTarget_get_source,$
 $(call gb_ComponentTarget_get_target,%) :
        $(eval $(call gb_Outpt_error,Unable to find component file $(call 
gb_ComponentTarget_get_source,,$*) in the repositories: $(gb_ComponentTarget_REPOS) or xsltproc is 
missing.))
 
-$(call gb_ComponentTarget_get_outdir_target,%/) :
-       mkdir -p $@
-
-$(call gb_ComponentTarget_get_outdir_target,%) :
-       $(call gb_Deliver_deliver,$<,$@)
 
 define gb_ComponentTarget_ComponentTarget
 $(call gb_ComponentTarget_get_target,$(1)) : COMPONENTPREFIX := $(2)
diff --git a/solenv/gbuild/Configuration.mk b/solenv/gbuild/Configuration.mk
index c16bc13..a63325a 100644
--- a/solenv/gbuild/Configuration.mk
+++ b/solenv/gbuild/Configuration.mk
@@ -101,13 +101,6 @@ $(call gb_XcsTarget_get_clean_target,%) :
                rm -f $(call gb_XcsTarget_get_target,$*) \
                          $(call gb_XcsTarget_get_outdir_target,$(XCSFILE)))
 
-$(call gb_XcsTarget_get_outdir_target,%/) :
-       mkdir -p $@
-
-$(call gb_XcsTarget_get_outdir_target,%) :
-       $(call gb_Helper_abbreviate_dirs,\
-               $(call gb_Deliver_deliver,$<,$@))
-
 
 # XcuDataTarget class
 
@@ -145,13 +138,6 @@ $(call gb_XcuDataTarget_get_clean_target,%) :
                rm -f $(call gb_XcuDataTarget_get_target,$*) \
                          $(call gb_XcuDataTarget_get_outdir_target,$(XCUFILE)))
 
-$(call gb_XcuDataTarget_get_outdir_target,%/) :
-       mkdir -p $@
-
-$(call gb_XcuDataTarget_get_outdir_target,%) :
-       $(call gb_Helper_abbreviate_dirs,\
-               $(call gb_Deliver_deliver,$<,$@))
-
 
 # XcuModuleTarget class
 
@@ -185,13 +171,6 @@ $(call gb_XcuModuleTarget_get_clean_target,%) :
                rm -f $(call gb_XcuModuleTarget_get_target,$*) \
                          $(call gb_XcuModuleTarget_get_outdir_target,$(XCUFILE)))
 
-$(call gb_XcuModuleTarget_get_outdir_target,%/) :
-       mkdir -p $@
-
-$(call gb_XcuModuleTarget_get_outdir_target,%) :
-       $(call gb_Helper_abbreviate_dirs,\
-               $(call gb_Deliver_deliver,$<,$@))
-
 
 # XcuLangpackTarget class
 
@@ -223,13 +202,6 @@ $(call gb_XcuLangpackTarget_get_clean_target,%) :
                          $(call gb_XcuLangpackTarget__get_target_with_lang,$*,$(lang)) \
                          $(call 
gb_XcuLangpackTarget__get_outdir_target_with_lang,$(XCUFILE),$(lang))))
 
-$(call gb_XcuLangpackTarget_get_outdir_target,%/) :
-       mkdir -p $@
-
-$(call gb_XcuLangpackTarget_get_outdir_target,%) :
-       $(call gb_Helper_abbreviate_dirs,\
-               $(call gb_Deliver_deliver,$<,$@))
-
 
 # XcuMergeTarget class
 
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk
index 10dac0b..41f597a 100644
--- a/solenv/gbuild/Helper.mk
+++ b/solenv/gbuild/Helper.mk
@@ -36,6 +36,12 @@ gb_Helper_PHONY := $(gb_Helper_MISC)/PHONY
 # general purpose empty dummy target
 gb_Helper_MISCDUMMY := $(gb_Helper_MISC)/DUMMY
 
+# General purpose rule for delivering files into $(OUTDIR).
+# Ideally we would use $(OUTDIR)/%/ for directories and (OUTDIR)/%
+# for files but make 3.81 ignores trailing '/', so we use this hack.
+$(OUTDIR)/% :
+       $(if $<,$(call gb_Deliver_deliver,$<,$@),mkdir -p $@)
+
 .PHONY : $(WORKDIR)/Misc/PHONY
 $(gb_Helper_MISCDUMMY) :
        @mkdir -p $(dir $@) && touch $@
diff --git a/solenv/gbuild/Package.mk b/solenv/gbuild/Package.mk
index c8fd575..6c33cc8 100644
--- a/solenv/gbuild/Package.mk
+++ b/solenv/gbuild/Package.mk
@@ -29,12 +29,6 @@
 
 # PackagePart class
 
-$(foreach destination,$(call gb_PackagePart_get_destinations), $(destination)/%/) :
-       mkdir -p $@
-
-$(foreach destination,$(call gb_PackagePart_get_destinations), $(destination)/%) :
-       $(call gb_Deliver_deliver,$<,$@)
-
 define gb_PackagePart_PackagePart
 $(OUTDIR)/$(1) : $(2) | $(dir $(OUTDIR)/$(1))
 $(2) :| $(3)
diff --git a/solenv/gbuild/Rdb.mk b/solenv/gbuild/Rdb.mk
index 2aaca0a..285c7a4 100644
--- a/solenv/gbuild/Rdb.mk
+++ b/solenv/gbuild/Rdb.mk
@@ -59,12 +59,6 @@ $(call gb_Rdb_get_clean_target,%) :
        $(call gb_Helper_abbreviate_dirs_native,\
                rm -f $(call gb_Rdb_get_outdir_target,$*) $(call gb_Rdb_get_target,$*))
 
-$(call gb_Rdb_get_outdir_target,%/) :
-       mkdir -p $@
-
-$(call gb_Rdb_get_outdir_target,%) :
-       $(call gb_Deliver_deliver,$<,$@)
-
 define gb_Rdb_Rdb
 $(call gb_Rdb_get_target,$(1)) : COMPONENTS :=
 $(call gb_Rdb_get_clean_target,$(1)) : COMPONENTS :=
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index 119bbed..7f976f0 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -32,15 +32,6 @@ gb_ComponentTarget_get_outdir_target = $(OUTDIR)/xml/component/$(1).component
 gb_Executable_get_target = $(OUTDIR)/bin/$(1)$(gb_Executable_EXT)
 gb_Executable_get_target_for_build = $(OUTDIR_FOR_BUILD)/bin/$(1)$(gb_Executable_EXT_for_build)
 gb_Extension_get_outdir_target = $(OUTDIR)/bin/$(1).oxt
-gb_PackagePart_get_destinations = \
-       $(OUTDIR)/bin \
-       $(OUTDIR)/idl \
-       $(OUTDIR)/inc \
-       $(OUTDIR)/lib \
-       $(OUTDIR)/pck \
-       $(OUTDIR)/unittest \
-       $(OUTDIR)/xml \
-
 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
-- 
1.7.1


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.