bugmake - Bugs: bug #27556, no rule to build target via vpath...

 
 

bug #27556: no rule to build target via vpath when jobserver is unavailable

Submitter:  None
Submitted:  Mon 28 Sep 2009 09:00:48 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.81 Operating System:  POSIX-Based
Fixed Release:  4.0 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 02 Jan 2023 07:10:37 PM UTC, comment #1: 

This appears to have been fixed in GNU make 4.0 (I can reproduce the failure in 3.81, and I get a different weird failure with GNU make 3.82: it works with 4.0).

Paul D. Smith <psmith>
Group administrator
Mon 28 Sep 2009 09:00:48 PM UTC, original submission:  

Building a target will fail with error:

* No rule to make target

under the following conditions:

1) target source is in a directory other than "." and is included
via vpath.

2) parallel build is deactivated, warning is:

warning: jobserver unavailable: using -j1


Here's a sample set of files and a procedure to reproduce:

Files:

dir1/Makefile
dir1/build.sh
dir1/dir.mk
dir1/main.c
dir2/f.c

----------
Makefile:
----------

default:
@./build.sh

----------
build.sh:
----------

make -f dir.mk

----------
dir.mk:
----------

vpath %c ./:../dir2:

main: main.o f.o
$(CC) -o main $^

clean:
rm -f main.o f.o main


----------
main.c:
----------

main()
{
    f();
}

----------
f.c:
----------

f()
{
    return(0);
}


=========

When in dir1, "make -f dir.mk" is fine.  So is "make -j2 dir.mk".
"make" alone is fine.

The failure is triggered with "make -j2" [-f Makefile].

make[1]: Entering directory `.../dir1'
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
cc    -c -o main.o main.c
make[1]: * No rule to make target `f.o', needed by `main'.  Stop.
make[1]: Leaving directory `.../dir1'
make: * [default] Error 2


When parallel builds are deactivated, the rule to make the target is lost when vpath is involved.

Anonymous

 

(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 (Posted a comment)
  •  

    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
    2023-01-02 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.0

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code