blob: 91e6f6677c482b66337c037aeebf3a81d3594453 [file] [log] [blame]
Joey Armstrong0205d332023-04-11 17:29:23 -04001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrongdc04c932024-04-01 12:14:21 -04003# Copyright 2023--2024 Open Networking Foundation Contributors
Joey Armstrong0205d332023-04-11 17:29:23 -04004#
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 Armstrongdc04c932024-04-01 12:14:21 -04009# http:#www.apache.org/licenses/LICENSE-2.0
Joey Armstrong0205d332023-04-11 17:29:23 -040010#
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 Armstrongdc04c932024-04-01 12:14:21 -040017# SPDX-FileCopyrightText: 2023--2024 Open Networking Foundation Contributors
18# SPDX-License-Identifier: Apache-2.0
19# -----------------------------------------------------------------------
20# Intent:
Joey Armstrong7ad5c362023-07-09 19:10:16 -040021# -----------------------------------------------------------------------
22
Joey Armstronga8205c22023-10-18 13:35:16 -040023--repo-name-- := onf-make
Joey Armstrong7ad5c362023-07-09 19:10:16 -040024--repo-name-- ?= $(error --repo-name--= is required)
Joey Armstrong0205d332023-04-11 17:29:23 -040025
26##--------------------------------##
27##---] Disable lint targets [---##
28##--------------------------------##
Joey Armstrongf128de82023-09-08 17:05:18 -040029# NO-LINT-DOC8 := true
30# NO-LINT-GOLANG := true
Joey Armstrong7ad5c362023-07-09 19:10:16 -040031# NO-LINT-GROOVY := true# # Note[1]
32# NO-LINT-JJB := true# # Note[2]
33# NO-LINT-JSON := true# # Note[1]
34# NO-LINT-MAKEFILE := true# # Note[1]
35# NO-LINT-REUSE := true # License check
Joey Armstrongf128de82023-09-08 17:05:18 -040036# NO-LINT-ROBOT := true
Joey Armstrong7ad5c362023-07-09 19:10:16 -040037# NO-LINT-SHELL := true# # Note[1]
38# NO-LINT-YAML := true# # Note[1]
Joey Armstrong0205d332023-04-11 17:29:23 -040039
Joey Armstrongf128de82023-09-08 17:05:18 -040040# NO-LINT-FLAKE8 := true# # Note[1]
Joey Armstrong7ad5c362023-07-09 19:10:16 -040041# NO-LINT-PYTHON := true# # Note[1]
42# NO-LINT-PYLINT := true# # Note[1]
Joey Armstrong7ad5c362023-07-09 19:10:16 -040043
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##-----------------------------------##
67JJB_VERSION ?= 2.8.0
68JOBCONFIG_DIR ?= job-configs
69
70##---------------------------------##
71##---] Filesystem exclusions [---##
72##---------------------------------##
73onf-excl-dirs := $(null) # make clean: dirs=
74onf-excl-dirs += .venv# # $(venv-name)
75onf-excl-dirs += vendor# # golang / voltha*-go
76onf-excl-dirs += patches# # voltha docs - python upgrade
77onf-excl-dirs += .tox # also a python dependency
78
Joey Armstrongf128de82023-09-08 17:05:18 -040079ifeq ($(--repo-name--),voltha-docs)
Joey Armstronga8205c22023-10-18 13:35:16 -040080 lint-doc8-excl += '_build' # TODO: deprecate
Joey Armstrongf128de82023-09-08 17:05:18 -040081endif
82
Joey Armstrong7ad5c362023-07-09 19:10:16 -040083onf-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 Armstronga8205c22023-10-18 13:35:16 -040094
Joey Armstrongf128de82023-09-08 17:05:18 -040095$(if $(filter %voltha-docs,$(--repo-name--)),\
96 $(eval --REPO-IS-VOLTHA-DOCS-- := true)\
97)
Joey Armstrong7ad5c362023-07-09 19:10:16 -040098
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##-------------------------##
105ifdef --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
111endif
112
Joey Armstrongf128de82023-09-08 17:05:18 -0400113ifdef --REPO-IS-VOLTHA-DOCS--
114 onf-excl-dirs += _build
115 onf-excl-dirs += repos
116endif
117
Joey Armstrong7ad5c362023-07-09 19:10:16 -0400118ifdef NO-LINT-PYTHON
119 NO-LINT-FLAKE8 := true
120 NO-LINT-PYLINT := true
121endif
122
123ifndef USE-ONF-JJB
124 NO-LINT-JJB := true
125endif
126
127onf-excl-dirs := $(sort $(strip $(onf-excl-dirs)))
Joey Armstronga6890342023-06-01 17:07:51 -0400128
Joey Armstrongf128de82023-09-08 17:05:18 -0400129# --------------------------------------------------------------------
130# Repository specific values
131# --------------------------------------------------------------------
132# sterile-dirs += archives
Joey Armstrong7805bbd2023-07-07 08:37:04 -0400133
Joey Armstrong0205d332023-04-11 17:29:23 -0400134# [EOF]