Re: make -- generate missing include files

Tobias Nygren <[email protected]>
Newsgroups gmane.os.netbsd.devel.toolchain
Message-ID <[email protected]>
On Sun, 06 Nov 2022 11:18:25 -0500
Greg Troxel <[email protected]> wrote:

> What does "include file is not found" mean?   Do you mean "foo.h is a
> dependency of bar.c, but foo.h does not exist, and there is no rule to
> make foo.h?"   If so, why aren't there rules?  If not, please clarify.

The feature that is suggested is to make this work:

---8<---
on-the-fly.mk:
	printf ".PHONY: greet\ngreet:\n\t@echo Hello, world\n" > $@

.include "on-the-fly.mk"
---8<---
$ make greet

This works with GNU make if you change the include line to
"include on-the-fly.mk".

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 ...

Kind regards,
-Tobias
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.