bugmake - Bugs: bug #33499, VPATH does not work with 'Advanced...

 
 

bug #33499: VPATH does not work with 'Advanced Auto-Dependency Generation' when source file is moved into another location

Submitter:  None
Submitted:  Thu 09 Jun 2011 06:14:55 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Not A Bug Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.81 Operating System:  POSIX-Based
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 19 Sep 2011 07:46:01 PM UTC, comment #1: 

This isn't a bug in GNU make, and the contents of and descriptions on non-GNU/FSF websites are not part of GNU make and aren't subject to bug reports in Savannah.

The behavior you're seeing is correct, since the auto-generated dependency files contain hardcoded pathnames, they don't use VPATH for lookup.

If you wanted to you could probably remove all paths from the generated dependency files, whereupon make would use VPATH, but the problem with that is you can never have two files in two different directories with the same name, or make can't tell the difference.  Maybe that's OK in your environment; I would definitely never accept it in mine.

If you want to discuss this further I think asking on the -email is unavailable- mailing list, giving more details about exactly what you're trying to do, is your best bet.

Paul D. Smith <psmith>
Group administrator
Thu 09 Jun 2011 06:14:55 AM UTC, original submission:  

I am using 'Advanced Auto-Dependency Generation' described at http://make.paulandlesley.org/autodep.html together with VPATH.

When source file is moved from one location in VPATH into another one (usual situation in our project), make still try to use a source file in old location.

I created a script (attached) to illustrate a problem.

Output on my host:

GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-linux-gnu

-------------------------------------------- First build works

found src/a/foo.c, actual src/a/foo.c
cc    -c -MD -o foo.o src/a/foo.c
cc -o foo foo.o
make: Nothing to be done for `all'.

-------------------------------------------- mv src/a/foo.c src/b/foo.c

-------------------------------------------- Second build fails

found src/a/foo.c, actual src/b/foo.c
cc    -c -MD -o foo.o src/a/foo.c
cc: src/a/foo.c: No such file or directory
cc: no input files
make: * [foo.o] Error 1

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #23510:  err_in_dep.sh added by None (2KiB - application/x-sh)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by okarpenk
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-09-19 psmith StatusNone Not A Bug
        Open/ClosedOpen Closed
    2011-06-09 okarpenk Carbon-Copy- Added okarpenk
    2011-06-09 None Attached File- Added err_in_dep.sh, #23510

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code