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)) |
| 29 | |
| 30 | ##--------------------## |
| 31 | ##---] INCLUDES [---## |
| 32 | ##--------------------## |
| 33 | include $(TOP-docs)/config.mk |
| 34 | include $(TOP-docs)/makefiles/include.mk |
| 35 | |
| 36 | # Minimal makefile for Sphinx documentation |
Matteo Scandolo | 9f61949 | 2019-10-25 13:11:58 -0700 | [diff] [blame] | 37 | |
| 38 | # You can set these variables from the command line. |
| 39 | SPHINXOPTS = |
| 40 | SPHINXBUILD = sphinx-build |
| 41 | SOURCEDIR = source |
| 42 | BUILDDIR = build |
| 43 | |
Zack Williams | 4b0ef4d | 2019-12-18 14:25:20 -0700 | [diff] [blame] | 44 | .PHONY: help Makefile lint |
Matteo Scandolo | 9f61949 | 2019-10-25 13:11:58 -0700 | [diff] [blame] | 45 | |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 46 | ## ----------------------------------------------------------------------- |
| 47 | ## ----------------------------------------------------------------------- |
| 48 | clean :: |
| 49 | $(RM) -r build "$(venv-name)" |
Matteo Scandolo | 9f61949 | 2019-10-25 13:11:58 -0700 | [diff] [blame] | 50 | |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 51 | ## ----------------------------------------------------------------------- |
| 52 | ## Intent: Display target help |
| 53 | ## ----------------------------------------------------------------------- |
| 54 | help :: $(venv-activate-script) |
| 55 | $(activate) \ |
| 56 | && $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
Matteo Scandolo | 9f61949 | 2019-10-25 13:11:58 -0700 | [diff] [blame] | 57 | |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 58 | # ----------------------------------------------------------------------- |
Matteo Scandolo | 9f61949 | 2019-10-25 13:11:58 -0700 | [diff] [blame] | 59 | # Catch-all target: route all unknown targets to Sphinx using the new |
| 60 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 61 | # ----------------------------------------------------------------------- |
| 62 | docs-targets += html |
Zack Williams | 4b0ef4d | 2019-12-18 14:25:20 -0700 | [diff] [blame] | 63 | |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 64 | $(docs-targets) : $(venv-activate-script) Makefile |
| 65 | $(call banner-enter,Target $@) |
| 66 | $(activate) \ |
| 67 | && $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
| 68 | $(call banner-leave,Target $@) |
| 69 | |
| 70 | # [EOF] |