Loading...

help-make@gnu.org

[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)" "$$@"
endef

     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
generate_install_rule,$$(install_file))),$$(INSTALL_FILES))

    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:
<http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/include/mk/master_rules.mk?revision=1.1.2.7&view=markup&pathrev=makefile_infra_rework>.

Thanks!
-Garrett


_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/help-make