Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # ----------------------------------------------------------------------- |
Joey Armstrong | 2c03936 | 2024-02-04 18:51:52 -0500 | [diff] [blame] | 3 | # Copyright 2017-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 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 | # ----------------------------------------------------------------------- |
Zack Williams | 4b0ef4d | 2019-12-18 14:25:20 -0700 | [diff] [blame] | 17 | |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 18 | $(if $(DEBUG),$(warning ENTER)) |
| 19 | |
| 20 | ##-------------------## |
| 21 | ##---] GLOBALS [---## |
| 22 | ##-------------------## |
| 23 | TOP-docs ?=$(strip \ |
| 24 | $(dir \ |
| 25 | $(abspath $(lastword $(MAKEFILE_LIST)))\ |
| 26 | )\ |
| 27 | ) |
| 28 | TOP-docs := $(subst /docs/,$(null),$(TOP-docs)) |
Joey Armstrong | 30bfd39 | 2024-04-10 16:10:06 -0400 | [diff] [blame^] | 29 | legacy-mk ?= $(TOP-docs)/makefiles |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 30 | |
| 31 | ##--------------------## |
| 32 | ##---] INCLUDES [---## |
| 33 | ##--------------------## |
| 34 | include $(TOP-docs)/config.mk |
| 35 | include $(TOP-docs)/makefiles/include.mk |
| 36 | |
| 37 | # Minimal makefile for Sphinx documentation |
Matteo Scandolo | 9f61949 | 2019-10-25 13:11:58 -0700 | [diff] [blame] | 38 | |
| 39 | # You can set these variables from the command line. |
| 40 | SPHINXOPTS = |
| 41 | SPHINXBUILD = sphinx-build |
| 42 | SOURCEDIR = source |
| 43 | BUILDDIR = build |
| 44 | |
Zack Williams | 4b0ef4d | 2019-12-18 14:25:20 -0700 | [diff] [blame] | 45 | .PHONY: help Makefile lint |
Matteo Scandolo | 9f61949 | 2019-10-25 13:11:58 -0700 | [diff] [blame] | 46 | |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 47 | ## ----------------------------------------------------------------------- |
| 48 | ## ----------------------------------------------------------------------- |
| 49 | clean :: |
Joey Armstrong | feeefe8 | 2024-04-10 15:58:40 -0400 | [diff] [blame] | 50 | $(RM) -r "$(venv-name)" |
| 51 | # $(RM) -r build "$(venv-name)" |
Matteo Scandolo | 9f61949 | 2019-10-25 13:11:58 -0700 | [diff] [blame] | 52 | |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 53 | ## ----------------------------------------------------------------------- |
| 54 | ## Intent: Display target help |
| 55 | ## ----------------------------------------------------------------------- |
| 56 | help :: $(venv-activate-script) |
| 57 | $(activate) \ |
| 58 | && $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
Matteo Scandolo | 9f61949 | 2019-10-25 13:11:58 -0700 | [diff] [blame] | 59 | |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 60 | # ----------------------------------------------------------------------- |
Matteo Scandolo | 9f61949 | 2019-10-25 13:11:58 -0700 | [diff] [blame] | 61 | # Catch-all target: route all unknown targets to Sphinx using the new |
| 62 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 63 | # ----------------------------------------------------------------------- |
| 64 | docs-targets += html |
Zack Williams | 4b0ef4d | 2019-12-18 14:25:20 -0700 | [diff] [blame] | 65 | |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 66 | $(docs-targets) : $(venv-activate-script) Makefile |
| 67 | $(call banner-enter,Target $@) |
| 68 | $(activate) \ |
| 69 | && $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
| 70 | $(call banner-leave,Target $@) |
| 71 | |
| 72 | # [EOF] |