blob: 8421c74f5b645fb8730d8c5561f3f3f3f6bcdf85 [file] [log] [blame]
Joey Armstrong7f8436c2023-07-09 20:23:27 -04001# -*- 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# -----------------------------------------------------------------------
17# https://gerrit.opencord.org/plugins/gitiles/onf-make
18# ONF.makefiles.include.version = 1.1
19# ONF.confg.mk = 1.1
20# -----------------------------------------------------------------------
21
22--repo-name-- := voltha-lib-go
23--repo-name-- ?= $(error --repo-name--= is required)
24
25##--------------------------------##
26##---] Disable lint targets [---##
27##--------------------------------##
28# NO-LINT-DOC8 := true
29# NO-LINT-GOLANG := true
30NO-LINT-GROOVY := true# # Note[1]
31NO-LINT-JJB := true# # Note[2]
32NO-LINT-JSON := true# # Note[1]
33NO-LINT-MAKEFILE := true# # Note[1]
34NO-LINT-REUSE := true # License check
35NO-LINT-ROBOT := true
36NO-LINT-SHELLCHECK := true# # Note[1]
37NO-LINT-YAML := true# # Note[1]
38
39# NO-LINT-PYTHON := true# # Note[1]
40# NO-LINT-PYLINT := true# # Note[1]
41NO-LINT-TOX := true# # Note[1]
42
43# Note[1] - A boatload of source to cleanup prior to enable.
44# Note[2] - No sources available
45
46##---------------------------------##
47##---] Conditional make logic [---##
48##---------------------------------##
49USE-ONF-DOCKER-MK := true
50# USE-ONF-GERRIT-MK := true
51# USE-ONF-GIT-MK := true
52# USE-ONF-JJB-MK := ture
53# USE-VOLTHA-RELEASE-MK := true
54
55##----------------------##
56##---] Debug Mode [---##
57##----------------------##
58# export DEBUG := 1 # makefile debug
59# export DISTUTILS_DEBUG := 1 # verbose: pip
60# export DOCKER_DEBUG := 1 # verbose: docker
61# export VERBOSE := 1 # makefile debug
62
63##-----------------------------------##
64##---] JJB/Jenkins Job Builder [---##
65##-----------------------------------##
66JJB_VERSION ?= 2.8.0
67JOBCONFIG_DIR ?= job-configs
68
69##---------------------------------##
70##---] Filesystem exclusions [---##
71##---------------------------------##
72onf-excl-dirs := $(null) # make clean: dirs=
73onf-excl-dirs += .venv# # $(venv-name)
74onf-excl-dirs += vendor# # golang / voltha*-go
75onf-excl-dirs += patches# # voltha docs - python upgrade
76onf-excl-dirs += .tox # also a python dependency
77
78onf-excl-dirs ?= $(error onf-excl-dirs= is required)
79
80##-----------------------------##
81##---] Feature Detection [---##
82##-----------------------------##
83# [TODO] include makefiles/features/include.mk
84# [TODO] All logic below can migrate there.
85
86$(if $(filter %ci-management,$(--repo-name--)),\
87 $(eval --REPO-IS-CI-MANAGEMENT-- := true)\
88)
89
90# create makefiles/config/byrepo/{--repo-name--}.mk for one-off snowflakes ?
91# $(if $(wildcard docker */Docker*),$(eval USE-ONF-DOCKER-MK := true))
92
93##-------------------------##
94##---] Derived Flags [---##
95##-------------------------##
96ifdef --REPO-IS-CI-MANAGEMENT--
97 USE-ONF-JJB := true
98
99 onf-excl-dirs += global-jjb
100 onf-excl-dirs += lf-ansible
101 onf-excl-dirs += packer
102endif
103
104ifdef NO-LINT-PYTHON
105 NO-LINT-FLAKE8 := true
106 NO-LINT-PYLINT := true
107endif
108
109ifndef USE-ONF-JJB
110 NO-LINT-JJB := true
111endif
112
113# [EOF]