bugmake - Bugs: bug #22434, Consider a dependancy as target...

 
 

bug #22434: Consider a dependancy as target file and try to make the file

Submitted by:  mornifle
Submitted on:  Wed 27 Feb 2008 06:49:09 PM 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.

 

Sun 07 Jun 2009 01:51:37 AM UTC, comment #5:

This problem is happening because in your Viewer.cpp file you say:

#include "Viewer"

Because of this, when automake generates the automated prerequisites for the .o file (in src/.deps/) one of the prerequisites is the simple word "Viewer".

When make sees that prerequisite, it tries to build it. Make has no idea that you really mean a header file here that it can't see: it looks for a file "Viewer" and one doesn't exist, so it tries to build it. Make has a built-in rule that says "you can build any program FOO from FOO.cpp", and since it wants to build Viewer and it finds a Viewer.cpp... voila. It tries to compile it and fails.

This may or may not be a bug, but if it is it's a problem in automake's automated dependency generation, not GNU make.

Paul D. Smith <psmith>
Project Administrator
 Spam posted by an anonymous
Wed 27 Feb 2008 10:47:40 PM UTC, comment #4:

Sorry for the poor description. I will try to explain.
I added an example to reproduce it:
autoreconf -f -i
./configure
make
touch src/Viewer.cpp
make
-> an error occur here and it should not

while i ran make -d at this stage i deduce (maybe i am wrong) that a dependency is used as target eg it try to build Viewer object (and it should not because it's an include). I dont know why that's happen and why it does not happen the first time.
Maybe my explanation is not clear, try the example is very simple and you will be able to reproduce the problem. i put under the log of the compile it can give you an idea of the problem.

(file #15134)

mornifle
Wed 27 Feb 2008 06:57:18 PM UTC, comment #3:

Your testcase is way too complex to be convenient - it would be more helpful if you could make a self-contained example, rather than requiring people to install Hg and then clone your repository and then autoconf a makefile and only /then/ be able to even /start/ looking at the problem.

So this is only a guess, but it sounds like you've missed or misread the part of the manual that explains that all dependencies are always supposed to be prerequisites, and if you just want a goal as a dependency that doesn't make a target file of the same name, you have to list it as a .PHONY target. Are you simply missing a .PHONY declaration to tell make that "Pokme" isn't the name of a real output file?

Dave Korn <davek>
Wed 27 Feb 2008 06:57:09 PM UTC, comment #2:

Can you please explain clearly what exactly happens, AND what you expected to happen? I have no idea, based on the descriptions you provided, what the actual problem is.

Paul D. Smith <psmith>
Project Administrator
Wed 27 Feb 2008 06:51:47 PM UTC, comment #1:

sorry the log is wrong here the god one:

Considering target file `Viewer'.
File `Viewer' does not exist.
Looking for an implicit rule for `Viewer'.
Trying pattern rule with stem `Viewer'.
Trying implicit prerequisite `Viewer.cpp'.
Found an implicit rule for `Viewer'.
Pruning file `Viewer.cpp'.
Finished prerequisites of target file `Viewer'.
Must remake target `Viewer'.

mornifle
Wed 27 Feb 2008 06:49:09 PM UTC, original submission:

Hi,
here the end of the log to see the problem

Considering target file `Pokme'.
File `Pokme' does not exist.
Looking for an implicit rule for `Pokme'.
Trying pattern rule with stem `Pokme'.
Trying implicit prerequisite `Pokme.cpp'.
Found an implicit rule for `Pokme'.
Pruning file `Pokme.cpp'.
Finished prerequisites of target file `Pokme'.
Must remake target `Pokme'.

to reproduce the bug read http://hg.plopbyte.net/GnuMakeBug/file/0de340f455d7/README
to get the minimal project to reproduce it
hg clone http://hg.plopbyte.net/GnuMakeBug

I hope it helps

mornifle

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #15134:  log added by mornifle (9KiB - application/octet-stream)
file #15133:  GnuMakeBug.tar.gz added by None (8KiB - application/x-gzip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by davek (Posted a comment)
  • -unavailable- added by psmith (Posted a comment)
  • -unavailable- added by mornifle (Submitted the item)
  •  

    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
    Sun 07 Jun 2009 01:51:37 AM UTCpsmithStatusNone=>Not A Bug
      Open/ClosedOpen=>Closed
    Wed 27 Feb 2008 10:47:40 PM UTCmornifleAttached File-=>Added log, #15134
    Wed 27 Feb 2008 10:36:28 PM UTCNoneAttached File-=>Added GnuMakeBug.tar.gz, #15133

    Back to the top


    Powered by Savane 3.1-cleanup1