]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tools: ynl: build archives with $(AR)
authorGreg Thelen <gthelen@google.com>
Mon, 22 Jun 2026 16:16:59 +0000 (09:16 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 Jun 2026 02:22:42 +0000 (19:22 -0700)
Use $(AR) to allow build system to override the archiver tool (e.g.,
when cross-compiling for a different architecture) by setting the AR
environment variable.

GNU Make defaults AR to ar, so this change will not break existing build
environments that do not explicitly set AR.

Fixes: 07c3cc51a085 ("tools: net: package libynl for use in selftests")
Fixes: 86878f14d71a ("tools: ynl: user space helpers")
Signed-off-by: Greg Thelen <gthelen@google.com>
Link: https://patch.msgid.link/20260622161659.145047-1-gthelen@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/Makefile
tools/net/ynl/generated/Makefile
tools/net/ynl/lib/Makefile

index d514a48dae270d284e15aebd95a113241008afd3..3cefe4ed96cb9251d4ae9b44af222b96533f6c2f 100644 (file)
@@ -22,7 +22,7 @@ tests: | lib generated libynl.a
 ynltool: | lib generated libynl.a
 libynl.a: | lib generated
        @echo -e "\tAR $@"
-       @ar rcs $@ lib/ynl.o generated/*-user.o
+       @$(AR) rcs $@ lib/ynl.o generated/*-user.o
 
 $(SUBDIRS):
        @if [ -f "$@/Makefile" ] ; then \
index 86e1e4a959a75146859734f8e859f677ef3a04eb..ea4128f612d6c7d49ce08a56f379a66d80235142 100644 (file)
@@ -37,7 +37,7 @@ all: protos.a $(HDRS) $(SRCS) $(KHDRS) $(KSRCS) $(UAPI) $(RSTS)
 
 protos.a: $(OBJS)
        @echo -e "\tAR $@"
-       @ar rcs $@ $(OBJS)
+       @$(AR) rcs $@ $(OBJS)
 
 %-user.h: $(SPECS_DIR)/%.yaml $(TOOL)
        @echo -e "\tGEN $@"
index 4b2b98704ff9ba78718dec7080548a837a7448de..9b98c0599600034f256063f690e7b5e769b8c61b 100644 (file)
@@ -15,7 +15,7 @@ all: ynl.a
 
 ynl.a: $(OBJS)
        @echo -e "\tAR $@"
-       @ar rcs $@ $(OBJS)
+       @$(AR) rcs $@ $(OBJS)
 
 clean:
        rm -f *.o *.d *~