bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #60399] Incorrect dependencies with grouped targets


From: Sean Anderson
Subject: [bug #60399] Incorrect dependencies with grouped targets
Date: Thu, 15 Apr 2021 14:17:57 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0

URL:
  <https://savannah.gnu.org/bugs/?60399>

                 Summary: Incorrect dependencies with grouped targets
                 Project: make
            Submitted by: callous_stream
            Submitted on: Thu 15 Apr 2021 06:17:55 PM UTC
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.3
        Operating System: POSIX-Based
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

The following makefile demonstrates some unexpected (buggy?) behavior


.PHONY: FORCE
b: FORCE
a b&:
        touch a
        touch b


What I expected to happen was

* Running "make a" for the first time would run the recipe.
* Running "make a" when "a" already existed would do nothing.
* Running "make b" would always run the recipe.

Instead, I observe the following behavior:


$ make --trace a
Makefile:4: target 'a' does not exist
touch a
touch b
$ make --trace b
Makefile:4: update target 'b' due to: FORCE
touch a
touch b
$ make --trace a
Makefile:4: target 'a' does not exist
touch a
touch b


In this example, "FORCE" is used to represent some dependency of "b" which has
been updated since the last run of "make". However, this behavior is also
present if "FORCE" is replaced by some regular file which is updated between
"make" runs.

If the makefile is modified slightly to


.PHONY: b
a b&:
        touch a
        touch b


Then I observe the following behavior:


$ make --trace a
Makefile:3: target 'a' does not exist
touch a
touch b
$ make --trace b
Makefile:3: target 'b' does not exist
touch a
touch b
$ make --trace a
make: 'a' is up to date.


>From this, it seems that "a" is incorrectly marked as ".PHONY" in the first
example. I'm not sure whether this is intended (albeit strange) behavior, or a
bug.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60399>

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]