Joey Armstrong | 4de98b7 | 2023-02-09 14:51:38 -0500 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # ----------------------------------------------------------------------- |
| 3 | # Copyright 2023 Open Networking Foundation (ONF) and the ONF Contributors |
| 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 | 449ce7a | 2023-07-18 18:32:24 -0400 | [diff] [blame] | 17 | # https://gerrit.opencord.org/plugins/gitiles/onf-make |
| 18 | # ONF.makefiles.include.version = 1.1 |
| 19 | # ONF.confg.mk = 1.5 |
| 20 | # ----------------------------------------------------------------------- |
Joey Armstrong | 4de98b7 | 2023-02-09 14:51:38 -0500 | [diff] [blame] | 21 | |
Joey Armstrong | 449ce7a | 2023-07-18 18:32:24 -0400 | [diff] [blame] | 22 | --repo-name-- := voltha-docs |
| 23 | --repo-name-- ?= $(error --repo-name--= is required) |
Joey Armstrong | 4de98b7 | 2023-02-09 14:51:38 -0500 | [diff] [blame] | 24 | |
Joey Armstrong | 449ce7a | 2023-07-18 18:32:24 -0400 | [diff] [blame] | 25 | ##--------------------------------## |
| 26 | ##---] Disable lint targets [---## |
| 27 | ##--------------------------------## |
| 28 | # NO-LINT-DOC8 := true |
| 29 | # NO-LINT-GOLANG := true |
| 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] |
| 37 | # NO-LINT-TOX := true# # Note[1] |
| 38 | NO-LINT-YAML := true# # Note[1] |
| 39 | |
| 40 | NO-LINT-FLAKE8 := true# # Note[1] |
| 41 | # NO-LINT-PYTHON := true# # Note[1] |
| 42 | NO-LINT-PYLINT := true# # Note[1] |
| 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 | ##-----------------------------------## |
| 67 | JJB_VERSION ?= 2.8.0 |
| 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 | |
| 79 | ifeq ($(--repo-name--),voltha-docs) |
| 80 | lint-doc8-excl += '_build' # generated |
| 81 | # lint-groovy-excl += 'bbsim' # external repo |
| 82 | endif |
| 83 | |
| 84 | onf-excl-dirs ?= $(error onf-excl-dirs= is required) |
Joey Armstrong | 4de98b7 | 2023-02-09 14:51:38 -0500 | [diff] [blame] | 85 | |
| 86 | ##-----------------------------## |
Joey Armstrong | 449ce7a | 2023-07-18 18:32:24 -0400 | [diff] [blame] | 87 | ##---] Feature Detection [---## |
Joey Armstrong | 4de98b7 | 2023-02-09 14:51:38 -0500 | [diff] [blame] | 88 | ##-----------------------------## |
Joey Armstrong | 449ce7a | 2023-07-18 18:32:24 -0400 | [diff] [blame] | 89 | # [TODO] include makefiles/features/include.mk |
| 90 | # [TODO] All logic below can migrate there. |
Joey Armstrong | 4de98b7 | 2023-02-09 14:51:38 -0500 | [diff] [blame] | 91 | |
Joey Armstrong | 449ce7a | 2023-07-18 18:32:24 -0400 | [diff] [blame] | 92 | $(if $(filter %ci-management,$(--repo-name--)),\ |
| 93 | $(eval --REPO-IS-CI-MANAGEMENT-- := true)\ |
| 94 | ) |
| 95 | $(if $(filter %voltha-docs,$(--repo-name--)),\ |
| 96 | $(eval --REPO-IS-VOLTHA-DOCS-- := true)\ |
| 97 | ) |
| 98 | |
| 99 | # create makefiles/config/byrepo/{--repo-name--}.mk for one-off snowflakes ? |
| 100 | # $(if $(wildcard docker),$(eval USE-ONF-DOCKER-MK := true)) |
| 101 | |
| 102 | ##-------------------------## |
| 103 | ##---] Derived Flags [---## |
| 104 | ##-------------------------## |
| 105 | ifdef --REPO-IS-CI-MANAGEMENT-- |
| 106 | USE-ONF-JJB := true |
| 107 | |
| 108 | onf-excl-dirs += global-jjb |
| 109 | onf-excl-dirs += lf-ansible |
| 110 | onf-excl-dirs += packer |
| 111 | endif |
| 112 | |
| 113 | ifdef --REPO-IS-VOLTHA-DOCS-- |
| 114 | onf-excl-dirs += _build |
| 115 | onf-excl-dirs += repos |
| 116 | endif |
| 117 | |
| 118 | ifdef NO-LINT-PYTHON |
| 119 | NO-LINT-FLAKE8 := true |
| 120 | NO-LINT-PYLINT := true |
| 121 | endif |
| 122 | |
| 123 | ifndef USE-ONF-JJB |
| 124 | NO-LINT-JJB := true |
| 125 | endif |
| 126 | |
| 127 | onf-excl-dirs := $(sort $(strip $(onf-excl-dirs))) |
| 128 | |
| 129 | # [TODO]# |
| 130 | # -------------------------------------------------------------------- |
| 131 | # o two distinct makefiles directories are needed, one for onf-make |
| 132 | # o second for repository specific configs and logic. |
| 133 | # o Two independent vars specify path: |
| 134 | # ONF_MAKEDIR = library makefiles |
| 135 | # MAKEDIR = repository specific content |
| 136 | # o Conditional repository testing above can crush down into |
| 137 | # include $(MAKEDIR)/config.mk # repo:$(--repo-name--) |
| 138 | # -------------------------------------------------------------------- |
Joey Armstrong | 4de98b7 | 2023-02-09 14:51:38 -0500 | [diff] [blame] | 139 | |
| 140 | # [EOF] |