Joey Armstrong | e0c1a8d | 2023-04-13 15:16:21 -0400 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # ----------------------------------------------------------------------- |
Joey Armstrong | 88270df | 2024-08-23 11:46:15 -0400 | [diff] [blame] | 3 | # Copyright 2023-2024 Open Networking Foundation Contributors |
Joey Armstrong | e0c1a8d | 2023-04-13 15:16:21 -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 | # |
Joey Armstrong | 88270df | 2024-08-23 11:46:15 -0400 | [diff] [blame] | 9 | # http:#www.apache.org/licenses/LICENSE-2.0 |
Joey Armstrong | e0c1a8d | 2023-04-13 15:16:21 -0400 | [diff] [blame] | 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 | 88270df | 2024-08-23 11:46:15 -0400 | [diff] [blame] | 17 | # SPDX-FileCopyrightText: 2023-2024 Open Networking Foundation Contributors |
| 18 | # SPDX-License-Identifier: Apache-2.0 |
| 19 | # ----------------------------------------------------------------------- |
| 20 | # [NOTE] All of these conditionals and logic can be removed if makefile |
| 21 | # logic transitions from static to dynamic detection (by file extension). |
| 22 | # See detect.mk for an early implementation. |
| 23 | # ----------------------------------------------------------------------- |
| 24 | |
| 25 | --repo-name-- := onf-make |
| 26 | --repo-name-- ?= $(error --repo-name--= is required) |
Joey Armstrong | e0c1a8d | 2023-04-13 15:16:21 -0400 | [diff] [blame] | 27 | |
| 28 | ##--------------------------------## |
| 29 | ##---] Disable lint targets [---## |
| 30 | ##--------------------------------## |
| 31 | NO-LINT-DOC8 := true |
Joey Armstrong | 88270df | 2024-08-23 11:46:15 -0400 | [diff] [blame] | 32 | # USE_DOC8_INI := true |
| 33 | # NO-LINT-GOLANG := true |
| 34 | NO-LINT-GROOVY := true# # Note[1] |
| 35 | NO-LINT-JJB := true# # Note[2] |
| 36 | NO-LINT-JSON := true# # Note[1] |
| 37 | NO-LINT-MAKEFILE := true# # Note[1] |
| 38 | NO-LINT-REUSE := true # License check |
Joey Armstrong | e0c1a8d | 2023-04-13 15:16:21 -0400 | [diff] [blame] | 39 | NO-LINT-ROBOT := true |
Joey Armstrong | 88270df | 2024-08-23 11:46:15 -0400 | [diff] [blame] | 40 | # NO-LINT-SHELL := true# # Note[1] |
| 41 | NO-LINT-YAML := true# # Note[1] |
| 42 | |
| 43 | # NO-LINT-FLAKE8 := true# # Note[1] |
| 44 | NO-LINT-PYTHON := true# # Note[1] |
| 45 | # NO-LINT-PYLINT := true# # Note[1] |
| 46 | |
| 47 | # Note[1] - A boatload of source to cleanup prior to enable. |
| 48 | # Note[2] - No sources available |
| 49 | |
| 50 | ##---------------------------------## |
| 51 | ##---] Conditional make logic [---## |
| 52 | ##---------------------------------## |
| 53 | # USE-ONF-DOCKER-MK := true |
| 54 | # USE-ONF-GERRIT-MK := true |
| 55 | # USE-ONF-GIT-MK := true |
| 56 | # USE-ONF-JJB-MK := true |
| 57 | # USE-VOLTHA-RELEASE-MK := true |
| 58 | |
| 59 | ##----------------------## |
| 60 | ##---] Debug Mode [---## |
| 61 | ##----------------------## |
| 62 | # export DEBUG := 1 # makefile debug |
| 63 | # export DISTUTILS_DEBUG := 1 # verbose: pip |
| 64 | # export DOCKER_DEBUG := 1 # verbose: docker |
| 65 | # export VERBOSE := 1 # makefile debug |
| 66 | |
| 67 | ##-----------------------------------## |
| 68 | ##---] JJB/Jenkins Job Builder [---## |
| 69 | ##-----------------------------------## |
| 70 | JJB_VERSION ?= 2.8.0 |
| 71 | JOBCONFIG_DIR ?= job-configs |
| 72 | |
| 73 | ##---------------------------------## |
| 74 | ##---] Filesystem exclusions [---## |
| 75 | ##---------------------------------## |
| 76 | onf-excl-dirs := $(null) # make clean: dirs= |
| 77 | onf-excl-dirs += lf/onf-make # repo:onf-make git submodule |
| 78 | onf-excl-dirs += .venv# # $(venv-name) |
| 79 | onf-excl-dirs += patches# # voltha docs - python upgrade |
| 80 | onf-excl-dirs += .tmp # |
| 81 | onf-excl-dirs += .tox # also a python dependency |
| 82 | # onf-excl-dirs += vendor# # golang / voltha*-go -- local exclude |
| 83 | |
| 84 | # [NOTE] Add exclusions: lint/doc8/doc8.incl |
| 85 | |
| 86 | ifeq ($(--repo-name--),voltha-docs) |
| 87 | lint-doc8-excl += '_build' # TODO: deprecate |
| 88 | endif |
| 89 | |
| 90 | onf-excl-dirs ?= $(error onf-excl-dirs= is required) |
| 91 | |
| 92 | ##-----------------------------## |
| 93 | ##---] Feature Detection [---## |
| 94 | ##-----------------------------## |
| 95 | # [TODO] include makefiles/features/include.mk |
| 96 | # [TODO] All logic below can migrate there. |
| 97 | |
| 98 | $(if $(filter %ci-management,$(--repo-name--)),\ |
| 99 | $(eval --REPO-IS-CI-MANAGEMENT-- := true)\ |
| 100 | ) |
| 101 | |
| 102 | $(if $(filter %voltha-docs,$(--repo-name--)),\ |
| 103 | $(eval --REPO-IS-VOLTHA-DOCS-- := true)\ |
| 104 | ) |
| 105 | |
| 106 | # create makefiles/config/byrepo/{--repo-name--}.mk for one-off snowflakes ? |
| 107 | # $(if $(wildcard docker),$(eval USE-ONF-DOCKER-MK := true)) |
| 108 | |
| 109 | ##-------------------------## |
| 110 | ##---] Derived Flags [---## |
| 111 | ##-------------------------## |
| 112 | ifdef --REPO-IS-CI-MANAGEMENT-- |
| 113 | USE-ONF-JJB := true |
| 114 | |
| 115 | onf-excl-dirs += global-jjb |
| 116 | onf-excl-dirs += lf-ansible |
| 117 | onf-excl-dirs += packer |
| 118 | endif |
| 119 | |
| 120 | ifdef --REPO-IS-VOLTHA-DOCS-- |
| 121 | onf-excl-dirs += _build |
| 122 | onf-excl-dirs += repos |
| 123 | endif |
| 124 | |
| 125 | ifdef NO-LINT-PYTHON |
| 126 | NO-LINT-FLAKE8 := true |
| 127 | NO-LINT-PYLINT := true |
| 128 | endif |
| 129 | |
| 130 | ifndef USE-ONF-JJB |
| 131 | NO-LINT-JJB := true |
| 132 | endif |
| 133 | |
| 134 | onf-excl-dirs := $(sort $(strip $(onf-excl-dirs))) |
| 135 | |
| 136 | # -------------------------------------------------------------------- |
| 137 | # Repository specific values |
| 138 | # -------------------------------------------------------------------- |
| 139 | # sterile-dirs += archives |
Joey Armstrong | e0c1a8d | 2023-04-13 15:16:21 -0400 | [diff] [blame] | 140 | |
| 141 | # [EOF] |