Joey Armstrong | 0205d33 | 2023-04-11 17:29:23 -0400 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # ----------------------------------------------------------------------- |
Joey Armstrong | 7d51e8a | 2023-12-09 11:58:42 -0500 | [diff] [blame] | 3 | # Copyright 2017-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | 0205d33 | 2023-04-11 17:29:23 -0400 | [diff] [blame] | 4 | # |
Joey Armstrong | 78fca2d | 2024-05-01 16:51:58 -0400 | [diff] [blame] | 5 | # Licensed unde the Apache License, Version 2.0 (the "License"); |
Joey Armstrong | 0205d33 | 2023-04-11 17:29:23 -0400 | [diff] [blame] | 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 |
Joey Armstrong | 7ad5c36 | 2023-07-09 19:10:16 -0400 | [diff] [blame] | 15 | # limitations under the License. |
Joey Armstrong | 686d3b9 | 2023-09-15 17:59:59 -0400 | [diff] [blame] | 16 | # ----------------------------------------------------------------------- |
Joey Armstrong | 7d51e8a | 2023-12-09 11:58:42 -0500 | [diff] [blame] | 17 | # SPDX-FileCopyrightText: 2017-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | 7ad5c36 | 2023-07-09 19:10:16 -0400 | [diff] [blame] | 18 | # SPDX-License-Identifier: Apache-2.0 |
| 19 | # ----------------------------------------------------------------------- |
Joey Armstrong | a689034 | 2023-06-01 17:07:51 -0400 | [diff] [blame] | 20 | |
Joey Armstrong | 0205d33 | 2023-04-11 17:29:23 -0400 | [diff] [blame] | 21 | $(if $(DEBUG),$(warning ENTER)) |
| 22 | |
Joey Armstrong | a8205c2 | 2023-10-18 13:35:16 -0400 | [diff] [blame] | 23 | ##-------------------## |
| 24 | ##---] GLOBALS [---## |
| 25 | ##-------------------## |
Joey Armstrong | 7d51e8a | 2023-12-09 11:58:42 -0500 | [diff] [blame] | 26 | # DEBUG := 1 |
| 27 | # DEBUG-onf-mk-paths := 1 |
Joey Armstrong | a8205c2 | 2023-10-18 13:35:16 -0400 | [diff] [blame] | 28 | |
Joey Armstrong | 7ad5c36 | 2023-07-09 19:10:16 -0400 | [diff] [blame] | 29 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 7d51e8a | 2023-12-09 11:58:42 -0500 | [diff] [blame] | 30 | ## [LOADER] Define path vars based on library include directory |
Joey Armstrong | 7ad5c36 | 2023-07-09 19:10:16 -0400 | [diff] [blame] | 31 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 62ae139 | 2024-03-17 20:49:30 -0400 | [diff] [blame] | 32 | sandbox-root := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) |
| 33 | sandbox-root := $(patsubst %/,%,$(sandbox-root)) |
| 34 | |
Joey Armstrong | 7d51e8a | 2023-12-09 11:58:42 -0500 | [diff] [blame] | 35 | $(foreach makefile,$(lastword $(MAKEFILE_LIST)),\ |
| 36 | $(foreach makedir,$(abspath $(dir $(makefile))),\ |
| 37 | $(eval include $(makedir)/library-makefiles.mk)\ |
| 38 | )) |
Joey Armstrong | 0205d33 | 2023-04-11 17:29:23 -0400 | [diff] [blame] | 39 | |
Joey Armstrong | 7d51e8a | 2023-12-09 11:58:42 -0500 | [diff] [blame] | 40 | $(call gen-mk-paths,onf-mk) # [ALSO] $(call gen-mk-include,onf-mk) |
| 41 | |
| 42 | ## Missing required vars are fatal |
| 43 | onf-mk-dir ?= $(error onf-mk-dir= is required) |
| 44 | onf-mk-top ?= $(error onf-mk-top= is required) |
Joey Armstrong | a532539 | 2024-04-02 13:22:12 -0400 | [diff] [blame] | 45 | onf-mk-tmp := $(onf-mk-top)/tmp# # TODO: Replace with lf-mk-tmp |
| 46 | |
| 47 | # per-repository paths: mirror repo:onf-make |
| 48 | local-mk-top := $(onf-mk-top) |
| 49 | local-mk-dir := $(dir $(onf-mk-dir))local |
Joey Armstrong | 7d51e8a | 2023-12-09 11:58:42 -0500 | [diff] [blame] | 50 | |
| 51 | ONF_MAKEDIR := $(onf-mk-dir)# # TODO: Deprecate ONF_MAKEDIR and MAKEDIR |
Joey Armstrong | 0205d33 | 2023-04-11 17:29:23 -0400 | [diff] [blame] | 52 | |
Joey Armstrong | b68145a | 2024-07-22 15:47:32 -0400 | [diff] [blame] | 53 | ##-------------------------## |
| 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 Armstrong | 78fca2d | 2024-05-01 16:51:58 -0400 | [diff] [blame] | 60 | ##--------------------## |
Joey Armstrong | a8205c2 | 2023-10-18 13:35:16 -0400 | [diff] [blame] | 61 | ##---] INCLUDES [---## |
| 62 | ##--------------------## |
Joey Armstrong | 78fca2d | 2024-05-01 16:51:58 -0400 | [diff] [blame] | 63 | include $(onf-mk-dir)/detect/include.mk # Dynamic features based on source |
| 64 | |
Joey Armstrong | a532539 | 2024-04-02 13:22:12 -0400 | [diff] [blame] | 65 | include $(onf-mk-dir)/lint/make/warn-undef-vars.mk # target lint-make helper |
Joey Armstrong | 216b04b | 2023-09-29 16:31:19 -0400 | [diff] [blame] | 66 | |
Joey Armstrong | a532539 | 2024-04-02 13:22:12 -0400 | [diff] [blame] | 67 | include $(onf-mk-dir)/consts.mk |
| 68 | include $(onf-mk-dir)/help/include.mk # render target help |
| 69 | include $(onf-mk-dir)/utils/include.mk # dependency-less helper macros |
| 70 | include $(onf-mk-dir)/etc/include.mk # banner macros |
| 71 | include $(onf-mk-dir)/main/include.mk # tempdir |
Joey Armstrong | 42f4ce6 | 2023-06-09 12:56:48 -0400 | [diff] [blame] | 72 | |
Joey Armstrong | a532539 | 2024-04-02 13:22:12 -0400 | [diff] [blame] | 73 | include $(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 Armstrong | df23872 | 2024-03-28 15:57:52 -0400 | [diff] [blame] | 75 | |
Joey Armstrong | a532539 | 2024-04-02 13:22:12 -0400 | [diff] [blame] | 76 | include $(onf-mk-dir)/commands/include.mk # Tools and local installers |
Joey Armstrong | ccab2cf | 2024-04-06 18:00:59 -0400 | [diff] [blame] | 77 | include $(onf-mk-dir)/npm/include.mk |
Joey Armstrong | a532539 | 2024-04-02 13:22:12 -0400 | [diff] [blame] | 78 | include $(onf-mk-dir)/lint/include.mk |
Joey Armstrong | 0205d33 | 2023-04-11 17:29:23 -0400 | [diff] [blame] | 79 | |
Joey Armstrong | a532539 | 2024-04-02 13:22:12 -0400 | [diff] [blame] | 80 | include $(onf-mk-dir)/gerrit/include.mk |
| 81 | include $(onf-mk-dir)/git/include.mk |
| 82 | include $(onf-mk-dir)/jjb/include.mk |
Joey Armstrong | 0205d33 | 2023-04-11 17:29:23 -0400 | [diff] [blame] | 83 | |
Joey Armstrong | 7ad5c36 | 2023-07-09 19:10:16 -0400 | [diff] [blame] | 84 | $(if $(USE-VOLTHA-RELEASE-MK),\ |
Joey Armstrong | a532539 | 2024-04-02 13:22:12 -0400 | [diff] [blame] | 85 | $(eval include $(onf-mk-dir)/release/include.mk)) |
Joey Armstrong | a689034 | 2023-06-01 17:07:51 -0400 | [diff] [blame] | 86 | |
Joey Armstrong | a532539 | 2024-04-02 13:22:12 -0400 | [diff] [blame] | 87 | include $(onf-mk-dir)/todo.mk |
| 88 | include $(onf-mk-dir)/help/variables.mk |
Joey Armstrong | d26858f | 2023-07-08 15:52:16 -0400 | [diff] [blame] | 89 | |
Joey Armstrong | 7d51e8a | 2023-12-09 11:58:42 -0500 | [diff] [blame] | 90 | ##------------------------------------## |
| 91 | ##---] Languages & Interpreters [---## |
| 92 | ##------------------------------------## |
Joey Armstrong | cacdaa0 | 2024-02-08 16:40:55 -0500 | [diff] [blame] | 93 | # [TODO] $(if $(golang-mode),$(eval include)) |
Joey Armstrong | a532539 | 2024-04-02 13:22:12 -0400 | [diff] [blame] | 94 | include $(onf-mk-dir)/golang/include.mk |
Joey Armstrong | 7d51e8a | 2023-12-09 11:58:42 -0500 | [diff] [blame] | 95 | |
Joey Armstrong | 7ad5c36 | 2023-07-09 19:10:16 -0400 | [diff] [blame] | 96 | ##---------------------## |
| 97 | ##---] ON_DEMAND [---## |
| 98 | ##---------------------## |
Joey Armstrong | a532539 | 2024-04-02 13:22:12 -0400 | [diff] [blame] | 99 | $(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 Armstrong | d26858f | 2023-07-08 15:52:16 -0400 | [diff] [blame] | 101 | |
Joey Armstrong | 7ad5c36 | 2023-07-09 19:10:16 -0400 | [diff] [blame] | 102 | ##-------------------## |
| 103 | ##---] TARGETS [---## |
| 104 | ##-------------------## |
Joey Armstrong | a532539 | 2024-04-02 13:22:12 -0400 | [diff] [blame] | 105 | include $(onf-mk-dir)/targets/include.mk # clean, sterile |
Joey Armstrong | 0205d33 | 2023-04-11 17:29:23 -0400 | [diff] [blame] | 106 | |
Joey Armstrong | a2db6cd | 2023-11-30 12:16:18 -0500 | [diff] [blame] | 107 | ## Display make help text late |
Joey Armstrong | a532539 | 2024-04-02 13:22:12 -0400 | [diff] [blame] | 108 | include $(onf-mk-dir)/help/trailer.mk |
Joey Armstrong | a2db6cd | 2023-11-30 12:16:18 -0500 | [diff] [blame] | 109 | |
Joey Armstrong | 0205d33 | 2023-04-11 17:29:23 -0400 | [diff] [blame] | 110 | $(if $(DEBUG),$(warning LEAVE)) |
| 111 | |
Joey Armstrong | 62ae139 | 2024-03-17 20:49:30 -0400 | [diff] [blame] | 112 | ## ----------------------------------------------------------------------- |
| 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 Armstrong | 0205d33 | 2023-04-11 17:29:23 -0400 | [diff] [blame] | 123 | # [EOF] |