Joey Armstrong | 28eddda | 2023-01-10 03:09:34 -0500 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # ----------------------------------------------------------------------- |
| 3 | # Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors |
| 4 | # |
| 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 Armstrong | 068d645 | 2023-02-01 11:09:18 -0500 | [diff] [blame] | 18 | ##-------------------## |
| 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 | ## ----------------------------------------------------------------------- |
| 48 | help :: 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 | ## ----------------------------------------------------------------------- |
| 54 | help-banner: |
Joey Armstrong | 28eddda | 2023-01-10 03:09:34 -0500 | [diff] [blame] | 55 | @echo "Usage: $(MAKE) [options] [target] ..." |
Joey Armstrong | 068d645 | 2023-02-01 11:09:18 -0500 | [diff] [blame] | 56 | |
| 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 | ## ----------------------------------------------------------------------- |
| 68 | ifdef VERBOSE |
| 69 | help :: help-verbose |
| 70 | else |
| 71 | help :: help-simple |
| 72 | endif |
| 73 | |
| 74 | ## ----------------------------------------------------------------------- |
| 75 | ## Intent: Display simple extended target help |
| 76 | ## ----------------------------------------------------------------------- |
| 77 | help-simple :: |
Joey Armstrong | 28eddda | 2023-01-10 03:09:34 -0500 | [diff] [blame] | 78 | @echo |
Joey Armstrong | 28eddda | 2023-01-10 03:09:34 -0500 | [diff] [blame] | 79 | @echo '[VIEW]' |
Joey Armstrong | 068d645 | 2023-02-01 11:09:18 -0500 | [diff] [blame] | 80 | @echo ' reload Setup to auto-reload sphinx doc changes in browser' |
| 81 | @echo ' view-html View generated documentation' |
Joey Armstrong | 28eddda | 2023-01-10 03:09:34 -0500 | [diff] [blame] | 82 | @echo |
| 83 | @echo '[TEST]' |
Joey Armstrong | 068d645 | 2023-02-01 11:09:18 -0500 | [diff] [blame] | 84 | @echo " test $(MAKE) lint linkcheck" |
| 85 | @echo " test-all $(MAKE) all-generation-targets" |
Joey Armstrong | 28eddda | 2023-01-10 03:09:34 -0500 | [diff] [blame] | 86 | |
| 87 | # [EOF] |