blob: 0d4fa08aa65c4bc1bfbf85c686dbe2c8ca63b313 [file] [log] [blame]
Joey Armstrong0205d332023-04-11 17:29:23 -04001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrongdc04c932024-04-01 12:14:21 -04003# Copyright 2017-2024 Open Networking Foundation Contributors
Joey Armstrong0205d332023-04-11 17:29:23 -04004#
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#
Joey Armstrongdc04c932024-04-01 12:14:21 -04009# http:#www.apache.org/licenses/LICENSE-2.0
Joey Armstrong0205d332023-04-11 17:29:23 -040010#
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# -----------------------------------------------------------------------
Joey Armstrongdc04c932024-04-01 12:14:21 -040017# SPDX-FileCopyrightText: 2017-2024 Open Networking Foundation Contributors
18# SPDX-License-Identifier: Apache-2.0
19# -----------------------------------------------------------------------
20# Intent:
21# -----------------------------------------------------------------------
Joey Armstrong0205d332023-04-11 17:29:23 -040022
23##-------------------##
24##---] GLOBALS [---##
25##-------------------##
26.PHONY: help help-summary help-simple help-verbose
27
28##-------------------##
29##---] TARGETS [---##
30##-------------------##
31
32## -----------------------------------------------------------------------
33## Intent: Render topic/tool based makefile help
34## -----------------------------------------------------------------------
35## Three targets are used to render conditional makefile help
36## help-summary A one-line target summary for the topic
37## help-simple Common targets for the topic (lint-helm, build, test)
38## help-verbose Exhaustive display of supported targets
39## -----------------------------------------------------------------------
40## [COOKBOOK]
41## help colon-colon All 'help' targets are evaluated for 'make help'
42## help-banner Display a usage banner for help
43## help-summary Display all one-line topic summary help
44## [conditonal]
45## help-simple Display all common topic makefile targets.
46## help-verbose Exhaustive display of makefile target help.
47## VERBOSE=
48## -----------------------------------------------------------------------
49## [See Also] makefiles/gerrit/{include.mk, help.mk}
50## help-gerrit Summary targets can always be used to display topic help
51## help-verbose Exhaustive gerrit target display.
52## -----------------------------------------------------------------------
53help :: help-banner help-summary
54
55## -----------------------------------------------------------------------
56## Intent: Display a usage banner for help. Target will be evaluated
57## before all other help display.
58## -----------------------------------------------------------------------
59help-banner:
60 @echo "Usage: $(MAKE) [options] [target] ..."
61
62## -----------------------------------------------------------------------
63## Intent: Display extended help.
64## -----------------------------------------------------------------------
65## Question:
66## o Help display can be long based on volume of targets.
67## o Should a 3rd case be added to display:
68## - help-simple (one-liner help) by default
69## - conditional display of extended help:
70## - help-simple or help-verbose
71## o Current logic displays extended help by default.
72## -----------------------------------------------------------------------
73## Usage: see makefiles/targets/test.mk
74## test-verbose += help-check# # append help target to help-verbose
75## -----------------------------------------------------------------------
76ifdef VERBOSE
77 help-verbose += help-verbose
78 help :: $(help-verbose)
79else
80 help :: help-simple
81endif
82
83## -----------------------------------------------------------------------
84## Intent: Display context specific help for named targets.
85## -----------------------------------------------------------------------
86## [TODO] Display a list of help-* tokens for target specific content:
87## % make help-check
88## % make help-test
89## -----------------------------------------------------------------------
90## [TODO] Define LEVEL= or helper targets (help-lint-{level})
91## for extended help w/o information overload
92## [0] help # make help
93## [1] help-lint # make help-verbose or (VERBOSE=1)
94## [2] help-lint-shell # make help-lint VERBOSE=1 (??)
95## [2] help-lint-yaml
96## -----------------------------------------------------------------------
97help-index ::
98 @echo
99 @echo '[HELP] - An index of help context for common targets'
100 @echo ' help-index This message'
101 $(HIDE)\
102 for name in $(sort $(help-verbose)); do\
103 echo " $$name";\
104 done
105
106## -----------------------------------------------------------------------
107## Intent: Display simple extended target help
108## -----------------------------------------------------------------------
109help-simple :: help-index
110 @echo
111 @echo '[VIEW]'
112 @echo ' reload Setup to auto-reload sphinx doc changes in browser'
113 @echo ' view-html View generated documentation'
114 @echo
115 @echo '[TEST]'
116 @echo " test $(MAKE) lint linkcheck"
117 @echo " test-all $(MAKE) all-generation-targets"
118
119# [EOF]