From 203d3c73caa4e8b85b34a7406f6451cd0b60a5ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E6=89=8B=E6=8E=89=E5=8C=85=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E5=B8=88?= Date: Fri, 11 Aug 2023 11:07:56 +0800 Subject: [PATCH] makefile: add help texts (#45988) ref pingcap/tidb#45987 --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index dd0c8d62ae..5751173f9f 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,12 @@ include Makefile.common -.PHONY: all clean test server dev benchkv benchraw check checklist parser tidy ddltest build_br build_lightning build_lightning-ctl build_dumpling ut bazel_build bazel_prepare bazel_test check-file-perm check-bazel-prepare bazel_lint tazel precheck +.PHONY: help all clean test server dev benchkv benchraw check checklist parser tidy ddltest build_br build_lightning build_lightning-ctl build_dumpling ut bazel_build bazel_prepare bazel_test check-file-perm check-bazel-prepare bazel_lint tazel precheck + +# Adapted from https://www.thapaliya.com/en/writings/well-documented-makefiles/ +help: ## Display this help and any documented user-facing targets. Other undocumented targets may be present in the Makefile. +help: + @awk 'BEGIN {FS = ": ##"; printf "Usage:\n make \n\nTargets:\n"} /^[a-zA-Z0-9_\.\-\/%]+: ##/ { printf " %-45s %s\n", $$1, $$2 }' $(MAKEFILE_LIST) default: server buildsucc @@ -448,7 +453,7 @@ bazel_ci_simple_prepare: --run_under="cd $(CURDIR) && " \ //tools/tazel:tazel -bazel_prepare: +bazel_prepare: ## Update and generate BUILD.bazel files. Please run this before commit. bazel run //:gazelle bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro DEPS.bzl%go_deps -build_file_proto_mode=disable -prune bazel run \