xref: /linux/tools/net/ynl/Makefile (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1# SPDX-License-Identifier: GPL-2.0
2
3SUBDIRS = lib generated samples
4
5all: $(SUBDIRS) libynl.a
6
7samples: | lib generated
8libynl.a: | lib generated
9	@echo -e "\tAR $@"
10	@ar rcs $@ lib/ynl.o generated/*-user.o
11
12$(SUBDIRS):
13	@if [ -f "$@/Makefile" ] ; then \
14		$(MAKE) -C $@ ; \
15	fi
16
17clean distclean:
18	@for dir in $(SUBDIRS) ; do \
19		if [ -f "$$dir/Makefile" ] ; then \
20			$(MAKE) -C $$dir $@; \
21		fi \
22	done
23	rm -f libynl.a
24
25.PHONY: all clean distclean $(SUBDIRS)
26