blob: 3798d9f2423249522b2efe017b38334578326d93 [file] [log] [blame]
Joey Armstrongee4d8262023-08-22 15:19:19 -04001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrongaadcaa42024-02-01 19:54:17 -05003# Copyright 2023-2024 Open Networking Foundation (ONF) and the ONF Contributors
Joey Armstrongee4d8262023-08-22 15:19:19 -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#
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.6
20# -----------------------------------------------------------------------
21
22--repo-name-- := bbsim-sadis-server
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
30# NO-LINT-GROOVY := true# # Note[1]
31# NO-LINT-MAKEFILE := true# # Note[1]
32# NO-LINT-REUSE := true # License check
33# NO-LINT-SHELLCHECK := true# # Note[1]
34
35# [CONFIG]
36# NO-LINT-JJB := true# # Note[2]
37# NO-LINT-JSON := true# # Note[1]
38# NO-LINT-YAML := true# # Note[1]
39
40# [HELM]
41# NO-LINT-CHART := true
42# NO-LINT-HELM := true
43# NO-LINT-HELMREPO := true # stray dep - repo:cord-charts-repo
44
45# [PYTHON]
46# NO-LINT-FLAKE8 := true# # Note[1]
47# NO-LINT-PYTHON := true# # Note[1]
48# NO-LINT-PYLINT := true# # Note[1]
49
50# [TESTING]
51# NO-LINT-ROBOT := true
52# NO-LINT-TOX := true# # Note[1]
53
54# Note[1] - A boatload of source to cleanup prior to enable.
55# Note[2] - No sources available
56
57##---------------------------------##
58##---] Conditional make logic [---##
59##---------------------------------##
60# USE-ONF-DOCKER-MK := true
61# USE-ONF-GERRIT-MK := true
62# USE-ONF-GIT-MK := true
63# USE-ONF-JJB-MK := true
64# USE-VOLTHA-RELEASE-MK := true
65
66##----------------------##
67##---] Debug Mode [---##
68##----------------------##
69# export DEBUG := 1 # makefile debug
70# export DISTUTILS_DEBUG := 1 # verbose: pip
71# export DOCKER_DEBUG := 1 # verbose: docker
72# export VERBOSE := 1 # makefile debug
73
74##-----------------------------------##
75##---] JJB/Jenkins Job Builder [---##
76##-----------------------------------##
77JJB_VERSION ?= 2.8.0
78JOBCONFIG_DIR ?= job-configs
79
80##---------------------------------##
81##---] Filesystem exclusions [---##
82##---------------------------------##
83onf-excl-dirs := $(null) # make clean: dirs=
84onf-excl-dirs += .venv# # $(venv-name)
85onf-excl-dirs += vendor# # golang / voltha*-go
86onf-excl-dirs += patches# # voltha docs - python upgrade
87onf-excl-dirs += .tox # also a python dependency
88
89ifeq ($(--repo-name--),voltha-docs)
90 lint-doc8-excl += '_build'
91endif
92
93onf-excl-dirs ?= $(error onf-excl-dirs= is required)
94
95##-----------------------------##
96##---] Feature Detection [---##
97##-----------------------------##
98# [TODO] include makefiles/features/include.mk
99# [TODO] All logic below can migrate there.
100
101$(if $(filter %ci-management,$(--repo-name--)),\
102 $(eval --REPO-IS-CI-MANAGEMENT-- := true)\
103)
104$(if $(filter %voltha-docs,$(--repo-name--)),\
105 $(eval --REPO-IS-VOLTHA-DOCS-- := true)\
106)
107
108# create makefiles/config/byrepo/{--repo-name--}.mk for one-off snowflakes ?
109# $(if $(wildcard docker),$(eval USE-ONF-DOCKER-MK := true))
110
111##-------------------------##
112##---] Derived Flags [---##
113##-------------------------##
114ifdef --REPO-IS-CI-MANAGEMENT--
115 USE-ONF-JJB := true
116
117 onf-excl-dirs += global-jjb
118 onf-excl-dirs += lf-ansible
119 onf-excl-dirs += packer
120endif
121
122ifdef --REPO-IS-VOLTHA-DOCS--
123 onf-excl-dirs += _build
124 onf-excl-dirs += repos
125endif
126
127ifdef NO-LINT-PYTHON
128 NO-LINT-FLAKE8 := true
129 NO-LINT-PYLINT := true
130endif
131
132ifndef USE-ONF-JJB
133 NO-LINT-JJB := true
134endif
135
136onf-excl-dirs := $(sort $(strip $(onf-excl-dirs)))
137
138# [TODO]#
139# --------------------------------------------------------------------
140# o two distinct makefiles/ directories are needed, one for onf-make
141# o second for repository specific makefile configs and logic.
142# o Two independent vars specify path:
143# ONF_MAKEDIR = library makefiles
144# MAKEDIR = repository specific content
145# o Conditional repository testing above can crush down all the
146# "if-this-repository-is-X-do-Y' logic above intoL
147# include $(MAKEDIR)/config.mk # repo:$(--repo-name--)
148# --------------------------------------------------------------------
149
150# [EOF]