Update repository to use repo:onf-make/makefiles
.gitmodules
Makefile
config.mk -> lf/config.mk
lf/include.mk
lf/local/include.mk
lf/onf-make
makefiles/README.md
-------------------------
o Initial staging to remove per-repository makefiles/ directory.
o Add repo:onf-make as a git submodule.
o lf/include.mk is central access for loading all library logic.
o lf/local/ replaces $(sandbox-root)/makefiles.
*.groovy, *.sh, *.yaml
----------------------
o Include source edits to force pipeline to rebuild.
o Added SPDX copyright notice tokens.
Change-Id: Ia6b95880e720956d01af2c5966f7ae5d0f4c13b1
diff --git a/lf/README.md b/lf/README.md
new file mode 100644
index 0000000..a021181
--- /dev/null
+++ b/lf/README.md
@@ -0,0 +1,15 @@
+Library makefiles
+=================
+
+$(sandbox-root)/include.mk
+ Source this makefile to import library makefile logic.
+
+$(sandbox-root)/lf/onf-maker/
+$(sandbox-root)/lf/onf-maker/include.mk
+ repo:onf-make library makefiles
+ checked out (frozen) as a git submodule.
+
+$(sandbox-root)/lf/local/
+$(sandbox-root)/lf/local/include.mk
+ makefile directory for per-repository targets and logic.
+
diff --git a/lf/config.mk b/lf/config.mk
new file mode 100644
index 0000000..41a8093
--- /dev/null
+++ b/lf/config.mk
@@ -0,0 +1,150 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2023-2024 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -----------------------------------------------------------------------
+# https://gerrit.opencord.org/plugins/gitiles/onf-make
+# ONF.makefiles.include.version = 1.1
+# ONF.confg.mk = 1.5
+# -----------------------------------------------------------------------
+
+--repo-name-- := ci-management
+--repo-name-- ?= $(error --repo-name--= is required)
+
+##--------------------------------##
+##---] Disable lint targets [---##
+##--------------------------------##
+# NO-LINT-DOC8 := true
+# NO-LINT-GOLANG := true
+NO-LINT-GROOVY := true# # Note[1]
+# NO-LINT-JJB := true# # Note[2]
+# NO-LINT-JSON := true# # Note[1]
+NO-LINT-MAKEFILE := true# # Note[1]
+NO-LINT-REUSE := true # License check
+NO-LINT-ROBOT := true
+NO-LINT-SHELL := true# # Note[1]
+# NO-LINT-TOX := true# # Note[1]
+NO-LINT-YAML := true# # Note[1]
+
+# NO-LINT-FLAKE8 := true# # Note[1]
+NO-LINT-PYTHON := true# # Note[1]
+# NO-LINT-PYLINT := true# # Note[1]
+
+# Note[1] - A boatload of source to cleanup prior to enable.
+# Note[2] - No sources available
+
+##---------------------------------##
+##---] Conditional make logic [---##
+##---------------------------------##
+# USE-ONF-DOCKER-MK := true
+# USE-ONF-GERRIT-MK := true
+# USE-ONF-GIT-MK := true
+USE-ONF-JJB-MK := true
+# USE-VOLTHA-RELEASE-MK := true
+
+##----------------------##
+##---] Debug Mode [---##
+##----------------------##
+# export DEBUG := 1 # makefile debug
+# export DISTUTILS_DEBUG := 1 # verbose: pip
+# export DOCKER_DEBUG := 1 # verbose: docker
+# export VERBOSE := 1 # makefile debug
+
+##-----------------------------------##
+##---] JJB/Jenkins Job Builder [---##
+##-----------------------------------##
+JJB_VERSION ?= 3.2.0 # lint-from: jjb/ci-management/ci-management.yaml
+JOBCONFIG_DIR ?= job-configs
+
+##---------------------------------##
+##---] Filesystem exclusions [---##
+##---------------------------------##
+onf-excl-dirs := $(null) # make clean: dirs=
+onf-excl-dirs += .venv# # $(venv-name)
+onf-excl-dirs += vendor# # golang / voltha*-go
+onf-excl-dirs += patches# # voltha docs - python upgrade
+onf-excl-dirs += .tox # also a python dependency
+
+ifeq ($(--repo-name--),voltha-docs)
+ lint-doc8-excl += '_build'
+endif
+
+onf-excl-dirs ?= $(error onf-excl-dirs= is required)
+
+##-----------------------------##
+##---] Feature Detection [---##
+##-----------------------------##
+# [TODO] include makefiles/features/include.mk
+# [TODO] All logic below can migrate there.
+
+$(if $(filter %ci-management,$(--repo-name--)),\
+ $(eval --REPO-IS-CI-MANAGEMENT-- := true)\
+)
+$(if $(filter %voltha-docs,$(--repo-name--)),\
+ $(eval --REPO-IS-VOLTHA-DOCS-- := true)\
+)
+
+# create makefiles/config/byrepo/{--repo-name--}.mk for one-off snowflakes ?
+# $(if $(wildcard docker),$(eval USE-ONF-DOCKER-MK := true))
+
+##-------------------------##
+##---] Derived Flags [---##
+##-------------------------##
+ifdef --REPO-IS-CI-MANAGEMENT--
+ USE-ONF-JJB := true
+
+ onf-excl-dirs += global-jjb
+ onf-excl-dirs += lf-ansible
+ onf-excl-dirs += packer
+endif
+
+ifdef --REPO-IS-VOLTHA-DOCS--
+ onf-excl-dirs += _build
+ onf-excl-dirs += repos
+endif
+
+ifdef NO-LINT-PYTHON
+ NO-LINT-FLAKE8 := true
+ NO-LINT-PYLINT := true
+endif
+
+ifndef USE-ONF-JJB
+ NO-LINT-JJB := true
+endif
+
+onf-excl-dirs := $(sort $(strip $(onf-excl-dirs)))
+
+# --------------------------------------------------------------------
+# Repository specific values
+# --------------------------------------------------------------------
+sterile-dirs += archives
+
+# submodules
+# sterile-dirs += global-jjb
+# sterile-dirs += lf-ansible
+# sterile-dirs += packer
+
+# [TODO]#
+# --------------------------------------------------------------------
+# o two distinct makefiles/ directories are needed, one for onf-make
+# o second for repository specific makefile configs and logic.
+# o Two independent vars specify path:
+# ONF_MAKEDIR = library makefiles
+# MAKEDIR = repository specific content
+# o Conditional repository testing above can crush down all the
+# "if-this-repository-is-X-do-Y' logic above intoL
+# include $(MAKEDIR)/config.mk # repo:$(--repo-name--)
+# --------------------------------------------------------------------
+
+# [EOF]
diff --git a/lf/include.mk b/lf/include.mk
new file mode 100644
index 0000000..7034ea3
--- /dev/null
+++ b/lf/include.mk
@@ -0,0 +1,84 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2023-2024 Open Networking Foundation Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -----------------------------------------------------------------------
+# SPDX-FileCopyrightText: 2023-2024 Open Networking Foundation Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+## -----------------------------------------------------------------------
+## Infer path to cloned sandbox root
+## [TODO] Deprecate TOP=
+## -----------------------------------------------------------------------
+lf-sbx-root := $(abspath $(lastword $(MAKEFILE_LIST)))
+lf-sbx-root := $(subst /lf/include.mk,$(null),$(lf-sbx-root))
+
+## -----------------------------------------------------------------------
+## Define vars based on relative import (normalize symlinks)
+## Usage: include makefiles/onf/include.mk
+## -----------------------------------------------------------------------
+onf-mk-abs := $(abspath $(lastword $(MAKEFILE_LIST)))
+onf-mk-top := $(subst /include.mk,$(null),$(onf-mk-abs))
+onf-mk-lib := $(onf-mk-top)/onf-make/makefiles
+onf-mk-loc := $(onf-mk-top)/local
+
+TOP ?= $(patsubst %/makefiles/include.mk,%,$(onf-mk-abs))
+
+## ------------------------------------------------------
+## Two distinct vars needed to access library or project
+## ------------------------------------------------------
+ONF_MAKEDIR ?= $(onf-mk-lib)
+MAKEDIR ?= $(onf-mk-loc)
+
+# Load per-repository conditionals
+# Load late else alter MAKEFILE_LIST
+include $(lf-sbx-root)/lf/config.mk
+
+## -----------------------------------------------------------------------
+## Load makefiles in order:
+## 1) Library constants and logic loaded first
+## 2) Parameterize and augment targets from local (repo specific)
+## -----------------------------------------------------------------------
+include $(onf-mk-lib)/include.mk
+include $(onf-mk-loc)/include.mk
+
+## -----------------------------------------------------------------------
+## Intent: This target will update dependent git-submodule to the latest
+## version available from the remote repository. Subsequently
+## a checkin will be needed to make the submodule update permanent.
+## -----------------------------------------------------------------------
+update-submodules:
+ git submodule foreach git pull
+
+## -----------------------------------------------------------------------
+## Intent: On-demand cloning of git submodule(s).
+## -----------------------------------------------------------------------
+## Trigger: include $(onf-mk-lib)/include.mk
+## - When the make command attempts to include a makefile from the
+## repo:onf-make submodule, this target/dependency will initialize
+## and checkout all submodules the current repository depends on.
+## -----------------------------------------------------------------------
+$(onf-mk-lib)/include.mk:
+ @echo
+ @echo "** Checkout git submodule(s)"
+ @echo "** -----------------------------------------------------------------------"
+ git submodule update --init --recursive
+ @echo "** -----------------------------------------------------------------------"
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/lf/local/include.mk b/lf/local/include.mk
new file mode 100644
index 0000000..1a9e5b3
--- /dev/null
+++ b/lf/local/include.mk
@@ -0,0 +1,37 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2017-2024 Open Networking Foundation Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -----------------------------------------------------------------------
+# SPDX-FileCopyrightText: 2017-2024 Open Networking Foundation Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
+
+#--------------------##
+##---] INCLUDES [---##
+##--------------------##
+
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/lf/onf-make b/lf/onf-make
new file mode 160000
index 0000000..7ebfb1f
--- /dev/null
+++ b/lf/onf-make
@@ -0,0 +1 @@
+Subproject commit 7ebfb1f38c7461d35bc80ebdb3f8eac6b7e25ac3