News for hackers. Stuff that matters.
Re:A Tutorial on Portable Makefiles (2017) by p_l on Monday August 01, 2022 @05:46AM (#32303816)
Are you aware that the first step in building linux kernel is literally bootstrapping a custom build system that just happens to generate makefiles (if not just "mostly make compatible" files - I got crosseyed recently trying to find if kbuild didn't try to run them as well)

Linux kernel provides "makefile" as interface for you, but it's mostly compiled from a custom KBuild system.

Re:A Tutorial on Portable Makefiles (2017) by cesarb on Monday August 01, 2022 @01:16PM (#32309191)
AFAIK, the makefile fragment generated by kconfig is nothing more than a set of CONFIG_FOO=y (or =m) statements; everything else is done directly in the makefiles, which have declarations similar to "obj-$(CONFIG_FOO) += foo.o" which become obj-y or obj-m (and so on) depending on the value set by that makefile fragment generated by kconfig. The set of object files to build can then be found in "$(obj-y)" (and so on), which is used as a dependency in a makefile rule to link everything together. The same kconfig also creates a C header file with #define rules for these same CONFIG_ symbols, which is passed to the compiler through a "-include" argument. It's not "mostly compiled from a custom KBuild system", IIRC kbuild is the name given to the whole system, including the makefile rules and macros which do the actual compilation.
Re:A Tutorial on Portable Makefiles (2017) by p_l on Monday August 01, 2022 @02:31PM (#32310260)
Decided to go into the source again, and yes, it's mostly implemented in Makefiles, but they are wildly different from the kind of makefile discussed in the article, with considerable amount of machinery in macros and external C programs (whole "features" thing) to the point that individual makefiles in subdird probably wouldn't parse right if not executed through kbuild wrapper