blob: 462d7ce3d7a745d72d598b969e9a56af2cdad51a [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))
29
30##--------------------##
31##---] INCLUDES [---##
32##--------------------##
33include $(TOP-docs)/config.mk
34include $(TOP-docs)/makefiles/include.mk
35
36# Minimal makefile for Sphinx documentation
Matteo Scandolo9f619492019-10-25 13:11:58 -070037
38# You can set these variables from the command line.
39SPHINXOPTS =
40SPHINXBUILD = sphinx-build
41SOURCEDIR = source
42BUILDDIR = build
43
Zack Williams4b0ef4d2019-12-18 14:25:20 -070044.PHONY: help Makefile lint
Matteo Scandolo9f619492019-10-25 13:11:58 -070045
Joey Armstrong96bcf1b2023-06-27 14:49:40 -040046## -----------------------------------------------------------------------
47## -----------------------------------------------------------------------
48clean ::
Joey Armstrongfeeefe82024-04-10 15:58:40 -040049 $(RM) -r "$(venv-name)"
50# $(RM) -r build "$(venv-name)"
Matteo Scandolo9f619492019-10-25 13:11:58 -070051
Joey Armstrong96bcf1b2023-06-27 14:49:40 -040052## -----------------------------------------------------------------------
53## Intent: Display target help
54## -----------------------------------------------------------------------
55help :: $(venv-activate-script)
56 $(activate) \
57 && $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Matteo Scandolo9f619492019-10-25 13:11:58 -070058
Joey Armstrong96bcf1b2023-06-27 14:49:40 -040059# -----------------------------------------------------------------------
Matteo Scandolo9f619492019-10-25 13:11:58 -070060# Catch-all target: route all unknown targets to Sphinx using the new
61# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
Joey Armstrong96bcf1b2023-06-27 14:49:40 -040062# -----------------------------------------------------------------------
63docs-targets += html
Zack Williams4b0ef4d2019-12-18 14:25:20 -070064
Joey Armstrong96bcf1b2023-06-27 14:49:40 -040065$(docs-targets) : $(venv-activate-script) Makefile
66 $(call banner-enter,Target $@)
67 $(activate) \
68 && $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
69 $(call banner-leave,Target $@)
70
71# [EOF]