[Prev] Thread [Next]  |  [Prev] Date [Next]

Using define to generate dynamic install targets Garrett Cooper Sat Jul 25 14:00:26 2009

Hi make folks,

    I'm working revising the Makefiles for LTP and I am running into a
bit of a technical snaggle. When I'm trying to define a generic eval
target, like so (lines 69-75):

define generate_install_rule
$$(dir $$(1)):
        mkdir -p $$@

$$(1): $$(dir $$(1))
        install -m $$(INSTALL_MODE) "$$(2)/$$(@F)" "$$@"

     It seems like it should work. It doesn't however called from my
eval / call below (lines 154-156), as well as an adhoc rule I wrote.
The former code can be found here:

# XXX (garrcoop): Doesn't work [now]. See generate_install_rule for more
# details.
#$$(foreach install_file,$$(eval $$(call

    Thus, every time I call that, as opposed to this less flexible logic:

$$(INSTALL_FILES): %: | $$(INSTALL_DEPS) $$(builddir)/$$(@F)
        install -m $$(INSTALL_MODE) $$(builddir)/$$(@F) $$@

    $(1) evaluates to an empty value in generate_install_rule. I'm not
sure what I possibly could be doing wrong, other than using := instead
of = -- could someone illuminate this problem for me?
    For reference, the CVS version of the file is available at:


Help-make mailing list