blob: 938dcb5b5bdc7059d920bc9fb4b6fdf67fa72bcd [file] [log] [blame]
Joey Armstrong28eddda2023-01-10 03:09:34 -05001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrong518f3572024-02-11 07:56:25 -05003# Copyright 2017-2024 Open Networking Foundation (ONF) and the ONF Contributors
Joey Armstrong28eddda2023-01-10 03:09:34 -05004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16# -----------------------------------------------------------------------
17
Joey Armstrong068d6452023-02-01 11:09:18 -050018##-------------------##
19##---] GLOBALS [---##
20##-------------------##
21.PHONY: help help-summary help-simple help-verbose
22
23##-------------------##
24##---] TARGETS [---##
25##-------------------##
26
27## -----------------------------------------------------------------------
28## Intent: Render topic/tool based makefile help
29## -----------------------------------------------------------------------
30## Three targets are used to render conditional makefile help
31## help-summary A one-line target summary for the topic
32## help-simple Common targets for the topic (lint-helm, build, test)
33## help-verbose Exhaustive display of supported targets
34## -----------------------------------------------------------------------
35## [COOKBOOK]
36## help colon-colon All 'help' targets are evaluated for 'make help'
37## help-banner Display a usage banner for help
38## help-summary Display all one-line topic summary help
39## [conditonal]
40## help-simple Display all common topic makefile targets.
41## help-verbose Exhaustive display of makefile target help.
42## VERBOSE=
43## -----------------------------------------------------------------------
44## [See Also] makefiles/gerrit/{include.mk, help.mk}
45## help-gerrit Summary targets can always be used to display topic help
46## help-verbose Exhaustive gerrit target display.
47## -----------------------------------------------------------------------
48help :: help-banner help-summary
49
50## -----------------------------------------------------------------------
51## Intent: Display a usage banner for help. Target will be evaluated
52## before all other help display.
53## -----------------------------------------------------------------------
54help-banner:
Joey Armstrong28eddda2023-01-10 03:09:34 -050055 @echo "Usage: $(MAKE) [options] [target] ..."
Joey Armstrong068d6452023-02-01 11:09:18 -050056
57## -----------------------------------------------------------------------
58## Intent: Display extended help.
59## -----------------------------------------------------------------------
60## Question:
61## o Help display can be long based on volume of targets.
62## o Should a 3rd case be added to display:
63## - help-simple (one-liner help) by default
64## - conditional display of extended help:
65## - help-simple or help-verbose
66## o Current logic displays extended help by default.
67## -----------------------------------------------------------------------
Joey Armstrong01bbf8d2023-03-05 06:20:14 -050068## Usage: see makefiles/targets/test.mk
69## test-verbose += help-check# # append help target to help-verbose
70## -----------------------------------------------------------------------
Joey Armstrong068d6452023-02-01 11:09:18 -050071ifdef VERBOSE
Joey Armstrong01bbf8d2023-03-05 06:20:14 -050072 help-verbose += help-verbose
73 help :: $(help-verbose)
Joey Armstrong068d6452023-02-01 11:09:18 -050074else
75 help :: help-simple
76endif
77
78## -----------------------------------------------------------------------
Joey Armstrong01bbf8d2023-03-05 06:20:14 -050079## Intent: Display context specific help for named targets.
80## -----------------------------------------------------------------------
81## [TODO] Display a list of help-* tokens for target specific content:
82## % make help-check
83## % make help-test
84## -----------------------------------------------------------------------
85## [TODO] Define LEVEL= or helper targets (help-lint-{level})
86## for extended help w/o information overload
87## [0] help # make help
88## [1] help-lint # make help-verbose or (VERBOSE=1)
89## [2] help-lint-shell # make help-lint VERBOSE=1 (??)
90## [2] help-lint-yaml
91## -----------------------------------------------------------------------
92help-index ::
93 @echo
94 @echo '[HELP] - An index of help context for common targets'
95 @echo ' help-index This message'
96 $(HIDE)\
97 for name in $(sort $(help-verbose)); do\
98 echo " $$name";\
99 done
100
101## -----------------------------------------------------------------------
Joey Armstrong068d6452023-02-01 11:09:18 -0500102## Intent: Display simple extended target help
103## -----------------------------------------------------------------------
Joey Armstrong01bbf8d2023-03-05 06:20:14 -0500104help-simple :: help-index
Joey Armstrong28eddda2023-01-10 03:09:34 -0500105 @echo
Joey Armstrong28eddda2023-01-10 03:09:34 -0500106 @echo '[VIEW]'
Joey Armstrong068d6452023-02-01 11:09:18 -0500107 @echo ' reload Setup to auto-reload sphinx doc changes in browser'
108 @echo ' view-html View generated documentation'
Joey Armstrong28eddda2023-01-10 03:09:34 -0500109 @echo
110 @echo '[TEST]'
Joey Armstrong068d6452023-02-01 11:09:18 -0500111 @echo " test $(MAKE) lint linkcheck"
112 @echo " test-all $(MAKE) all-generation-targets"
Joey Armstrong28eddda2023-01-10 03:09:34 -0500113
114# [EOF]