bugmake - Bugs: bug #15583, make can not find an implicit rule...

 
 

bug #15583: make can not find an implicit rule the first time around

Submitter:  Manoj Srivastava <srivasta>
Submitted:  Tue 31 Jan 2006 02:48:42 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Duplicate Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  None Operating System:  POSIX-Based
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 06 Feb 2006 07:02:15 AM UTC, comment #2: 

You are seeing this problem because you are hiding information from make.  You have a rule, "copies", that creates three different .c files.  However, only one .c file lists "copies" as a prerequisite.  Even if all of them listed it, make doesn't know that invoking the rule "copies" once creates all three source files.  Because make caches directory information internally, it doesn't realize that files were created as a side-effect of invoking the "copies" target.  The issue with directory caching is already covered in bug #443.

In your case it's trivial enough to rewrite your Makefile.am to avoid this problem, by making sure there is a rule to create each script.  This has the added advantage that you will only copy files when they've actually changed.  Unfortunately Savannah will trash my indentation below, so replace "->" with a TAB; here is your current src/one/Makefile.am:

JudyLTables.c: JudyLTablesGen.c
-> $(CC) $(INCLUDES) $(AM_CFLAGS) @CFLAGS@ -o JudyLTablesGen JudyLTablesGen.c; ./JudyLTablesGen

JudyLCascade.c: copies

copies:
-> cp -f ../common/JudyCascade.c JudyLCascade.c
-> cp -f ../common/JudyCount.c JudyLCount.c
-> cp -f ../common/JudyTables.c JudyLTablesGen.c


Replace that with something like:

JudyLTables.c: ../common/JudyTables.c
-> $(CC) $(INCLUDES) $(AM_CFLAGS) @CFLAGS@ -o JudyLTablesGen ../common/JudyTables.c; ./JudyLTablesGen

JudyLCascade.c: ../common/JudyCascade.c
-> cp -f ../common/JudyCascade.c JudyLCascade.c
JudyLCount.d: ../common/JudyCount.c
-> cp -f ../common/JudyCount.c JudyLCount.c


I'm closing this as a duplicate of bug #443.

Paul D. Smith <psmith>
Group administrator
Tue 31 Jan 2006 08:56:20 AM UTC, comment #1: 


> Please CC -email is unavailable- in your replies, so
> that the Debian BTS may have a record of your reply.


Use Savannah's bug tracking CC capability, I have no way to CC when  I post this comment.

> I have attached a simplified testcase broken_make_example.tgz.


Could you please either attach this test case to the bug report or provide a link to it.

Boris Kolpackov <bosk>
Group Member
Tue 31 Jan 2006 02:48:42 AM UTC, original submission:  

Hi,

        A debian user reported this bug. Please CC -email is unavailable- in your replies, so that the Debian BTS may have a record of your reply.

     manoj

Using make <= 3.80-8.dirk, my package (libjudydevian1) builds
correctly. Using make 3.81.b4-0 & 3.81.b4-1 make can not find an
implicit rule when trying to build. However, simply runing make again
solves the issue.

I do not belive this has anything to do with the "second expansion"
featrue.

Symptoms:
  
When I run make it fails with:

make[3]: * No rule to make target `JudyLCount.lo', needed by
`libJudyL.la'.  Stop.
make[3]: Leaving directory `/tmp/x/src/JudyL'
make[2]: * [all-recursive] Error 1
make[2]: Leaving directory `/tmp/x/src'
make[1]: * [all-recursive] Error 1
make[1]: Leaving directory `/tmp/x'
make: * [all] Error 2

If I immediately run make a second time, it magically figures out how to
build JudyLCount.lo and continues on until it can't build Judy1Set.lo:

make[3]: * No rule to make target `Judy1Set.lo', needed by
`libJudy1.la'.  Stop.
make[3]: Leaving directory `/tmp/x/src/Judy1'
make[2]: * [all-recursive] Error 1
make[2]: Leaving directory `/tmp/x/src'
make[1]: * [all-recursive] Error 1
make[1]: Leaving directory `/tmp/x'
make: * [all] Error 2

Again, if I just type 'make' again, it magically figures out how to
build Judy1Set.lo and continues to completion.

Looking at the debug output from Make it shows that it can not find
the implicit rule the first time, but it can the second time.

make <= 3.80-8.dirk
  Successfully remade target file `JudyLTables.lo'.
      Considering target file `JudyLCount.lo'.
       File `JudyLCount.lo' does not exist.
       Looking for an implicit rule for `JudyLCount.lo'.
       Trying pattern rule with stem `JudyLCount'.
       Trying implicit prerequisite `JudyLCount.c'.
       Found an implicit rule for `JudyLCount.lo'.
       ...

make 3.81.b4-0 & 3.81.b4-1 (first run)
      Successfully remade target file `JudyLTables.lo'.
      Considering target file `JudyLCount.lo'.
       File `JudyLCount.lo' does not exist.
       Looking for an implicit rule for `JudyLCount.lo'.
       Trying pattern rule with stem `JudyLCount'.
       Trying implicit prerequisite `JudyLCount.c'.
       Trying pattern rule with stem `JudyLCount.lo'.
       Trying implicit prerequisite `JudyLCount.lo,v'.
       Trying pattern rule with stem `JudyLCount.lo'.
       Trying implicit prerequisite `RCS/JudyLCount.lo,v'.
       Trying pattern rule with stem `JudyLCount.lo'.
       Trying implicit prerequisite `RCS/JudyLCount.lo'.
       Trying pattern rule with stem `JudyLCount.lo'.
       Trying implicit prerequisite `s.JudyLCount.lo'.
       Trying pattern rule with stem `JudyLCount.lo'.
       Trying implicit prerequisite `SCCS/s.JudyLCount.lo'.
       Trying pattern rule with stem `JudyLCount'.
       Trying implicit prerequisite `JudyLCount.c'.
       Looking for a rule with intermediate file `JudyLCount.c'.
        Avoiding implicit rule recursion.
        Trying pattern rule with stem `JudyLCount'.
        Trying implicit prerequisite `JudyLCount.w'.
        Trying pattern rule with stem `JudyLCount.c'.
        Trying implicit prerequisite `JudyLCount.c,v'.
        Trying pattern rule with stem `JudyLCount.c'.
        Trying implicit prerequisite `RCS/JudyLCount.c,v'.
        Trying pattern rule with stem `JudyLCount.c'.
        Trying implicit prerequisite `RCS/JudyLCount.c'.
        Trying pattern rule with stem `JudyLCount.c'.
        Trying implicit prerequisite `s.JudyLCount.c'.
        Trying pattern rule with stem `JudyLCount.c'.
        Trying implicit prerequisite `SCCS/s.JudyLCount.c'.
        Trying pattern rule with stem `JudyLCount'.
        Trying implicit prerequisite `JudyLCount.w'.
        Looking for a rule with intermediate file `JudyLCount.w'.
         Avoiding implicit rule recursion.
         Avoiding implicit rule recursion.
         Trying pattern rule with stem `JudyLCount.w'.
         Trying implicit prerequisite `JudyLCount.w,v'.
         Trying pattern rule with stem `JudyLCount.w'.
         Trying implicit prerequisite `RCS/JudyLCount.w,v'.
         Trying pattern rule with stem `JudyLCount.w'.
         Trying implicit prerequisite `RCS/JudyLCount.w'.
         Trying pattern rule with stem `JudyLCount.w'.
         Trying implicit prerequisite `s.JudyLCount.w'.
         Trying pattern rule with stem `JudyLCount.w'.
         Trying implicit prerequisite `SCCS/s.JudyLCount.w'.
       No implicit rule found for `JudyLCount.lo'.
       Finished prerequisites of target file `JudyLCount.lo'.
      Must remake target `JudyLCount.lo'.
 ---> Error


make 3.81.b4-0 & 3.81.b4-1 (simply runing make again)
     Successfully remade target file `JudyLTables.lo'.
      Considering target file `JudyLCount.lo'.
       File `JudyLCount.lo' does not exist.
       Looking for an implicit rule for `JudyLCount.lo'.
       Trying pattern rule with stem `JudyLCount'.
       Trying implicit prerequisite `JudyLCount.c'.
       Found an implicit rule for `JudyLCount.lo'.
       ...


I have attached a simplified testcase broken_make_example.tgz. To
duplicate the problem:

1. tar zxvf broken_make_exmaple.tgz
2. cd broken_make_example
3. ./configure
4. make
will get error --> make[3]: * No rule to make target `JudyLCount.lo'
5. make (get's past JudyLCount.lo)
will get error --> make[3]: * No rule to make target `Judy1Set.lo'
6. make
--> everyting completes

Manoj Srivastava <srivasta>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Debian Bug Tracker)
  •  

    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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2006-02-06 psmith StatusNone Duplicate
        Open/ClosedOpen Closed
    2006-02-01 psmith Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code