Re: make -- generate missing include files

David Holland <[email protected]>
Newsgroups gmane.os.netbsd.devel.toolchain
Message-ID <Y2f6DIAbJVN8Q/[email protected]>
On Sun, Nov 06, 2022 at 06:10:34PM +0100, Robert Clausecker wrote:
 > > Is this feature supported by any BSD derived make? At least it doesn't
 > > seem to work on FreeBSD. It looks difficult to implement because
 > > parsing and target execution happen in separate stages ...
 > 
 > The way I believe this is implemented is that when a missing include
 > file is encountered, GNU make stops parsing and pretends the makefile
 > ends right there.  Then, make tries to build the missing include file
 > as a target.  If that succeeds, the parsing process is restarted from
 > the top.  Some logic is added to ensure that each iteration of a
 > missing include makes progress, preventing infinite loops.

Nope, it reads the whole makefile ignoring the missing include. This
is apparently necessary because it's apparently allowed to have the
rule for building the include after the inclusion. Or to have it
depend on things that are after the inclusion.

(And as I noted earlier, it's fairly easy to set up an infinite loop.)

-- 
David A. Holland
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.