Joey Armstrong | b3a0641 | 2023-02-06 09:58:58 -0500 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # ----------------------------------------------------------------------- |
Joey Armstrong | 518f357 | 2024-02-11 07:56:25 -0500 | [diff] [blame] | 3 | # Copyright 2023-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | b3a0641 | 2023-02-06 09:58:58 -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 | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 17 | # https://gerrit.opencord.org/plugins/gitiles/onf-make |
| 18 | # ONF.makefiles.include.version = 1.1 |
Joey Armstrong | 4960ec9 | 2023-07-19 09:04:20 -0400 | [diff] [blame] | 19 | # ONF.confg.mk = 1.5 |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 20 | # ----------------------------------------------------------------------- |
| 21 | |
| 22 | --repo-name-- := ci-management |
| 23 | --repo-name-- ?= $(error --repo-name--= is required) |
Joey Armstrong | b3a0641 | 2023-02-06 09:58:58 -0500 | [diff] [blame] | 24 | |
| 25 | ##--------------------------------## |
| 26 | ##---] Disable lint targets [---## |
| 27 | ##--------------------------------## |
Joey Armstrong | 4960ec9 | 2023-07-19 09:04:20 -0400 | [diff] [blame] | 28 | # NO-LINT-DOC8 := true |
| 29 | # NO-LINT-GOLANG := true |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 30 | NO-LINT-GROOVY := true# # Note[1] |
| 31 | # NO-LINT-JJB := true# # Note[2] |
| 32 | # NO-LINT-JSON := true# # Note[1] |
| 33 | NO-LINT-MAKEFILE := true# # Note[1] |
| 34 | NO-LINT-REUSE := true # License check |
| 35 | NO-LINT-ROBOT := true |
| 36 | NO-LINT-SHELL := true# # Note[1] |
Joey Armstrong | 4960ec9 | 2023-07-19 09:04:20 -0400 | [diff] [blame] | 37 | # NO-LINT-TOX := true# # Note[1] |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 38 | NO-LINT-YAML := true# # Note[1] |
Joey Armstrong | 980e37f | 2023-02-28 18:57:41 -0500 | [diff] [blame] | 39 | |
Joey Armstrong | 4960ec9 | 2023-07-19 09:04:20 -0400 | [diff] [blame] | 40 | # NO-LINT-FLAKE8 := true# # Note[1] |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 41 | NO-LINT-PYTHON := true# # Note[1] |
| 42 | # NO-LINT-PYLINT := true# # Note[1] |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 43 | |
| 44 | # Note[1] - A boatload of source to cleanup prior to enable. |
| 45 | # Note[2] - No sources available |
| 46 | |
| 47 | ##---------------------------------## |
| 48 | ##---] Conditional make logic [---## |
| 49 | ##---------------------------------## |
| 50 | # USE-ONF-DOCKER-MK := true |
| 51 | # USE-ONF-GERRIT-MK := true |
| 52 | # USE-ONF-GIT-MK := true |
| 53 | USE-ONF-JJB-MK := true |
| 54 | # USE-VOLTHA-RELEASE-MK := true |
| 55 | |
| 56 | ##----------------------## |
| 57 | ##---] Debug Mode [---## |
| 58 | ##----------------------## |
| 59 | # export DEBUG := 1 # makefile debug |
| 60 | # export DISTUTILS_DEBUG := 1 # verbose: pip |
| 61 | # export DOCKER_DEBUG := 1 # verbose: docker |
| 62 | # export VERBOSE := 1 # makefile debug |
| 63 | |
| 64 | ##-----------------------------------## |
| 65 | ##---] JJB/Jenkins Job Builder [---## |
| 66 | ##-----------------------------------## |
Joey Armstrong | 2987412 | 2023-09-21 12:34:34 -0400 | [diff] [blame] | 67 | JJB_VERSION ?= 3.2.0 # lint-from: jjb/ci-management/ci-management.yaml |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 68 | JOBCONFIG_DIR ?= job-configs |
| 69 | |
| 70 | ##---------------------------------## |
| 71 | ##---] Filesystem exclusions [---## |
| 72 | ##---------------------------------## |
| 73 | onf-excl-dirs := $(null) # make clean: dirs= |
| 74 | onf-excl-dirs += .venv# # $(venv-name) |
| 75 | onf-excl-dirs += vendor# # golang / voltha*-go |
| 76 | onf-excl-dirs += patches# # voltha docs - python upgrade |
| 77 | onf-excl-dirs += .tox # also a python dependency |
| 78 | |
Joey Armstrong | 4960ec9 | 2023-07-19 09:04:20 -0400 | [diff] [blame] | 79 | ifeq ($(--repo-name--),voltha-docs) |
| 80 | lint-doc8-excl += '_build' |
| 81 | endif |
| 82 | |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 83 | onf-excl-dirs ?= $(error onf-excl-dirs= is required) |
| 84 | |
| 85 | ##-----------------------------## |
| 86 | ##---] Feature Detection [---## |
| 87 | ##-----------------------------## |
| 88 | # [TODO] include makefiles/features/include.mk |
| 89 | # [TODO] All logic below can migrate there. |
| 90 | |
| 91 | $(if $(filter %ci-management,$(--repo-name--)),\ |
| 92 | $(eval --REPO-IS-CI-MANAGEMENT-- := true)\ |
| 93 | ) |
Joey Armstrong | 4960ec9 | 2023-07-19 09:04:20 -0400 | [diff] [blame] | 94 | $(if $(filter %voltha-docs,$(--repo-name--)),\ |
| 95 | $(eval --REPO-IS-VOLTHA-DOCS-- := true)\ |
| 96 | ) |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 97 | |
| 98 | # create makefiles/config/byrepo/{--repo-name--}.mk for one-off snowflakes ? |
| 99 | # $(if $(wildcard docker),$(eval USE-ONF-DOCKER-MK := true)) |
| 100 | |
| 101 | ##-------------------------## |
| 102 | ##---] Derived Flags [---## |
| 103 | ##-------------------------## |
| 104 | ifdef --REPO-IS-CI-MANAGEMENT-- |
| 105 | USE-ONF-JJB := true |
| 106 | |
| 107 | onf-excl-dirs += global-jjb |
| 108 | onf-excl-dirs += lf-ansible |
| 109 | onf-excl-dirs += packer |
| 110 | endif |
| 111 | |
Joey Armstrong | 4960ec9 | 2023-07-19 09:04:20 -0400 | [diff] [blame] | 112 | ifdef --REPO-IS-VOLTHA-DOCS-- |
| 113 | onf-excl-dirs += _build |
| 114 | onf-excl-dirs += repos |
| 115 | endif |
| 116 | |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 117 | ifdef NO-LINT-PYTHON |
| 118 | NO-LINT-FLAKE8 := true |
| 119 | NO-LINT-PYLINT := true |
| 120 | endif |
| 121 | |
| 122 | ifndef USE-ONF-JJB |
| 123 | NO-LINT-JJB := true |
| 124 | endif |
| 125 | |
| 126 | onf-excl-dirs := $(sort $(strip $(onf-excl-dirs))) |
Joey Armstrong | b3a0641 | 2023-02-06 09:58:58 -0500 | [diff] [blame] | 127 | |
Joey Armstrong | 7ba23ac | 2023-08-29 15:21:53 -0400 | [diff] [blame] | 128 | # -------------------------------------------------------------------- |
| 129 | # Repository specific values |
| 130 | # -------------------------------------------------------------------- |
| 131 | sterile-dirs += archives |
| 132 | |
| 133 | # submodules |
| 134 | # sterile-dirs += global-jjb |
| 135 | # sterile-dirs += lf-ansible |
| 136 | # sterile-dirs += packer |
| 137 | |
Joey Armstrong | 4960ec9 | 2023-07-19 09:04:20 -0400 | [diff] [blame] | 138 | # [TODO]# |
| 139 | # -------------------------------------------------------------------- |
| 140 | # o two distinct makefiles/ directories are needed, one for onf-make |
| 141 | # o second for repository specific makefile configs and logic. |
| 142 | # o Two independent vars specify path: |
| 143 | # ONF_MAKEDIR = library makefiles |
| 144 | # MAKEDIR = repository specific content |
| 145 | # o Conditional repository testing above can crush down all the |
| 146 | # "if-this-repository-is-X-do-Y' logic above intoL |
| 147 | # include $(MAKEDIR)/config.mk # repo:$(--repo-name--) |
| 148 | # -------------------------------------------------------------------- |
| 149 | |
Joey Armstrong | b3a0641 | 2023-02-06 09:58:58 -0500 | [diff] [blame] | 150 | # [EOF] |