public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: joergboe <joergboe@snafu.de>
To: gcc@gcc.gnu.org
Subject: Generation of Make Dependencies for C++ Modules
Date: Mon, 22 Dec 2025 19:11:13 +0100	[thread overview]
Message-ID: <d853112b-d3ce-40f6-9f9e-fa92b295519a@snafu.de> (raw)

Background

For the translation of programs with C++ modules, the use of special 
build systems is necessary.
The dependency information for modules that gcc currently generates in 
the make format
(options -M -MD..) have led to some open error messages (109718, 105467, 
120103)
and do not seem to be a satisfactory solution.
For build systems, module dependencies in JSON format have been introduced.
The following proposal describes the generation of module dependencies 
in make format.
This makes it possible to translate C++ projects with modules using GNU 
Make scripts alone,
similar to classic dependency analysis with make and gcc option -M etc



Proposal

1. (gcc) The current available header dependency information are used as is.
2. (gcc) Add the dependencies on imported modules in form of a variable. 
(CXX_MOD_<module name>_CMI)
3. (gcc) Add information about which source file exports which module in 
form of a list. (CXX_SRC_MOD_IF_LIST)
4. (gcc) A new format in option -fdeps-format activates the module 
dependency information.
With this information provided from gcc the make scrip is able to obtain 
all necessary dependency information.
5. (make script) Add rules for the generation of the dependency files.
6. (make script) Import the generation dependency files.
7. (make script) Walk through the source module list and emit variables 
with the module to CMI file link.
8. (make script) Walk through the source module list and generate the 
rules for the translation of the units with modules
as grouped target rules with the object file and the CMI file as target.
9. (make script) Generate the rules for the remaining non-module sources 
as usual.
10. (make script) Enable secondary expansion for the prerequisites of 
the dependency rules.

You can find a longer description here: 
https://github.com/joergboe/MakeItSimple/discussions/8 (Chapter: The 
Build Process with C++ Modules)


             reply	other threads:[~2025-12-22 18:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-22 18:11 joergboe [this message]
2025-12-23 16:23 ` Ben Boeckel
2025-12-25 18:28   ` joergboe
2025-12-26  3:16     ` Ben Boeckel
2025-12-27  5:50 ` vspefs
2025-12-27 11:24   ` Jose E. Marchesi
2025-12-27 12:01     ` Arsen Arsenović
2025-12-28  4:31     ` vspefs
2025-12-28 14:30       ` Jose E. Marchesi
2025-12-28 21:50         ` Nathaniel Shead
2025-12-29  0:03           ` vspefs
2025-12-29  2:31             ` Ben Boeckel
2025-12-29  6:12               ` vspefs
2025-12-29 16:13                 ` Ben Boeckel
2025-12-30 13:47                   ` vspefs
2025-12-30 16:19                     ` Ben Boeckel
2025-12-30 16:54                     ` Arsen Arsenović
2025-12-29  2:50         ` Ben Boeckel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d853112b-d3ce-40f6-9f9e-fa92b295519a@snafu.de \
    --to=joergboe@snafu.de \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).