From 6045b5c1e409ea5e0aa04cd00132ae32cf6b9d70 Mon Sep 17 00:00:00 2001 From: Nikolay Borisov Date: Thu, 17 Feb 2022 14:04:35 +0200 Subject: [PATCH] bpftool: Allow building statically Sometime it can be useful to haul around a statically built version of bpftool. Simply add support for passing STATIC=1 while building to build the tool statically. Signed-off-by: Nikolay Borisov --- tools/bpf/bpftool/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index a137db96bd56a..a06c02b7fee9f 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -13,6 +13,10 @@ else Q = @ endif +ifeq ($(STATIC),1) + CFLAGS += --static +endif + BPF_DIR = $(srctree)/tools/lib/bpf ifneq ($(OUTPUT),)