summaryrefslogtreecommitdiff
path: root/tools/net
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-06-28 00:32:50 +0000
committerJakub Kicinski <kuba@kernel.org>2024-07-02 18:59:33 -0700
commit07c3cc51a0853986af0fc52d0544b1b67b391ea8 (patch)
tree79e9ad9c5d7d6b20615bd7c36719a96c0e9de179 /tools/net
parent4dec64c52e24c2c9a15f81c115f1be5ea35121cb (diff)
tools: net: package libynl for use in selftests
Support building the C YNL userspace library into one big static file. We can then link selftests against it for easy to use C netlink interface. Signed-off-by: Mina Almasry <almasrymina@google.com> Link: https://patch.msgid.link/20240628003253.1694510-14-almasrymina@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/net')
-rw-r--r--tools/net/ynl/Makefile6
-rw-r--r--tools/net/ynl/lib/Makefile4
2 files changed, 8 insertions, 2 deletions
diff --git a/tools/net/ynl/Makefile b/tools/net/ynl/Makefile
index 8e9e09d84e26..d1cdf2a8f826 100644
--- a/tools/net/ynl/Makefile
+++ b/tools/net/ynl/Makefile
@@ -2,9 +2,12 @@
SUBDIRS = lib generated samples
-all: $(SUBDIRS)
+all: $(SUBDIRS) libynl.a
samples: | lib generated
+libynl.a: | lib generated
+ @echo -e "\tAR $@"
+ @ar rcs $@ lib/ynl.o generated/*-user.o
$(SUBDIRS):
@if [ -f "$@/Makefile" ] ; then \
@@ -17,5 +20,6 @@ clean distclean:
$(MAKE) -C $$dir $@; \
fi \
done
+ rm -f libynl.a
.PHONY: all clean distclean $(SUBDIRS)
diff --git a/tools/net/ynl/lib/Makefile b/tools/net/ynl/lib/Makefile
index dfff3ecd1cba..2887cc5de530 100644
--- a/tools/net/ynl/lib/Makefile
+++ b/tools/net/ynl/lib/Makefile
@@ -14,7 +14,9 @@ include $(wildcard *.d)
all: ynl.a
ynl.a: $(OBJS)
- ar rcs $@ $(OBJS)
+ @echo -e "\tAR $@"
+ @ar rcs $@ $(OBJS)
+
clean:
rm -f *.o *.d *~
rm -rf __pycache__