blob: 0884be3f58d24394330f22dbe10344d57e58c7c1 [file] [log] [blame]
Joey Armstrong0205d332023-04-11 17:29:23 -04001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrong7d51e8a2023-12-09 11:58:42 -05003# Copyright 2017-2024 Open Networking Foundation (ONF) and the ONF Contributors
Joey Armstrong0205d332023-04-11 17:29:23 -04004#
Joey Armstrong78fca2d2024-05-01 16:51:58 -04005# Licensed unde the Apache License, Version 2.0 (the "License");
Joey Armstrong0205d332023-04-11 17:29:23 -04006# 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
Joey Armstrong7ad5c362023-07-09 19:10:16 -040015# limitations under the License.
Joey Armstrong686d3b92023-09-15 17:59:59 -040016# -----------------------------------------------------------------------
Joey Armstrong7d51e8a2023-12-09 11:58:42 -050017# SPDX-FileCopyrightText: 2017-2024 Open Networking Foundation (ONF) and the ONF Contributors
Joey Armstrong7ad5c362023-07-09 19:10:16 -040018# SPDX-License-Identifier: Apache-2.0
19# -----------------------------------------------------------------------
Joey Armstronga6890342023-06-01 17:07:51 -040020
Joey Armstrong0205d332023-04-11 17:29:23 -040021$(if $(DEBUG),$(warning ENTER))
22
Joey Armstronga8205c22023-10-18 13:35:16 -040023##-------------------##
24##---] GLOBALS [---##
25##-------------------##
Joey Armstrong7d51e8a2023-12-09 11:58:42 -050026# DEBUG := 1
27# DEBUG-onf-mk-paths := 1
Joey Armstronga8205c22023-10-18 13:35:16 -040028
Joey Armstrong7ad5c362023-07-09 19:10:16 -040029## -----------------------------------------------------------------------
Joey Armstrong7d51e8a2023-12-09 11:58:42 -050030## [LOADER] Define path vars based on library include directory
Joey Armstrong7ad5c362023-07-09 19:10:16 -040031## -----------------------------------------------------------------------
Joey Armstrong62ae1392024-03-17 20:49:30 -040032sandbox-root := $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
33sandbox-root := $(patsubst %/,%,$(sandbox-root))
34
Joey Armstrong7d51e8a2023-12-09 11:58:42 -050035$(foreach makefile,$(lastword $(MAKEFILE_LIST)),\
36 $(foreach makedir,$(abspath $(dir $(makefile))),\
37 $(eval include $(makedir)/library-makefiles.mk)\
38))
Joey Armstrong0205d332023-04-11 17:29:23 -040039
Joey Armstrong7d51e8a2023-12-09 11:58:42 -050040$(call gen-mk-paths,onf-mk) # [ALSO] $(call gen-mk-include,onf-mk)
41
42## Missing required vars are fatal
43onf-mk-dir ?= $(error onf-mk-dir= is required)
44onf-mk-top ?= $(error onf-mk-top= is required)
Joey Armstronga5325392024-04-02 13:22:12 -040045onf-mk-tmp := $(onf-mk-top)/tmp# # TODO: Replace with lf-mk-tmp
46
47# per-repository paths: mirror repo:onf-make
48local-mk-top := $(onf-mk-top)
49local-mk-dir := $(dir $(onf-mk-dir))local
Joey Armstrong7d51e8a2023-12-09 11:58:42 -050050
51ONF_MAKEDIR := $(onf-mk-dir)# # TODO: Deprecate ONF_MAKEDIR and MAKEDIR
Joey Armstrong0205d332023-04-11 17:29:23 -040052
Joey Armstrongb68145a2024-07-22 15:47:32 -040053##-------------------------##
54##---] CORE INCLUDES [---##
55##-------------------------##
56# no external dependencies.
57# wrap with a guard macro (include-once) to prevent re-sourcing.
58$(call include-once,$(onf-mk-dir)/etc/features.mk)
59
Joey Armstrong78fca2d2024-05-01 16:51:58 -040060##--------------------##
Joey Armstronga8205c22023-10-18 13:35:16 -040061##---] INCLUDES [---##
62##--------------------##
Joey Armstrong78fca2d2024-05-01 16:51:58 -040063include $(onf-mk-dir)/detect/include.mk # Dynamic features based on source
64
Joey Armstronga5325392024-04-02 13:22:12 -040065include $(onf-mk-dir)/lint/make/warn-undef-vars.mk # target lint-make helper
Joey Armstrong216b04b2023-09-29 16:31:19 -040066
Joey Armstronga5325392024-04-02 13:22:12 -040067include $(onf-mk-dir)/consts.mk
68include $(onf-mk-dir)/help/include.mk # render target help
69include $(onf-mk-dir)/utils/include.mk # dependency-less helper macros
70include $(onf-mk-dir)/etc/include.mk # banner macros
71include $(onf-mk-dir)/main/include.mk # tempdir
Joey Armstrong42f4ce62023-06-09 12:56:48 -040072
Joey Armstronga5325392024-04-02 13:22:12 -040073include $(onf-mk-dir)/virtualenv/include.mk# # python, lint, JJB dependency
74# include $(onf-mk-dir)/patches/include.mk# # Patch when python 3.10+ in use
Joey Armstrongdf238722024-03-28 15:57:52 -040075
Joey Armstronga5325392024-04-02 13:22:12 -040076include $(onf-mk-dir)/commands/include.mk # Tools and local installers
Joey Armstrongccab2cf2024-04-06 18:00:59 -040077include $(onf-mk-dir)/npm/include.mk
Joey Armstronga5325392024-04-02 13:22:12 -040078include $(onf-mk-dir)/lint/include.mk
Joey Armstrong0205d332023-04-11 17:29:23 -040079
Joey Armstronga5325392024-04-02 13:22:12 -040080include $(onf-mk-dir)/gerrit/include.mk
81include $(onf-mk-dir)/git/include.mk
82include $(onf-mk-dir)/jjb/include.mk
Joey Armstrong0205d332023-04-11 17:29:23 -040083
Joey Armstrong7ad5c362023-07-09 19:10:16 -040084$(if $(USE-VOLTHA-RELEASE-MK),\
Joey Armstronga5325392024-04-02 13:22:12 -040085 $(eval include $(onf-mk-dir)/release/include.mk))
Joey Armstronga6890342023-06-01 17:07:51 -040086
Joey Armstronga5325392024-04-02 13:22:12 -040087include $(onf-mk-dir)/todo.mk
88include $(onf-mk-dir)/help/variables.mk
Joey Armstrongd26858f2023-07-08 15:52:16 -040089
Joey Armstrong7d51e8a2023-12-09 11:58:42 -050090##------------------------------------##
91##---] Languages & Interpreters [---##
92##------------------------------------##
Joey Armstrongcacdaa02024-02-08 16:40:55 -050093# [TODO] $(if $(golang-mode),$(eval include))
Joey Armstronga5325392024-04-02 13:22:12 -040094include $(onf-mk-dir)/golang/include.mk
Joey Armstrong7d51e8a2023-12-09 11:58:42 -050095
Joey Armstrong7ad5c362023-07-09 19:10:16 -040096##---------------------##
97##---] ON_DEMAND [---##
98##---------------------##
Joey Armstronga5325392024-04-02 13:22:12 -040099$(if $(USE-ONF-GERRIT-MK),$(eval include $(onf-mk-dir)/gerrit/include.mk))
100$(if $(USE-ONF-DOCKER-MK),$(eval include $(onf-mk-dir)/docker/include.mk))
Joey Armstrongd26858f2023-07-08 15:52:16 -0400101
Joey Armstrong7ad5c362023-07-09 19:10:16 -0400102##-------------------##
103##---] TARGETS [---##
104##-------------------##
Joey Armstronga5325392024-04-02 13:22:12 -0400105include $(onf-mk-dir)/targets/include.mk # clean, sterile
Joey Armstrong0205d332023-04-11 17:29:23 -0400106
Joey Armstronga2db6cd2023-11-30 12:16:18 -0500107## Display make help text late
Joey Armstronga5325392024-04-02 13:22:12 -0400108include $(onf-mk-dir)/help/trailer.mk
Joey Armstronga2db6cd2023-11-30 12:16:18 -0500109
Joey Armstrong0205d332023-04-11 17:29:23 -0400110$(if $(DEBUG),$(warning LEAVE))
111
Joey Armstrong62ae1392024-03-17 20:49:30 -0400112## -----------------------------------------------------------------------
113## [VARS]
114## sandbox-root Path to top level directory containing [mM]akefile
115##
116## onf-mk-top Path to makefiles/ containing onf-make/ and local/
117## onf-mk-tmp Limited scratch area for repo:onf-make use
118##
119## [DEPRECATE]
120## ONF_MAKEDIR Replace with onf-mk-top/ {onf-mk}
121## MAKEDIR Replace with onf-mk-top/ {local}
122## -----------------------------------------------------------------------
Joey Armstrong0205d332023-04-11 17:29:23 -0400123# [EOF]