bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

basename function does nothing when it appears in prerequisites


From: Manoj Srivastava
Subject: basename function does nothing when it appears in prerequisites
Date: Sat, 08 Sep 2001 21:03:36 -0500
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.105 (i586-pc-linux-gnu)

Hi,

        [Please retain the CC to address@hidden so
        that the Debian dug tracking system may have a record of your
        contribution.]

        The following was reported by a Debian user for make 3.79.1

        manoj

The following sample makefile should not produce the error it does produce
(output follows the makefile).  The $(basename ...) function should work when
it appears in the prerequisites section of a rule, but it does nothing.


/var/tmp> mkdir test; cd test
/var/tmp/test> cat >>Makefile
# do this first:
# touch foo foo.ww.WW foo foo.yy.zz

all: $(addprefix foo., zz yy ww xx)
.PHONY: all

zz = $(basename foo.xx)

foo.zz: %: $(zz)
        @echo foo.zz deps should be foo and are $^

foo.yy: %: $(addsuffix .zz, %)
        @echo foo.yy deps should be foo.yy.zz and are $^

foo.ww: %: %.WW
        @echo foo.ww deps should be foo.ww.WW and are $^

foo.xx: %: $(basename %)
        @echo foo.xx deps should be foo and are $^

/var/tmp/test> touch foo foo.ww.WW foo foo.yy.zz
/var/tmp/test> ls -l
total 4
-rw-rw-r--    1 swift    swift           0 Aug 30 19:28 foo
-rw-rw-r--    1 swift    swift           0 Aug 30 19:28 foo.ww.WW
-rw-rw-r--    1 swift    swift           0 Aug 30 19:28 foo.yy.zz
-rw-rw-r--    1 swift    swift         410 Aug 30 19:27 makefile
/var/tmp/test> make
foo.zz deps should be foo and are foo
foo.yy deps should be foo.yy.zz and are foo.yy.zz
foo.ww deps should be foo.ww.WW and are foo.ww.WW
make: Circular foo.xx <- foo.xx dependency dropped.
foo.xx deps should be foo and are
/var/tmp/test> 


-- 
 If a person (a) is poorly, (b) receives treatment intended to make
 him better, and (c) gets better, then no power of reasoning known to
 medical science can convince him that it may not have been the
 treatment that restored his health. Sir Peter Medawar, "The Art of
 the Soluble"
Manoj Srivastava   <address@hidden>  <http://www.debian.org/%7Esrivasta/>
1024R/C7261095 print CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C



reply via email to

[Prev in Thread] Current Thread [Next in Thread]