On Tuesday 2023-04-25 23:11, Jeremy Sowden wrote: >1. Don't hard-code pkg-config >2. Remove distro-specific default for CFLAGS >3. 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)