tech-toolchain archive

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

Re: make -- generate missing include files



Hi Greg,

Am Sun, Nov 06, 2022 at 11:18:25AM -0500 schrieb Greg Troxel:
> 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.

"include file" as in "makefile fragment included through a include or
similar directive."  For example, our distribution comes without a bunch
of symlinks needed to build it (as some platforms do not support symlinks),
so the makefile has content like this to generate the symbolic links if
needed:

    dummy.lnk:
            @echo MAKING SYMLINKS
            $(SH) MKLINKS

    include dummy.lnk

Various symlinks point to Makefile fragments later included to generate
rules and configuration.  We combine this with a make feature where a
catch-all rule can be defined to execute if no rule matches the target,
allowing us to automatically generate missing bits of configuration for
platforms the build system does not explicitly support:

    .INCLUDE_FAILED:
            @echo Generating missing include file $^
            $(SH) conf/makeinc $^

    include $(ARCH)-$(OS)-$(COMPILER_TYPE).rul

This mechanism permits the build system to automatically adapt itself
to whatever target platform it is built for.  Apart from our own smake,
it is also supported by SunPro make and GNU make.

Yours,
Robert Clausecker

> From the pkgsrc viewpoint, using gmake as a build tool is not a big
> deal.  Many things do, so it gets built anyway on most systems.  I feel
> that avoiding a gmake tool depends for schilytools is not a tremendous
> gain, compared to the effort, possible architectural issues, and future
> maintenance involved in adding a feature (that I am pretty sure is not
> mandated by POSIX) into bmake.

This is not specifically about pkgsrc, but rather about making it easier
to build schilytools in general.  We ship a "bootstrap smake" that can
be used to build the project if not sufficiently powerful make is
present, but it would be much nicer if that was not needed on the many
platforms that use bmake.

Yours,
Robert Clausecker

-- 
()  ascii ribbon campaign - for an 8-bit clean world 
/\  - against html email  - against proprietary attachments



Home | Main Index | Thread Index | Old Index