On Thu, 21 Aug 2025 at 11:46, Paul Smith <psm...@gnu.org> wrote: > On Thu, 2025-08-21 at 10:50 -0700, Bahman Movaqar wrote: > > I wonder if we could modularise the OS support into separate loadable > > libraries (i.e. os-support-addon) and would it be worth the effort:
> And, what's the use? A GNU Make binary built on Linux can only run on > Linux, so why force the "Linux-specific" bits into a shared library? That's a valid point, yes. Scratch the idea of a loadable library! > However, providing a more-or-less OS-agnostic API that had multiple > implementations, which can be chosen at configure time and linked > statically to avoid a lot of C preprocessor manipulation would be very > nice. That would be great! - Isolating compile and runtime failures to specific modules - check. - Respects power-users' desire to configure and tune - check. - Enforces cohesion and reduces coupling - check. > A few steps in this direction have been made, in the last few releases. > But, the reality is that GNU Make has a surprising amount of OS- > specific code and it's not so simple to create such an interface. There > are a LOT of areas where 90% of it is common to all OS's, but the last > 10% needs to be custom... and it's not the same 10% for each OS. So, > you either have a lot of #ifdefs, or you have a lot of code > duplication. I am very much intrigued by this challenge. So much that I actually just cloned the Git repository :-D -- Bahman Movaqar (he/him) https://linktr.ee/bahmanm