2009/12/18 Jiří Paleček <[email protected]>:
> Hello,
>
> On Sat, 05 Dec 2009 09:01:52 +0100, Garrett Cooper <[email protected]>
> wrote:
>
>> On Fri, Dec 4, 2009 at 4:03 PM, Jiří Paleček <[email protected]> wrote:
>>>
>>> On Fri, 04 Dec 2009 20:13:11 +0100, Mike Frysinger <[email protected]>
>>> wrote:
>>>
>>>> On Friday 04 December 2009 12:04:06 Jiri Palecek wrote:
>>>>>
>>>>> -.PHONY: $(RECURSIVE_TARGETS) $(addprefix trunk-,$(RECURSIVE_TARGETS))
>>>>> +.PHONY: $(RECURSIVE_TARGETS) $(addprefix trunk-,$(RECURSIVE_TARGETS))
>>>>>  $(foreach tgt,$(RECURSIVE_TARGETS),$(addprefix
>>>>>  trunk-subdir-$(tgt)--,$(SUBDIRS)))
>>>>
>>>> these foreach look like an overly complicated form of $(patsubst):
>>>>       $(patsubst %,moo_%,$(DIRS))
>>>
>>> It may look like it, but they aren't. What you've written is a simple
>>> addprefix, while the foreach does some for of cartesian product
>>> ($(TARGETS)x$(DIRS)).
>>
>> 1. I checked in the fixes for the autotools targets after verifying
>> them (thank you btw!).
>> 2. Inline mkdirs are bad, because mkdir's can fail or cause failures
>> over NFS due to excessive I/O, which is why I quickly removed the test
>> -d || mkdir -p logic in the 2nd major draft of the makefile
>> infrastructure.
>
> OK.
>
>> 3. Although your idea for fixing the lack of recursive make'ing is
>> good, what about this instead?
>>
>> #
>> # A canned set of operations for leaf makes. This creates a series of
>> targets, like:
>> #
>> # $(subdir)-all $(subdir)-clean $(subdir)-install:
>> #
>> # 1 - Recursive targets to act upon.
>> # 2 - the subdirectory to do the leaf_make on.
>> #
>> define generate_dir_dep
>> ifndef __$(1)_dir_dep__
>> __$(1)_dir_dep__ = 1
>> $(1):
>>        mkdir -p "$$@"
>> endif
>> endif
>>
>> define leaf_make
>> $$(foreach recursive_target,$(1),$$(addprefix
>> $(2)-$$(recursive_target))): $(1)-%: $(2)
>>      $(MAKE) -C $* -f ""$(abs_srcdir)/$$*/Makefile" $$(patsubst
>> $(1)-%,%,$$@)
>> endef
>> $(foreach subdir $(SUBDIRS),$(eval $(call generate_dir_dep,$(subdir))))
>> $(foreach subdir,$(SUBDIRS),$(eval $(call leaf_make
>> $(RECURSIVE_TARGETS),$(subdir))
>>
>> Ultimately I suppose, it's another means to a similar end. It's just a
>> bit more discrete as to what's going on in the operation... if this is
>> a good idea, I'll modify functions.mk to match this. $(abspath) //
>> $(realpath) junk is already a PITA, so it might be a good idea just to
>> remove it in favor of keeping things as-is.
>
> Well, I can't say I got used to your generated rules and double dollars
> (you've got $* instead of $$* in the above IMHO). But if you deem it better,
> fine by me.

    Yes, you're right on the s/\Q$*\E/\Q$$*\E/. The $$ is required, as
per http://www.gnu.org/software/make/manual/make.html#Eval-Function,
unless I use $(value) (I just tested out this function and it
functions as expected on 3.80).
    My primary concern when we're doing these changes is that the
changes need to be as straightforward as possible. If you disagree,
please let me know. My offer was as much of a proposal as your's was.
I see a great deal of value in what you're proposing, so please feel
free to let me know what you feel :).
Thanks!
-Garrett

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to