Skip to content

Separate graph for Makefile update-time vs normal target rules #45

@WaitronCharm

Description

@WaitronCharm

Would it be possible to separate the generated graph into two parts:

  1. Makefile update-time target rules (i.e., targets executed while updating the included makefiles).
  2. Normal update-time rules for the actual build process.

Right now, the output graph seems to mix both types of targets, which makes it hard to distinguish between make's own 'internal' and real build dependencies. According to the POSIX 'make' spec, commands related to included makefile regeneration are treated specially and always execute even with '-n':

https://pubs.opengroup.org/onlinepubs/9799919799/utilities/make.html

...
-n
Write commands that would be executed on standard output, but do not execute them. However, lines with a ('+') prefix, lines that expand the MAKE macro, and lines being processed in order to create an include file or to bring it up-to-date (see Include Lines in the EXTENDED DESCRIPTION section) shall be executed. In this mode, lines with a ('@') character prefix shall be written to standard output.
...

For example, when running GNU Make with tracing enabled, the log output includes lines like:

GNU Make 4.4.1
Built for x86_64-pc-cygwin
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Reading makefile 'makefile'...
Reading makefile '08bd2354-5240-4b36-935b-15739fa12a56' (search path) (no ~ expansion)...
Reading makefile '1039cd15-6f51-4e6b-9572-7b8c808c5708' (search path) (no ~ expansion)...
Reading makefile '15fbf781-49ea-4ff9-a0ad-603ca08e9da0' (search path) (no ~ expansion)...
...
Reading makefile 'd6518c26-be14-4605-b4b3-c93e9a67aaa9' (search path) (no ~ expansion)...
Reading makefile 'e44d38c1-d4e3-49cb-a670-9987b8482617' (search path) (no ~ expansion)...
Reading makefile 'f614189d-cca0-42a0-a678-7a717edc7217' (search path) (no ~ expansion)...
Updating makefiles....
Considering target file 'makefile'.
Considering target file 'e44d38c1-d4e3-49cb-a670-9987b8482617'.
Considering target file '3d6267bc-8e05-4391-8ebb-eb833830f8e9'.
...
Prerequisite '465b8132-26f0-4dc5-b569-9bd3d26ac0e6' is older than target 'f614189d-cca0-42a0-a678-7a717edc7217'.
Prerequisite 'e5a81281-ec22-4f7d-bd23-614836b550b4' is older than target 'f614189d-cca0-42a0-a678-7a717edc7217'.
No need to remake target 'f614189d-cca0-42a0-a678-7a717edc7217'.
Updating goal targets....
Considering target file '9d7c09ae-06ec-484e-8e2a-a3c667ab1b9b'.
Considering target file '08bd2354-5240-4b36-935b-15739fa12a56'.
File '08bd2354-5240-4b36-935b-15739fa12a56' was considered already.
...

These 'makefile update' sections refer to different update-time phases.

A possible solution could be:

  • Tagging makefile-update nodes differently in the graph.
  • Or grouping them visually into a separate cluster/subgraph.

This would make the visualization clearer and distinguish between:

  • Rules that make runs internally to manage Makefile dependencies.
  • The user's actual build dependency graph.

Would this separation fit within the tool's model, or would it require deeper parsing of 'make -p' or trace output?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions