blob: bd8194d90d1d76bea4b2b78dae963da2427d1e1f [file] [log] [blame]
Joey Armstrong96bcf1b2023-06-27 14:49:40 -04001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrong2c039362024-02-04 18:51:52 -05003# Copyright 2017-2024 Open Networking Foundation (ONF) and the ONF Contributors
Joey Armstrong96bcf1b2023-06-27 14:49:40 -04004#
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 Williams4b0ef4d2019-12-18 14:25:20 -070017
Joey Armstrong96bcf1b2023-06-27 14:49:40 -040018$(if $(DEBUG),$(warning ENTER))
19
20##-------------------##
21##---] GLOBALS [---##
22##-------------------##
23TOP-docs ?=$(strip \
24 $(dir \
25 $(abspath $(lastword $(MAKEFILE_LIST)))\
26 )\
27)
28TOP-docs := $(subst /docs/,$(null),$(TOP-docs))
Joey Armstrong30bfd392024-04-10 16:10:06 -040029legacy-mk ?= $(TOP-docs)/makefiles
Joey Armstrong96bcf1b2023-06-27 14:49:40 -040030
31##--------------------##
32##---] INCLUDES [---##
33##--------------------##
34include $(TOP-docs)/config.mk
35include $(TOP-docs)/makefiles/include.mk
36
37# Minimal makefile for Sphinx documentation
Matteo Scandolo9f619492019-10-25 13:11:58 -070038
39# You can set these variables from the command line.
40SPHINXOPTS =
41SPHINXBUILD = sphinx-build
42SOURCEDIR = source
43BUILDDIR = build
44
Zack Williams4b0ef4d2019-12-18 14:25:20 -070045.PHONY: help Makefile lint
Matteo Scandolo9f619492019-10-25 13:11:58 -070046
Joey Armstrong96bcf1b2023-06-27 14:49:40 -040047## -----------------------------------------------------------------------
48## -----------------------------------------------------------------------
49clean ::
Joey Armstrongfeeefe82024-04-10 15:58:40 -040050 $(RM) -r "$(venv-name)"
51# $(RM) -r build "$(venv-name)"
Matteo Scandolo9f619492019-10-25 13:11:58 -070052
Joey Armstrong96bcf1b2023-06-27 14:49:40 -040053## -----------------------------------------------------------------------
54## Intent: Display target help
55## -----------------------------------------------------------------------
56help :: $(venv-activate-script)
57 $(activate) \
58 && $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Matteo Scandolo9f619492019-10-25 13:11:58 -070059
Joey Armstrong96bcf1b2023-06-27 14:49:40 -040060# -----------------------------------------------------------------------
Matteo Scandolo9f619492019-10-25 13:11:58 -070061# 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 Armstrong96bcf1b2023-06-27 14:49:40 -040063# -----------------------------------------------------------------------
64docs-targets += html
Zack Williams4b0ef4d2019-12-18 14:25:20 -070065
Joey Armstrong96bcf1b2023-06-27 14:49:40 -040066$(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]