build: export headers with one rule instead of ten - #4452
Conversation
47fd4ae to
d7eac29
Compare
|
@BsAtHome One thing I am unsure about. But #3837 82f05bc left seven empty in the same situation, the six under If deleting is right, those seven can go the same way in a follow-up. |
|
The empty Submakefiles are just leftovers, I guess. They can be retired because they contribute nothing. If one is ever needed again, then we can just create it. While looking at that, I discovered that the libnml.so.0 link depends on liblinuxcnchal.so (in libnml/Submakefile). But I cannot find any link to HAL in the sources. I think that is also something we need to check too. |
|
The link is load bearing, just not for HAL. Four libnml files call So the oddity is packaging: rtapi ships inside the HAL library. All 22 Two ways, your pick. Split rtapi into its own library. 246 of 343 built artefacts reference Or take libnml out of the problem. Four files, eight call sites, all userspace only, where plain Happy either way, and the empty Submakefiles I will retire regardless. |
Every exported header was declared twice, once in SRCHEADERS and once in a per-directory list or a one-off rule carrying the cp. SRCHEADERS is the list, so one rule now copies from it and the ten recipes go. hal/drivers/mesa-hostmot2/Submakefile held nothing but its copy rule, so it goes rather than being left empty, and its SUBDIRS entry with it since SUBDIRS exists only to name the Submakefiles. headersclean empties ../include rather than removing $(HEADERS). A header dropped from SRCHEADERS used to leave its copy behind, and a stale copy is what an angled include resolves to.
d7eac29 to
e98c056
Compare
That is the way to go. I already have a PR in the pipeline (#4457). But it is not as simple as a "plain Removing liblinuxcnchal.so from libnml also exposes an indirect dependency in linuxcnc.so (the Tcl lib) and one pulled in via liblinuxcnc.a. A real messy business... |
@BsAtHome One variable, one rule, as you suggested.
Every exported header was declared twice, once in
SRCHEADERSand once in a per-directory*INCSlist or a one-off rule that carried thecp.SRCHEADERSis already the variable, so one rule copies from it and the ten recipes across eight Submakefiles go.headerscleannow empties../includeinstead of removing$(HEADERS), so a header dropped fromSRCHEADERSstops being exported. It removes*.hand*.hhrather than the directory, sinceinclude/.gitignoreis tracked.hal/drivers/mesa-hostmot2/Submakefileheld nothing but its copy rule, so I deleted it rather than leave an empty file behind, and itsSUBDIRSentry with it sinceSUBDIRSexists only to name the Submakefiles. The build still produceshostmot2.soand still exportshostmot2-serial.h.The single rule also means two headers sharing a basename would collide on one target and make would say so, where before one
cpquietly won. There are none today.Ordering is untouched.
build-software: headers userspace modulesdoes not serialise under-j, but that is no different after this.From a clean tree: configure and build with
--enable-werror, 37 headers ininclude/, a plantedstale.hgone aftermake headerscleanwith.gitignorestill there, andmake headersputting all 37 back.