[PATCH bpf-next v2] libbpf:Improved usability of the Makefile in libbpf
From: Xin Liu
Date: Fri Dec 02 2022 - 03:19:27 EST
Current libbpf Makefile does not contain the help command, which
is inconvenient to use. Similar to the Makefile help command of the
perf, a help command is provided to list the commands supported by
libbpf make and the functions of the commands.
Signed-off-by: Xin Liu <liuxin350@xxxxxxxxxx>
---
v2: Simplified display. Some unused commands are displayed in the help command.
v1: https://lore.kernel.org/bpf/20221129074235.116969-1-liuxin350@xxxxxxxxxx/
tools/lib/bpf/Makefile | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 4c904ef0b47e..ae523e4cce05 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -286,3 +286,22 @@ tags:
# Delete partially updated (corrupted) files on error
.DELETE_ON_ERROR:
+
+help:
+ @echo 'libbpf default targets:'
+ @echo ' HINT: use "V=1" to enable verbose build'
+ @echo ' all - build librarys and pkgconfig'
+ @echo ''
+ @echo 'libbpf install targets:'
+ @echo ' HINT: use "prefix"(default "/usr/local") or "DESTDIR"(default "/")'
+ @echo ' to install to a particular path like "make prefix=/usr/local install"'
+ @echo ' install - build and install all headers, librarys and pkgconfig'
+ @echo ' install_headers - install only headers to include/bpf'
+ @echo ''
+ @echo 'libbpf make targets:'
+ @echo ' tags - use ctags to make tag information for source browsing'
+ @echo ' cscope - use cscope to make interactive browsing database'
+ @echo ''
+ @echo 'libbpf maintainer targets:'
+ @echo ' clean - remove all generated files'
+ @echo ' check - check abi and version info'
--
2.33.0