Thread (20 messages) flat view 20 messages, 2 authors, 2020-01-20

Re: [PATCH bpf-next v4 09/10] selftests: Remove tools/lib/bpf from include path

From: Toke Høiland-Jørgensen <hidden>
Date: 2020-01-20 11:06:59
Also in: bpf, linux-kselftest, linux-rdma, lkml

[...]
I really-really didn't like this alternating dependency on directory
or a set of file, depending on current state of those temporary
directories. Then also this ugly check to avoid circular dependency.
All that seemed wrong. So I played a bit with how to achieve the same
differently, and here's what I came up with, which I like a bit
better. What do you think?

$(BPFOBJ): $(wildcard $(BPFDIR)/*.c $(BPFDIR)/*.h $(BPFDIR)/Makefile)          \
           ../../../include/uapi/linux/bpf.h                                   \
           | $(INCLUDE_DIR) $(BUILD_DIR)/libbpf
        $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) OUTPUT=$(BUILD_DIR)/libbpf/ \
                    DESTDIR=$(SCRATCH_DIR) prefix= all install_headers

So, essentially, just make sure that we install local copies of
headers whenever libbpf.a needs to be re-built.
../../../include/uapi/linux/bpf.h ensures we don't miss uapi header
changes as well. Now anything that uses libbpf headers will need to
depend on $(BPFOBJ) and will automatically get up-to-date local copies
of headers.

This seems much simpler. Please give it a try, thanks!
Yes, this is a good idea! It did actually occur to me that the $(BPFOBJ)
rule could just include the install_headers make arg, but only after I
sent out this latest version. Thank you for taking the time to work out
the details, I'll fold this in :)

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