For example, in GNU Make's dir.c file. There's a lot of stuff like this:
#ifndef _AMIGA
return dir_file_exists_p (".", name);
#else /* !AMIGA */
return dir_file_exists_p ("", name);
#endif /* AMIGA */
There should be a foreseeable date when we can say, "OK the Amiga maintainers have added a feature that lets us use '.' as a directory so we can now delete that #ifdef". But that day is guaranteed to never come, because the Amiga project is disbanded. So should we keep that until the heat death of the universe?I would propose that we instead say, if you use Amiga, there's great support for it in versions of GNU Make up until x.y.z. So if you love old Amigas, you'll be well served using an older version of GNU Make. I think it's straightforward.
There should be a platform adapter API instead that defines a shared header with function names for these actions, multiple platform-specific implementation files, and only one of them gets compiled.
That way you could simply ignore the existence of "filesys_amiga.c", and then maybe delete it 50 years from now.
(I realize it's probably not realistic to do such major internal surgery on Make at this point.)
⸻
1. It works even on somewhat actively developed code since the likely to require porting parts of the program could be clumped together in a web source file and, once isolated, generally saw few if any changes. I remember maintaining the public domain vms change files for the TeX 2–3/MF 1–2 upgrades and as I recall, even with these significant changes to the programs, no updates for the change files were necessary.²
2. Most of the work that I did back then in maintenance was centered around enhancements to the VMS-specific features. For example, rather than having iniTeX be a special executable, instead, iniTeX features could be enabled/disabled at runtime from a single executable.³ Similarly with debug code.
3. This feature appeared soon after in the web2c port of TeX and friends, but I think that Tom Rokicki might have got the idea from me (or else it was a case of great minds thinking alike in the late 80s).
As they say, those who don't know the past, are bound to repeat it.
It’s old software which has far better and faster replacements like Ninja.
The whole design of Make itself is outdated and inefficient which is why tools like Ninja are much faster.
Also, Ninja by itself is not really a replacement for GNU make. Rather it's a tool one can build such a replacement on, so the comparison is a bit off to start with...
Surely there are more options "keep that until the heat death of the universe" and "remove that the moment its platform is out of production". A more practical metric for free/open software, I think, would be "is there still someone maintaining this software on this platform": every major release (e.g., 5.x -> 6.0) could be a time to do a sanity check, documenting ports that don't have an active maintainer as "deprecated". At the next major release, if nobody's stepped up to maintain it, then it gets removed. (One could argue even that's too draconian, because there may be people still using the port even if it's not maintained.)
amigaos had a major new release less than a year ago so i guess the amiga ifdefs should stay
A good example of source code organisation that does a decent job of separating per-platform concerns, is the Nethack code base.