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

Submitted by:  None
Submitted on:  Thu 09 Jun 2011 06:14:55 AM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.81Operating System: POSIX-Based
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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 -unavailable- mailing list, giving more details about exactly what you're trying to do, is your best bet.

Paul D. Smith <psmith>
Project 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 File(s):
   
   
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
  • -unavailable- added by psmith (Posted a comment)
  • -unavailable- added by okarpenk
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 19 Sep 2011 07:46:01 PM UTCpsmithStatusNone=>Not A Bug
      Open/ClosedOpen=>Closed
    Thu 09 Jun 2011 06:21:23 AM UTCokarpenkCarbon-Copy-=>Added okarpenk
    Thu 09 Jun 2011 06:14:55 AM UTCNoneAttached File-=>Added err_in_dep.sh, #23510

    Back to the top


    Powered by Savane 3.1-cleanup1