bug-make
[Top][All Lists]
Advanced

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

[bug #65982] make --trace does not explain remade include files


From: anonymous
Subject: [bug #65982] make --trace does not explain remade include files
Date: Fri, 12 Jul 2024 22:38:50 -0400 (EDT)

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

                 Summary: make --trace does not explain remade include files
                   Group: make
               Submitter: None
               Submitted: Sat 13 Jul 2024 02:38:49 AM 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: POSIX-Based
           Fixed Release: None
           Triage Status: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sat 13 Jul 2024 02:38:49 AM UTC By: Anonymous
Consider the following makefile (also attached). It makes one object file
xxx.o and also includes 2 generated makefiles. I want to use --trace to
understand why and when the include files were generated and when make
restarts, in a much larger makefile system of course. But the --trace logic
says nothing about makefile remaking. It explains why the .o is rebuilt but is
silent about the .mk.

Both %.o and %.mk are given artificial dependencies on Makefile. Thus when I
"touch Makefile" all must be rebuilt, but only %.o is and "all" are
explained.

$ cat Makefile
.PHONY: all
all: xxx.o
        @:

ifeq ($(filter clean,$(MAKECMDGOALS)),)
  $(info MAKE_RESTARTS=$(MAKE_RESTARTS))
  now := $(shell date)
  include x1.mk
endif

%.mk: Makefile
        @:$(info Making $@)
        @echo '$$(info Including $$(lastword $$(MAKEFILE_LIST)) at $(now))' >
$@

%.o: %.c Makefile
        $(CC) -c -o $@ $<

.PHONY: clean
clean:
        $(RM) x1.mk xxx.o

The sequence below shows --trace explaining the rebuild of xxx.o and "all" but
not of x1.mk:

$ make-4.4.1 clean
rm -f x1.mk xxx.o

$ make-4.4.1 --trace
MAKE_RESTARTS=
Making x1.mk
MAKE_RESTARTS=1
Including x1.mk at Fri Jul 12 19:31:26 PDT 2024
Makefile:16: update target 'xxx.o' due to: target does not exist
cc -c -o xxx.o xxx.c
Makefile:3: update target 'all' due to: target is .PHONY
:

$ touch Makefile

$ make-4.4.1 --trace
MAKE_RESTARTS=
Including x1.mk at Fri Jul 12 19:31:26 PDT 2024
Making x1.mk
MAKE_RESTARTS=1
Including x1.mk at Fri Jul 12 19:31:33 PDT 2024
Makefile:16: update target 'xxx.o' due to: Makefile
cc -c -o xxx.o xxx.c
Makefile:3: update target 'all' due to: target is .PHONY
:







    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature


reply via email to

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