Joey Armstrong | f320860 | 2023-06-03 15:12:23 -0400 | [diff] [blame] | 1 | # -*- makefile -*- |
| 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 | f320860 | 2023-06-03 15:12:23 -0400 | [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 | # ----------------------------------------------------------------------- |
| 17 | # Intent: Helper makefile target used to setup for a release |
| 18 | # ----------------------------------------------------------------------- |
| 19 | |
| 20 | $(if $(DEBUG),$(warning ENTER)) |
| 21 | |
| 22 | ##-------------------## |
| 23 | ##---] GLOBALS [---## |
| 24 | ##-------------------## |
| 25 | jjb-gen-dir := build |
Joey Armstrong | 095f5a2 | 2023-08-18 17:46:18 -0400 | [diff] [blame] | 26 | # JJB_DEBUG := true |
Joey Armstrong | f320860 | 2023-06-03 15:12:23 -0400 | [diff] [blame] | 27 | |
| 28 | ##-------------------## |
| 29 | ##---] TARGETS [---## |
| 30 | ##-------------------## |
| 31 | all: help |
| 32 | |
| 33 | ## ----------------------------------------------------------------------- |
| 34 | ## Intent: Generate pipeline jobs |
| 35 | ## ----------------------------------------------------------------------- |
| 36 | .PHONY: jjb-gen |
| 37 | |
Joey Armstrong | 095f5a2 | 2023-08-18 17:46:18 -0400 | [diff] [blame] | 38 | jjb-gen-args := $(null) |
| 39 | $(if $(JJB_DEBUG),$(eval jjb-gen-args += --log_level DEBUG)) |
| 40 | |
Joey Armstrong | f320860 | 2023-06-03 15:12:23 -0400 | [diff] [blame] | 41 | jjb-gen-log := $(jjb-gen-dir)/jjb-gen.log |
Joey Armstrong | cb89660 | 2023-07-21 16:38:42 -0400 | [diff] [blame] | 42 | jjb-gen: $(venv-activate-script) |
Joey Armstrong | 095f5a2 | 2023-08-18 17:46:18 -0400 | [diff] [blame] | 43 | |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 44 | $(call banner-enter,Target $@) |
Joey Armstrong | f320860 | 2023-06-03 15:12:23 -0400 | [diff] [blame] | 45 | @mkdir -p $(jjb-gen-dir) |
Joey Armstrong | f320860 | 2023-06-03 15:12:23 -0400 | [diff] [blame] | 46 | @touch "$(jjb-gen-dir)/.sentinel" |
Joey Armstrong | cb89660 | 2023-07-21 16:38:42 -0400 | [diff] [blame] | 47 | ( \ |
| 48 | $(activate) \ |
Joey Armstrong | 095f5a2 | 2023-08-18 17:46:18 -0400 | [diff] [blame] | 49 | && jenkins-jobs $(jjb-gen-args) test $(PWD)/jjb -o $(jjb-gen-dir) 3>&1 2>&1 \ |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 50 | ) | tee "$(jjb-gen-log)" |
Joey Armstrong | f320860 | 2023-06-03 15:12:23 -0400 | [diff] [blame] | 51 | |
| 52 | ifdef LOGS |
| 53 | -@less "$(jjb-gen-log)" |
| 54 | endif |
| 55 | |
| 56 | ifdef VERBOSE |
| 57 | @echo |
| 58 | @echo "** Display generated pipelines" |
| 59 | find "$(jjb-gen-dir)" -newer "$(jjb-gen-dir)/.sentinel" -ls |
| 60 | endif |
| 61 | |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 62 | $(call banner-leave,Target $@) |
| 63 | |
Joey Armstrong | f320860 | 2023-06-03 15:12:23 -0400 | [diff] [blame] | 64 | ## ----------------------------------------------------------------------- |
| 65 | ## ----------------------------------------------------------------------- |
| 66 | sterile :: |
| 67 | $(RM) -r $(jjb-gen-dir) |
| 68 | |
| 69 | $(if $(DEBUG),$(warning LEAVE)) |
| 70 | |
| 71 | # [EOF] |