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