bug-make
[Top][All Lists]
Advanced

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

[bug #62441] Recursive make & PHONY = targets being rebuilt [feature req


From: anonymous
Subject: [bug #62441] Recursive make & PHONY = targets being rebuilt [feature reques]
Date: Wed, 11 May 2022 11:48:12 -0400 (EDT)

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

                 Summary: Recursive make & PHONY = targets being rebuilt
[feature reques]
                 Project: make
            Submitted by: None
            Submitted on: Wed 11 May 2022 03:48:10 PM UTC
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: None
        Operating System: None
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

I have two makefiles:

*Makefile*

.PHONY: other_file
other_file:
        $(MAKE) -f Makefile2 other_file

my_file: other_file
        touch $@


*Makefile2*

other_file:
        touch $@



When I first run the command, it builds my_file and other_file as expected.

> make my_file --trace --no-print-directory
Makefile:6: target 'other_file' does not exist
make -f Makefile2 other_file
Makefile2:3: target 'other_file' does not exist
touch other_file
Makefile:9: update target 'my_file' due to: other_file
touch my_file


However, the next time I run the same command, it doesn't rebuild other_file,
but it does rebuild my_file.

make my_file --trace --no-print-directory
Makefile:6: target 'other_file' does not exist
make -f Makefile2 other_file
make[1]: 'other_file' is up to date.
Makefile:9: update target 'my_file' due to: other_file
touch my_file


This is obviously because other_file is marked as PHONY.

What I would like is this functionality for recursive make support: When it is
time to consider such a target, make will run its recipe unconditionally.
After the recipe is run, make will use the target's timestamp to determine if
other targets are out of date.

It would look something like: 
*Makefile*

.RECURSIVE_MAKE: other_file
other_file:
        $(MAKE) -f Makefile2 other_file

my_file: other_file
        touch $@


*Makefile2*

other_file:
        touch $@



> make my_file --trace --no-print-directory
Makefile:6: target 'other_file' does not exist
make -f Makefile2 other_file
Makefile2:3: target 'other_file' does not exist
touch other_file
Makefile:9: update target 'my_file' due to: other_file
touch my_file

> make my_file --trace --no-print-directory
Makefile:6: target 'other_file' requires recursive make.
make -f Makefile2 other_file
make[1]: 'other_file' is up to date.
make: 'my_file' is up to date.







    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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