From patchwork Tue Nov 29 07:42:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Liu X-Patchwork-Id: 13058298 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 175B7C4332F for ; Tue, 29 Nov 2022 07:42:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229847AbiK2Hmt (ORCPT ); Tue, 29 Nov 2022 02:42:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbiK2Hmt (ORCPT ); Tue, 29 Nov 2022 02:42:49 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 052491FF87; Mon, 28 Nov 2022 23:42:41 -0800 (PST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NLvMy1HqCznV3Q; Tue, 29 Nov 2022 15:38:38 +0800 (CST) Received: from dggpeml500010.china.huawei.com (7.185.36.155) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 29 Nov 2022 15:42:39 +0800 Received: from huawei.com (10.175.101.6) by dggpeml500010.china.huawei.com (7.185.36.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 29 Nov 2022 15:42:38 +0800 From: Xin Liu To: , , , , , , , , , , CC: , , , , , , , Subject: [PATCH] Improved usability of the Makefile in libbpf Date: Tue, 29 Nov 2022 15:42:35 +0800 Message-ID: <20221129074235.116969-1-liuxin350@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500010.china.huawei.com (7.185.36.155) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Current libbpf Makefile does not contain the help command, which is inconvenient to use. A help command is provided to list the commands supported by libbpf make and the functions of the commands. Signed-off-by: Xin Liu --- tools/lib/bpf/Makefile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index 4c904ef0b47e..c86e05df4711 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -286,3 +286,37 @@ tags: # Delete partially updated (corrupted) files on error .DELETE_ON_ERROR: + +help: + @echo 'Default targets:' + @echo ' all - Run all_cmd' + @echo ' all_cmd - Build library and pkgconfig, check abi and version info' + @echo '' + @echo 'Cleaning targets:' + @echo ' clean - Remove all generated files' + @echo '' + @echo 'Build targets:' + @echo ' libbpf.so - Build the dynamic library' + @echo ' libbpf.a - Build the static library' + @echo ' libbpf.pc - Build the pkgconfig file' + @echo '' + @echo 'Install targets:' + @echo ' install - Install all headers, library and pkgconfig file to' + @echo ' DESTDIR(default: /) with prefix(default: /usr/local)' + @echo ' install_lib - Install only library' + @echo ' install_headers - Install only headers' + @echo ' install_pkgconfig - Install only pkgconfig file' + @echo '' + @echo 'Other generic targets:' + @echo ' cscope - Generate cscope index' + @echo ' tags - Generate tags file for editors' + @echo ' check - Check abi and version info' + @echo ' check_abi - Check versioned symbols' + @echo ' check_version - Check whether the libbpf version defined in libbpf_version.h' + @echo ' is the same as that defined in libbpf.map' + @echo '' + @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' + @echo ' make DESTDIR=/root [install targets] use DESTDIR for installing' + @echo ' into a different root directory' + @echo ' make prefix=/path [install targets] use prefix for installing' + @echo ' into a user defined prefix path'