On Wed, 24 Dec 2025 at 18:32, Bertho Stultiens <[email protected]> wrote:
> A better alternative is to add two source/object files to the Makefile, > one for V2 and the other for V3 with same internal API. Then use an all > encompassing "#if V2" in one file and "#if v3" in the other. Both will > always be linked, but one will be empty after compile, I think that a problem here is that I want either file to compile into the same HAL component (hal_gpio.so), so that the same HAL config will work on systems with either libgpiod version. The makefile creates compname.so (largely) based on the filename. But it might be possible to tweak that: https://github.com/LinuxCNC/linuxcnc/blob/master/src/Makefile#L1008 Or possibly follow your idea of making one or other file compile to nothing and allocate the "survivor" to the .so / .ko here:[1] https://github.com/LinuxCNC/linuxcnc/blob/master/src/Makefile#L1368 [1] I know that hal_gpio won't be a .ko, but that bit of makefile seems to be where that choice is made. -- atp "A motorcycle is a bicycle with a pandemonium attachment and is designed for the especial use of mechanical geniuses, daredevils and lunatics." — George Fitch, Atlanta Constitution Newspaper, 1912 _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
