Joey Armstrong | 6540541 | 2022-11-22 10:43:06 -0500 | [diff] [blame] | 1 | # -*- makefile -*- |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 2 | # ----------------------------------------------------------------------- |
Joey Armstrong | 518f357 | 2024-02-11 07:56:25 -0500 | [diff] [blame] | 3 | # Copyright 2022-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 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 | # ----------------------------------------------------------------------- |
Joey Armstrong | 6540541 | 2022-11-22 10:43:06 -0500 | [diff] [blame] | 17 | |
Joey Armstrong | 068d645 | 2023-02-01 11:09:18 -0500 | [diff] [blame] | 18 | .PHONY: help clean help test |
| 19 | .DEFAULT_GOAL := help |
Zack Williams | c2140b9 | 2018-04-05 09:19:22 -0700 | [diff] [blame] | 20 | |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 21 | ##-------------------## |
| 22 | ##---] GLOBALS [---## |
| 23 | ##-------------------## |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 24 | |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 25 | ##--------------------## |
| 26 | ##---] INCLUDES [---## |
| 27 | ##--------------------## |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 28 | include config.mk |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 29 | include makefiles/include.mk |
| 30 | ONF_MAKEDIR ?= $(error ONF_MAKEDIR= is required) |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 31 | |
Joey Armstrong | 2987412 | 2023-09-21 12:34:34 -0400 | [diff] [blame] | 32 | # [TODO] |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 33 | # JJB_VERSION ?= 4.1.0 |
Zack Williams | c2140b9 | 2018-04-05 09:19:22 -0700 | [diff] [blame] | 34 | |
Joey Armstrong | 01bbf8d | 2023-03-05 06:20:14 -0500 | [diff] [blame] | 35 | # ----------------------------------------------------------------------- |
| 36 | # horrible dep: (ie -- .PHONY: $(JOBCONFIG_DIR)) |
| 37 | # o Directory inode always changing due to (time-last-accessed++). |
| 38 | # o Dependent Targets always re-made due to setale dependency. |
| 39 | # o Use file inside directory as dep rather than a directory. |
| 40 | # ----------------------------------------------------------------------- |
Zack Williams | c2140b9 | 2018-04-05 09:19:22 -0700 | [diff] [blame] | 41 | $(JOBCONFIG_DIR): |
| 42 | mkdir $@ |
| 43 | |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 44 | # ----------------------------------------------------------------------- |
| 45 | # Intent: Generate pipeline jobs |
| 46 | # ----------------------------------------------------------------------- |
| 47 | build : jjb-gen |
| 48 | |
Joey Armstrong | 01bbf8d | 2023-03-05 06:20:14 -0500 | [diff] [blame] | 49 | ##-------------------## |
| 50 | ##---] TARGETS [---## |
| 51 | ##-------------------## |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 52 | ## Display make help summary late |
| 53 | include $(ONF_MAKEDIR)/help/trailer.mk |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 54 | |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 55 | # make help not widely in use yet so be explicit |
| 56 | help :: |
Joey Armstrong | f2e312c | 2024-03-01 12:00:05 -0500 | [diff] [blame^] | 57 | |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 58 | @echo |
| 59 | @echo 'Usage: $(MAKE) help ...' |
Joey Armstrong | f2e312c | 2024-03-01 12:00:05 -0500 | [diff] [blame^] | 60 | |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 61 | @echo ' % make clean sterile' |
Joey Armstrong | f2e312c | 2024-03-01 12:00:05 -0500 | [diff] [blame^] | 62 | @printf ' %-33.33s %s\n' 'lint' \ |
| 63 | 'Invoke syntax checking targets' |
| 64 | @printf ' %-33.33s %s\n' 'build' \ |
| 65 | 'Invoke jenkins-jobs to regenerate pipelines' |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 66 | @echo ' % make test' |
| 67 | @echo ' % make help # show all available targes' |
Joey Armstrong | 6540541 | 2022-11-22 10:43:06 -0500 | [diff] [blame] | 68 | |
Joey Armstrong | f2e312c | 2024-03-01 12:00:05 -0500 | [diff] [blame^] | 69 | @echo |
| 70 | @echo '[HELP: modifiers]' |
| 71 | @printf ' %-33.33s %s\n' '{topic}-help' \ |
| 72 | 'Display extended help for individual makefile targets' |
| 73 | @printf ' %-33.33s %s\n' 'help-verbose' \ |
| 74 | 'Display exhaustive help' |
| 75 | |
| 76 | ## ----------------------------------------------------------------------- |
| 77 | ## ----------------------------------------------------------------------- |
| 78 | build-help : |
| 79 | @printf ' %-33.33s %s\n' 'build' \ |
| 80 | 'Alias for $(MAKE) jjb-gen' |
| 81 | @printf ' %-33.33s %s\n' 'jjb-gen' \ |
| 82 | 'Invoke jenkins-jobs to regenerate pipelines' |
| 83 | |
| 84 | ## ----------------------------------------------------------------------- |
| 85 | ## ----------------------------------------------------------------------- |
| 86 | lint-help : |
| 87 | @printf ' %-33.33s %s\n' 'lint' \ |
| 88 | 'Perform syntax checking on configured sources' |
| 89 | @printf ' %-33.33s %s\n' 'lint-jjb' \ |
| 90 | 'Invoke jenkins-jobs to syntax check JJB source' |
| 91 | |
| 92 | ## ----------------------------------------------------------------------- |
| 93 | ## ----------------------------------------------------------------------- |
| 94 | help-verbose :: help $(help-verbose) |
| 95 | |
Joey Armstrong | 6540541 | 2022-11-22 10:43:06 -0500 | [diff] [blame] | 96 | # [EOF] |