1 # SPDX-License-Identifier: GPL-2.0
3 # YNL selftest build snippet
7 # YNL_GENS: families we need in the selftests
8 # YNL_PROGS: TEST_PROGS which need YNL (TODO, none exist, yet)
9 # YNL_GEN_FILES: TEST_GEN_FILES which need YNL
11 YNL_OUTPUTS
:= $(patsubst %,$(OUTPUT
)/%,$(YNL_GEN_FILES
))
13 $(patsubst %,$(top_srcdir
)/Documentation
/netlink
/specs
/%.yaml
,$(YNL_GENS
))
15 $(YNL_OUTPUTS
): $(OUTPUT
)/libynl.a
16 $(YNL_OUTPUTS
): CFLAGS
+= \
17 -I
$(top_srcdir
)/usr
/include/ $(KHDR_INCLUDES
) \
18 -I
$(top_srcdir
)/tools
/net
/ynl
/lib
/ \
19 -I
$(top_srcdir
)/tools
/net
/ynl
/generated
/
21 # Make sure we rebuild libynl if user added a new family. We can't easily
22 # depend on the contents of a variable so create a fake file with a hash.
23 YNL_GENS_HASH
:= $(shell echo
$(YNL_GENS
) | sha1sum | cut
-c1-8
)
24 $(OUTPUT
)/.libynl-
$(YNL_GENS_HASH
).sig
:
25 $(Q
)rm -f
$(OUTPUT
)/.libynl-
*.sig
26 $(Q
)touch
$(OUTPUT
)/.libynl-
$(YNL_GENS_HASH
).sig
28 $(OUTPUT
)/libynl.a
: $(YNL_SPECS
) $(OUTPUT
)/.libynl-
$(YNL_GENS_HASH
).sig
29 $(Q
)rm -f
$(top_srcdir
)/tools
/net
/ynl
/libynl.a
30 $(Q
)$(MAKE
) -C
$(top_srcdir
)/tools
/net
/ynl GENS
="$(YNL_GENS)" libynl.a
31 $(Q
)cp
$(top_srcdir
)/tools
/net
/ynl
/libynl.a
$(OUTPUT
)/libynl.a
34 $(top_srcdir
)/tools
/net
/ynl
/lib
/__pycache__ \
35 $(top_srcdir
)/tools
/net
/ynl
/lib
/*.
[ado
] \
36 $(OUTPUT
)/.libynl-
*.sig \