Thread (3 messages) 3 messages, 2 authors, 2026-09-10

Re: [PATCH net-next] tools: ynl: Fix out-of-tree build for ynltool

flat view

From: Bobby Eshleman <hidden>
Date: 2026-09-10 21:16:45
Also in: linux-kselftest, lkml

On Thu, Sep 10, 2026 at 11:12:24PM +0200, Maxime Chevallier wrote:
Hi Bobby,

On 9/10/26 19:10, Bobby Eshleman wrote:
quoted
On Wed, Sep 09, 2026 at 09:11:54AM +0200, Maxime Chevallier (Netdev Foundation) wrote:
quoted
After the blamed commit, running a out-of-tree build for ynltool fails :

  # make -C tools/net/ynl/ynltool O=/tmp/o1
  make: Entering directory 'tools/net/ynl/ynltool'
  make: *** No rule to make target '/tmp/o1/json_writer.o', needed by '/tmp/o1/ynltool'.  Stop.

ynltool's Makefile correctly accounts for $(OUTPUT) to get the list of
object files to generate :

OBJS := $(patsubst %.c,$(OUTPUT)%.o,$(SRCS))

but it never actually set $(OUTPUT) before the blamed commit, meaning
that out-of-tree buils of ynltool were always actually in-tree.

Now, the O= parameter is correctly accounted for, and the %o: %c rule fails.

Let's update the %o: %c rule to also use $(OUTPUT).

Reported-by: Bobby Eshleman <redacted>
Closes: https://lore.kernel.org/all/aqCyWQxqKDuQnZYR@devvm29614.prn0.facebook.com/ (local)
Fixes: 917f713b4ec4 ("tools: ynl: Allow cross-compiling ynl and associated tools")
Signed-off-by: Maxime Chevallier (Netdev Foundation) <maxime.chevallier@bootlin.com>
[...]
quoted
Reviewed-by: Bobby Eshleman <redacted>
Thanks :)

Nicolai noted that there's another improvement to be made, as we don't
account for modifications made to .h files. The diff would be :

-include $(wildcard *.d)
+include $(wildcard $(OUTPUT)*.d)

See [1].

May I keep your review tag if I add the above diff in v2 ?

Thanks,

Maxime
Yes, np, feel free to carry it forward!

Best,
Bobby
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help