tech-toolchain archive

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

Re: make -- generate missing include files



On Sun, Nov 06, 2022 at 11:18:25AM -0500, Greg Troxel wrote:
 > > This feature is vital to the way the build system works.  For example,
 > > it is used to run a configure script generating further makefile
 > > fragments or to generate missing symbolic links.
 > 
 > 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.

No, it means a make-level include file. In gmake if you do

   include depend.mk

   depend.mk:
           gcc -MM *.c > $@

it will build depend.mk using the recipe indicated. Apparently it then
rereads the makefile from the top.

How it does all this in a principled way given that the recipe for
depend.mk can be written to depend on things that are (sometimes not)
included from it, or what happens if running the recipe touches files
referenced elsewhere, or stuff like that, I don't know. My guess would
be that it just chugs ahead and doesn't worry about such
considerations. It doesn't seem to be hard to create an infinite loop,
anyway.

I doubt schilytools will ever work in bmake anyway; it is...
idiosyncratic.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index