mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
07c3cc51a0
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>
26 lines
461 B
Makefile
26 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)
|