forked from TexasInstruments/processor-sdk-doc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (57 loc) · 2.48 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Makefile for Sphinx documentation
#
default: html
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
OS ?= linux
_UC = $(shell echo '$1' | tr '[:lower:]' '[:upper:]')
_LC = $(shell echo '$1' | tr '[:upper:]' '[:lower:]')
DEVFAMILY_UP=$(call _UC,${DEVFAMILY})
OS_LOW=$(call _LC,${OS})
mkfile_path = $(abspath $(lastword $(MAKEFILE_LIST)))
export ROOTDIR = $(dir $(mkfile_path))
$(info ROOTDIR is $(ROOTDIR))
$(info DEVFAMILY is $(DEVFAMILY_UP))
FAMILYSETUPFILE = python-scripts/family_setup.py
ifeq ($(DEVFAMILY_UP), $(filter $(DEVFAMILY_UP), J721E J7200 J721S2 J784S4 AM68 AM69 J722S AM67))
CONFDIR = source/devices/J7_Family/${OS_LOW}
else
CONFDIR = source/devices/$(DEVFAMILY_UP)/${OS_LOW}
endif
TAGFILE = configs/$(DEVFAMILY_UP)/$(DEVFAMILY_UP)_${OS_LOW}_tags.py
$(info TAGFILE is $(TAGFILE))
$(info CONFDIR is $(CONFDIR))
VERSION = $(shell cat ${CONFDIR}/version.txt)
SOURCEDIR = source
BUILDDIR = build/processor-sdk-${OS_LOW}-${DEVFAMILY_UP}/esd/docs/${VERSION}
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from https://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
CONFLOC = -c build/
VEROPTS = -D version=${VERSION} -D release=${VERSION}
GIT_HASH = -D html_context.commit="$(shell git rev-parse --short HEAD)"
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(CONFLOC) $(VEROPTS) $(GIT_HASH)
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
.PHONY: help clean config html
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
clean:
rm -rf "$(BUILDDIR)"
rm -f source/_replacevars.rst
config:
mkdir -pv build
cat python-scripts/conf.py ${TAGFILE} ${FAMILYSETUPFILE} > build/conf.py
lint:
rstcheck -r "$(SOURCEDIR)"
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)"
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)."