[bug #64886] order-only prerequisite on a .PHONY line makes prerequisite "unmakeable"

2023-11-16 Thread Dmitry Goncharov
Follow-up Comment #4, bug #64886 (project make):

Order-only beats phony.
If a target depends on an order-only prerequisite, then this prerequisite does
not cause the target to be updated, whether this prerequisite is phony or
not.

> i guess only issue might be, "should .PHONY: give an error for order-only
pre-requisites?".  i can't think of a reason such a pre-requisite would make
any sense

It indeed useless to mark a prerequisite of .PHONY as order-only, given that
make never builds target .PHONY.

However, a prerequisite of a proper target can be marked both phony and
order-only and there are makefiles which do that.




___

Reply to this item at:

  

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




[bug #64886] order-only prerequisite on a .PHONY line makes prerequisite "unmakeable"

2023-11-15 Thread Greg Minshall
Follow-up Comment #3, bug #64886 (project make):

hi.  thanks for the responses.  no, i'm not claiming that the behavior is
different with or without the "|" (i.e., order-only or not).

i guess only issue might be, "should .PHONY: give an error for order-only
pre-requisites?".  i can't think of a reason such a pre-requisite would make
any sense (i.e., wouldn't be a mistake by the user).  but, i'm not that up on,
e.g., order-only.

and, maybe there's not really a way to detect the condition ".PHONY: +
order-only".  in which case, the current behavior probably stays.

again, thanks.


___

Reply to this item at:

  

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




[bug #64886] order-only prerequisite on a .PHONY line makes prerequisite "unmakeable"

2023-11-13 Thread Paul D. Smith
Update of bug #64886 (project make):

  Status:None => Not A Bug  
 Open/Closed:Open => Closed 

___

Follow-up Comment #2:

Agreed: in fact this is a primary reason to choose PHONY targets over
something like FORCE rules; they improve performance by avoiding that search
(as well as being a bit cleaner in syntax).

Greg are you saying that if you do NOT use the order-only separator you get
different behavior?


___

Reply to this item at:

  

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




[bug #64886] order-only prerequisite on a .PHONY line makes prerequisite "unmakeable"

2023-11-12 Thread Dmitry Goncharov
Follow-up Comment #1, bug #64886 (project make):

The described behavior is expected and has nothing to do with order-only.
The manual contains the following


The implicit rule search (see Using Implicit Rules) is skipped for .PHONY
targets.


You need an explicit rule for file.elc.


___

Reply to this item at:

  

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




[bug #64886] order-only prerequisite on a .PHONY line makes prerequisite "unmakeable"

2023-11-12 Thread Greg Minshall
URL:
  

 Summary: order-only prerequisite on a .PHONY line makes
prerequisite "unmakeable"
   Group: make
   Submitter: minshall
   Submitted: Sun 12 Nov 2023 05:13:16 PM UTC
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: 4.4.1
Operating System: None
   Fixed Release: None
   Triage Status: None


___

Follow-up Comments:


---
Date: Sun 12 Nov 2023 05:13:16 PM UTC By: Greg Minshall 
a buggy makefile can lead to odd behavior (surprise, surprise).

in this case, a target defined (erroneously) as an "order-only" prerequisite
on a .PHONY line, seems to prevent make from ever wanting to create that
target.

given this as a makefile (and, an empty `file.el`, but no `file.elc`):

%.elc: %.el
${EMACS} -f batch-byte-compile $<

.PHONY: all | file.elc
all:
echo all


then


% make file.elc
make: Nothing to be done for 'file.elc'.


(again, `file.elc` does not exist.)  

apologies if this isn't a bug.

if there's no reason to allow order-only prerequisites on a `.PHONY` line,
maybe this construction should cause make to emit an error message?

cheers.







___

Reply to this item at:

  

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