Files
linux/tools/net/ynl/Makefile
Jakub Kicinski b02d229013 tools: ynltool: create skeleton for the C command
Based on past discussions it seems like integration of YNL into
iproute2 is unlikely. YNL itself is not great as a C library,
since it has no backward compat (we routinely change types).

Most of the operations can be performed with the generic Python
CLI directly. There is, however, a handful of operations where
summarization of kernel output is very useful (mostly related
to stats: page-pool, qstat).

Create a command (inspired by bpftool, I think it stood the test
of time reasonably well) to be able to plug the subcommands into.

Link: https://lore.kernel.org/1754895902-8790-1-git-send-email-ernis@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20251107162227.980672-2-kuba@kernel.org
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-11-11 12:21:04 +01:00

54 lines
1.2 KiB
Makefile

# SPDX-License-Identifier: GPL-2.0
include ../../scripts/Makefile.arch
INSTALL ?= install
prefix ?= /usr
ifeq ($(LP64), 1)
libdir_relative = lib64
else
libdir_relative = lib
endif
libdir ?= $(prefix)/$(libdir_relative)
includedir ?= $(prefix)/include
SUBDIRS = lib generated samples ynltool
all: $(SUBDIRS) libynl.a
ynltool: | lib generated 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 \
$(MAKE) -C $@ ; \
fi
clean distclean:
@for dir in $(SUBDIRS) ; do \
if [ -f "$$dir/Makefile" ] ; then \
$(MAKE) -C $$dir $@; \
fi \
done
rm -f libynl.a
rm -rf pyynl/__pycache__
rm -rf pyynl/lib/__pycache__
rm -rf pyynl.egg-info
rm -rf build
install: libynl.a lib/*.h
@echo -e "\tINSTALL libynl.a"
@$(INSTALL) -d $(DESTDIR)$(libdir)
@$(INSTALL) -m 0644 libynl.a $(DESTDIR)$(libdir)/libynl.a
@echo -e "\tINSTALL libynl headers"
@$(INSTALL) -d $(DESTDIR)$(includedir)/ynl
@$(INSTALL) -m 0644 lib/*.h $(DESTDIR)$(includedir)/ynl/
@echo -e "\tINSTALL pyynl"
@pip install --prefix=$(DESTDIR)$(prefix) .
@make -C generated install
.PHONY: all clean distclean install $(SUBDIRS)