URL:
  <http://savannah.gnu.org/bugs/?54233>

                 Summary: Infinite loop w/ -j2 & multiple pattern rules
                 Project: make
            Submitted by: alecov
            Submitted on: Mon 02 Jul 2018 06:10:19 PM UTC
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.2.1
        Operating System: Any
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

Make enters an infinite loop when `-j2` is used in the following situation:


# make -j2
# Try with a single-line recipe for %.elf/%.lnk or .ONESHELL.

#.ONESHELL:

all: a.elf a.dbg

%.elf \
%.lnk: %.c
        #$*.elf
        #$*.lnk

%.elf \
%.dbg: %.lnk
        #$*.elf
        #$*.dbg


If either `.ONESHELL:` is omitted or a single-line recipe is used for the
`%.elf/%.lnk` target, make runs fine.

A quick inspection with `make -d` yields:


Considering target file 'all'.
 File 'all' does not exist.
  Considering target file 'a.elf'.
  File 'a.elf' was considered already.
  Considering target file 'a.dbg'.
   File 'a.dbg' does not exist.
    Considering target file 'a.lnk'.
    Still updating file 'a.lnk'.
    Considering target file 'a.c'.
    File 'a.c' was considered already.
   Finished prerequisites of target file 'a.dbg'.
  The prerequisites of 'a.dbg' are being made.
 Finished prerequisites of target file 'all'.
The prerequisites of 'all' are being made.
(...repeats indefinitely...)




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 02 Jul 2018 06:10:19 PM UTC  Name: Makefile  Size: 169B   By: alecov
Test case
<http://savannah.gnu.org/bugs/download.php?file_id=44493>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?54233>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/


_______________________________________________
Bug-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to