@@ -50,10 +50,12 @@ ifeq ($(TRIVIAL_BUILD),no)
5050-include $(patsubst %.comp, objects/%.mak, $(COMPS) $(COMP_DRIVERS))
5151Makefile: $(patsubst %.comp, objects/%.mak, $(COMPS) $(COMP_DRIVERS))
5252endif
53- endif
54-
55- obj-m += $(patsubst hal/drivers/%.comp, %.o, $(patsubst hal/components/%.comp, %.o, $(COMPS) $(COMP_DRIVERS)))
5653
54+ # Manpage generation is a top-level (non-kbuild) concern. Keep it inside
55+ # the KERNELRELEASE else branch: in the kbuild pass COMPS is rebuilt from a
56+ # wildcard that mixes hal/components and hal/drivers, so deriving the adoc
57+ # targets from it there yields hal/drivers/*.comp entries that fail the
58+ # hal/components/%.comp static pattern rule.
5759COMP_MANPAGE_ADOCS := $(patsubst hal/components/%.comp, objects/man/man9/%.9.adoc, $(COMPS)) objects/man/man9/tpcomp.9.adoc objects/man/man9/homecomp.9.adoc
5860COMP_DRIVER_MANPAGE_ADOCS := $(patsubst hal/drivers/%.comp, objects/man/man9/%.9.adoc, $(COMP_DRIVERS))
5961
@@ -86,6 +88,9 @@ $(COMP_MANPAGES) $(COMP_DRIVER_MANPAGES): ../docs/build/man/man9/%.9: objects/ma
8688 -a mansource=LinuxCNC \
8789 -a manmanual='LinuxCNC Documentation' \
8890 $<
91+ endif
92+
93+ obj-m += $(patsubst hal/drivers/%.comp, %.o, $(patsubst hal/components/%.comp, %.o, $(COMPS) $(COMP_DRIVERS)))
8994
9095objects/%.mak: %.comp hal/components/Submakefile
9196 $(ECHO) "Creating $(notdir $@)"
0 commit comments