On Tuesday 2023-04-25 23:11, Jeremy Sowden wrote:
- Don't hard-code pkg-config
- Remove distro-specific default for CFLAGS
- Use pkg-config for LDLIBS
+CFLAGS += $(shell $(HOSTPKG_CONFIG) --cflags libmnl 2>/dev/null) +LDLIBS += $(shell $(HOSTPKG_CONFIG) --libs libmnl 2>/dev/null || echo -lmnl)
Ah yes, this looks better and looks modeled upon selftests/bpf/Makefile. Speaking of which, there's a space missing over there.
tools/testing/selftests/bpf/Makefile:HOSTPKG_CONFIG := pkg-config tools/testing/selftests/bpf/Makefile: $(Q)$(CC) $(shell $(HOSTPKG_CONFIG)--cflags libcrypto 2> /dev/null) \ tools/testing/selftests/bpf/Makefile: $(shell $(HOSTPKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto)