kernel-hacking-2024-linux-s.../tools/net/ynl/Makefile
Jakub Kicinski 07c3cc51a0 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>
2024-07-02 18:59:33 -07:00

25 lines
461 B
Makefile

# SPDX-License-Identifier: GPL-2.0
SUBDIRS = lib generated samples
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 \
$(MAKE) -C $@ ; \
fi
clean distclean:
@for dir in $(SUBDIRS) ; do \
if [ -f "$$dir/Makefile" ] ; then \
$(MAKE) -C $$dir $@; \
fi \
done
rm -f libynl.a
.PHONY: all clean distclean $(SUBDIRS)