bug-make
[Top][All Lists]
Advanced

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

Re: Bug#107624: make: the "-W <file>" option used with VPATH does not wo


From: Manoj Srivastava
Subject: Re: Bug#107624: make: the "-W <file>" option used with VPATH does not work correctly
Date: Sun, 19 Aug 2001 23:44:42 -0500
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.104 (i586-pc-linux-gnu)

Hi,

          [Please retain the CC to address@hidden so
          that the Debian Bug Tracking system can record your input]

        This has been reported by a debian user.

There seems to be a strange interaction with the "-W <file>"
option when it is used in conjunction with the VPATH feature of
make.

Firstly, here is an excerpt from the make info manual,

    `-W FILE'
    `--what-if=FILE'
    `--new-file=FILE'
    `--assume-new=FILE'

    Pretend that the target FILE has just been modified.  When
    used with the `-n' flag, this shows you what would happen if
    you were to modify that file.  Without `-n', it is almost the
    same as running a `touch' command on the given file before
    running `make', except that the modification time is changed
    only in the imagination of `make'.

Now, an annotated typescript that demonstrates the problem,

1. !139, 140, 141, 142 - here is the situation, "a" depends on
   "b", however, "b" only exists as "./b-dir/b", while "a" exists
   only in the directory from which make is being run.  As you can
   see, "a" is up to date.

    139 jeff /tmp $ echo .{,/b-dir}/{a,b}
    ./a ./b ./b-dir/a ./b-dir/b

    140 jeff /tmp $ ls -l .{,/b-dir}/{a,b}
    ls: ./b: No such file or directory
    ls: ./b-dir/a: No such file or directory
    -rw-rw-r--    1 jeff     root            0 Aug  3 14:29 ./a
    -rw-rw-r--    1 jeff     root            0 Aug  3 14:29 ./b-dir/b
    --> exit status 1

    141 jeff /tmp $ printf '%b' 'a: b\n\tcp $(<) $(@)\n'
    a: b
            cp $(<) $(@)

    142 jeff /tmp $ printf '%b' 'a: b\n\tcp $(<) $(@)\n' | make -f \
/dev/stdin  VPATH=b-dir
    make: `a' is up to date.

2. !143, 144, 145 - I maintain that make should behave identically
   at both !143 and !144-145, ie, at !143, "a" should have been
   re-made.

    143 jeff /tmp $ printf '%b' 'a: b\n\tcp $(<) $(@)\n' | make -f \
/dev/stdin  VPATH=b-dir -W ./b-dir/b
    make: `a' is up to date.

    144 jeff /tmp $ touch ./b-dir/b

    145 jeff /tmp $ printf '%b' 'a: b\n\tcp $(<) $(@)\n' | make -f \
/dev/stdin  VPATH=b-dir
    cp b-dir/b a

3. !146, 147, 148 - here make behaves correctly at !146 and !147,
   however, the behavior at !148 is problematic, IMO.  Since VPATH
   is in effect, make should pretend that the first "b" that it
   finds in the VPATH has just been modified, instead make ignores
   VPATH entirely, and considers "b", ie, "./b" as the
   prerequisite for "a".

   One could argue here that "-W b" means "-W ./b", thus make is
   behaving correctly at !148, however, such an interpretation
   makes it very difficult to use "-W <file>" along with VPATH and
   forces the user to know exactly where VPATH would have found
   <pathname-to-file> in order for her to specify it as "-W
   <pathname-to-file>".

    146 jeff /tmp $ printf '%b' 'a: b\n\tcp $(<) $(@)\n' | make -f \
/dev/stdin  VPATH=b-dir
    make: `a' is up to date.

    147 jeff /tmp $ printf '%b' 'a: b\n\tcp $(<) $(@)\n' | make -f \
/dev/stdin  VPATH=b-dir -W ./b
    cp b a
    cp: cannot stat `b': No such file or directory
    make: *** [a] Error 1
    --> exit status 2

    148 jeff /tmp $ printf '%b' 'a: b\n\tcp $(<) $(@)\n' | make -f \
/dev/stdin  VPATH=b-dir -W b
    cp b a
    cp: cannot stat `b': No such file or directory
    make: *** [a] Error 1
    --> exit status 2


        manoj

-- 
 Kissing don't last, cookery do. George Meredith
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]