Skip to content

Commit e97c953

Browse files
authored
Merge pull request #27 from StaticRocket/feature/no-config
Feature/no config
2 parents 4f0e3e9 + 75d9abb commit e97c953

File tree

9 files changed

+104
-146
lines changed

9 files changed

+104
-146
lines changed

.github/workflows/rstcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
echo "$(wc -l < _new-warn.log)" > ./results/problem-count
5454
5555
# Exit with error if there are new warnings
56-
[ "$WARNING_COUNT" -gt "0" ] && exit 1
56+
[ "$WARNING_COUNT" -eq "0" ]
5757
5858
- name: Save results
5959
uses: actions/upload-artifact@v4

.rstcheck.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ ignore_directives = ifconfig
33
# ignore the following languages because they require external compilers and
44
# snippets in this repo depend on external code
55
ignore_language = c,cpp,c++
6+
ignore_substitutions = __PART_FAMILY_NAME__,__PART_FAMILY_DEVICE_NAMES__,__PRODUCT_LINE_NAME__,__SDK_BUILD_MACHINE__,__SDK_FULL_NAME__,__SDK_SHORT_NAME__,__SDK_INSTALL_FILE__,__SDK_INSTALL_DIR__,__SDK_DOWNLOAD_URL__,__LINUX_UBUNTU_VERSION_LONG__,__LINUX_UBUNTU_VERSION_SHORT__,__OPTEE_PLATFORM_FLAVOR__,__RTOS_UBUNTU_VERSION_LONG__,__WINDOWS_SUPPORTED_LONG__,__FEATURINGMATRIX__,__SYSFW_CORE_NAME__,__PCIE_BASE_ADDRESS__,__PCIE_DEVICE_ID__

Makefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,13 @@ export ROOTDIR = $(dir $(mkfile_path))
2020
$(info ROOTDIR is $(ROOTDIR))
2121

2222
$(info DEVFAMILY is $(DEVFAMILY_UP))
23-
FAMILYSETUPFILE = python-scripts/family_setup.py
2423

2524
ifeq ($(DEVFAMILY_UP), $(filter $(DEVFAMILY_UP), J721E J7200 J721S2 J784S4 AM68 AM69 J722S AM67 J742S2))
2625
CONFDIR = source/devices/J7_Family/${OS_LOW}
2726
else
2827
CONFDIR = source/devices/$(DEVFAMILY_UP)/${OS_LOW}
2928
endif
30-
TAGFILE = configs/$(DEVFAMILY_UP)/$(DEVFAMILY_UP)_${OS_LOW}_tags.py
3129

32-
$(info TAGFILE is $(TAGFILE))
3330
$(info CONFDIR is $(CONFDIR))
3431

3532
VERSION = $(shell cat ${CONFDIR}/version.txt)
@@ -44,7 +41,7 @@ endif
4441
# Internal variables.
4542
PAPEROPT_a4 = -D latex_paper_size=a4
4643
PAPEROPT_letter = -D latex_paper_size=letter
47-
CONFLOC = -c build/
44+
CONFLOC = -c $(ROOTDIR)
4845
VEROPTS = -D version=${VERSION} -D release=${VERSION}
4946
GIT_HASH = -D html_context.commit="$(shell git rev-parse --short HEAD)"
5047
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(CONFLOC) $(VEROPTS) $(GIT_HASH)
@@ -61,10 +58,6 @@ clean:
6158
rm -rf "$(BUILDDIR)"
6259
rm -f source/_replacevars.rst
6360

64-
config:
65-
mkdir -pv build
66-
cat python-scripts/conf.py ${TAGFILE} ${FAMILYSETUPFILE} > build/conf.py
67-
6861
lint:
6962
rstcheck -r "$(SOURCEDIR)"
7063

README.md

Lines changed: 33 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -19,72 +19,54 @@ OR you can use a docker container like the following:
1919

2020
### Build on Ubuntu
2121

22-
#### Build linux documentatin
22+
To build the documentation a DEVFAMILY and OS must be specified as either an
23+
argument to `make` or set as environment variables prior to execution of `make`.
2324

24-
$ make clean DEVFAMILY=<FAMILY> OS=linux
25-
$ make config DEVFAMILY=<FAMILY> OS=linux
26-
$ make DEVFAMILY=<FAMILY> OS=linux
25+
DEVFAMILY represents the Device Family. Possible values correspond to the names
26+
of directories listed under `configs/`. For example:
2727

28-
#### Build rtos documentation
28+
* "AM335X" (representing AM335X family)
29+
* "AM437X" (representing AM437X family)
30+
* "AM57X" (representing AM57X family)
31+
* "AM64X" (representing AM64X family)
32+
* "AM62X" (representing AM62X family)
33+
* "AM62AX" (representing AM62AX family)
34+
* "AM62PX" (representing AM62PX family)
35+
* "AM65X" (representing AM65X family)
36+
* "DRA821A" (representing DRA821A)
37+
* "J721E" (representing Jacinto 7 ES)
38+
* "J7200" (representing Jacinto 7 VCL)
39+
* "J721S2" (representing Jacinto 7 AEP)
40+
* "J784S4" (representing Jacinto 7 AHP)
41+
* "J722S" (representing Jacinto 7 AEN)
42+
* "GEN" (representing General family not listed above)
43+
* "CORESDK" (representing CORESDK)
2944

30-
$ make clean DEVFAMILY=<FAMILY> OS=rtos
31-
$ make config DEVFAMILY=<FAMILY> OS=rtos
32-
$ make DEVFAMILY=<FAMILY> OS=rtos
45+
OS represents the operating system. Possible values correspond to the second
46+
parameter of files listed under the `configs/<DEVFAMILY>/` directory. For
47+
example `AM57X_linux_toc.txt` means that `linux` is a valid OS value.
3348

34-
#### Build android (available for J721E and GEN):
49+
Example build commands:
3550

36-
$ make clean DEVFAMILY=<FAMILY> OS=android
37-
$ make config DEVFAMILY=<FAMILY> OS=android
38-
$ make DEVFAMILY=<FAMILY> OS=android
51+
- Build linux documentation for AM335X
3952

40-
### Build am64x documentation
53+
$ make DEVFAMILY=AM335X OS=linux
4154

42-
$ make config DEVFAMILY=AM64X
43-
$ make DEVFAMILY=AM64X
55+
- Build rtos documentation AM57X
4456

57+
$ make DEVFAMILY=AM57X OS=rtos
4558

46-
**Note**: that DEVFAMILY represents the Device Family.
47-
Possible values for <FAMILY> are
59+
- Build android documentation for AM62X
4860

49-
* "AM335X" (representing AM335X family)
50-
* "AM437X" (representing AM437X family)
51-
* "AM57X" (representing AM57X family)
52-
* "AM64X" (representing AM64X family)
53-
* "AM62X" (representing AM62X family)
54-
* "AM62AX" (representing AM62AX family)
55-
* "AM62PX" (representing AM62PX family)
56-
* "AM65X" (representing AM65X family)
57-
* "DRA821A" (representing DRA821A)
58-
* "J721E" (representing Jacinto 7 ES)
59-
* "J7200" (representing Jacinto 7 VCL)
60-
* "J721S2" (representing Jacinto 7 AEP)
61-
* "J784S4" (representing Jacinto 7 AHP)
62-
* "J722S" (representing Jacinto 7 AEN)
63-
* "GEN" (representing General family not listed above)
64-
* "CORESDK" (representing CORESDK)
65-
66-
**Note**: Please use script `bin/check-warn.sh` or the `make lint` target
67-
to check for new build warnings and fix them before submitting
68-
pull-requests.
61+
$ make DEVFAMILY=AM62X OS=android
6962

7063
### HTML Page Output
7164

7265
Open the index page in a web browser
7366

74-
**AM64X**:
75-
76-
./build/processor-sdk-AM64X/esd/docs/[version]/index.html
77-
78-
**GEN family** (TODO: to be migrated to the new structure):
79-
80-
linux: ./build/processor-sdk-linux/esd/docs/[version]/index.html
81-
rtos: ./build/processor-sdk-rtos/esd/docs/[version]/index.html
82-
android: ./build/processor-sdk-android/esd/docs/[version]/index.html
83-
84-
**Others**:
85-
86-
linux: ./build/processor-sdk-linux-<FAMILY>/esd/docs/[version]/index.html
87-
rtos: ./build/processor-sdk-rtos-<FAMILY>/esd/docs/[version]/index.html
67+
linux: ./build/processor-sdk-linux-<FAMILY>/esd/docs/[version]/index.html
68+
rtos: ./build/processor-sdk-rtos-<FAMILY>/esd/docs/[version]/index.html
69+
android: ./build/processor-sdk-android-<FAMILY>/esd/docs/[version]/index.html
8870

8971
## Tips and Tricks
9072

python-scripts/conf.py renamed to conf.py

Lines changed: 68 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,20 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14+
# pylint: disable=C0103,W0622
15+
1416
import sys
1517
import os
16-
import shlex
18+
import importlib
1719

1820
# If extensions (or modules to document with autodoc) are in another directory,
1921
# add these directories to sys.path here. If the directory is relative to the
2022
# documentation root, use os.path.abspath to make it absolute, like shown here.
2123
#sys.path.insert(0, os.path.abspath('.'))
2224
rootdir = os.environ.get('ROOTDIR')
23-
sys.path.append(rootdir + 'python-scripts')
25+
sys.path.insert(0, os.path.abspath(rootdir))
26+
27+
from scripts import interpretvalues, sectinc, replacevars
2428

2529
# -- General configuration ------------------------------------------------
2630

@@ -41,7 +45,7 @@
4145
]
4246

4347
# Add any paths that contain templates here, relative to this directory.
44-
templates_path = ['../_templates']
48+
templates_path = ['_templates']
4549

4650
# The suffix(es) of source filenames.
4751
# You can specify multiple suffix as a list of string:
@@ -50,8 +54,8 @@
5054

5155
# The encoding of source files.
5256
#source_encoding = 'utf-8-sig'
53-
copyright = u'&copy; Copyright 1995-2024'
54-
author = u'Texas Instruments Incorporated'
57+
copyright = '&copy; Copyright 1995-2024'
58+
author = 'Texas Instruments Incorporated'
5559

5660
# The language for content autogenerated by Sphinx. Refer to documentation
5761
# for a list of supported languages.
@@ -134,7 +138,7 @@
134138

135139
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
136140
# using the given strftime format.
137-
html_last_updated_fmt = u'%b %d, %Y'
141+
html_last_updated_fmt = '%b %d, %Y'
138142

139143
# If true, SmartyPants will be used to convert quotes and dashes to
140144
# typographically correct entities.
@@ -239,3 +243,61 @@
239243

240244
# Suppress warnings about excluded documents because every device gets a different toc tree
241245
suppress_warnings = ['toc.excluded']
246+
247+
# -- Tag file loader ------------------------------------------------------
248+
249+
# Defaults
250+
exclude_patterns = []
251+
252+
FAMILY = os.environ.get("DEVFAMILY", "")
253+
OS = os.environ.get("OS", "")
254+
try:
255+
globals().update(importlib.import_module(f"configs.{FAMILY}.{FAMILY}_{OS}_tags").__dict__)
256+
except ModuleNotFoundError as exc:
257+
raise ModuleNotFoundError("Configuration not supported!") from exc
258+
259+
# -- Family setup ---------------------------------------------------------
260+
261+
# List of Inclusion TOC files to use
262+
family_tocfiles = [f"{FAMILY}/{FAMILY}_{OS}_toc.txt"]
263+
# Family Configuration file to use
264+
family_config_inputfile = f"{FAMILY}/{FAMILY}_{OS}_config.txt"
265+
266+
# Hash table for Replacement Variables
267+
family_replacevars = {}
268+
# Hash table for Configuration Values
269+
family_configvals = {}
270+
271+
def setup(app):
272+
"""
273+
Sphinx application entrypoint
274+
"""
275+
276+
# Load overrides
277+
app.add_css_file("css/theme_overrides.css")
278+
279+
# Read the replacement variables and the configuration values
280+
print("Device Family Build setup started")
281+
interpretvalues.read_familyvals(app, family_config_inputfile,
282+
family_replacevars, family_configvals)
283+
284+
print("Build setup: Filled Replacement Variables (family_replacevars)"
285+
"and Configuration Values (family_configvals) hash tables")
286+
print("family_replacevars = ")
287+
print(family_replacevars)
288+
print("family_configvals = ")
289+
print(family_configvals)
290+
291+
# Determine which sections need to be excluded
292+
sectinc.find_all_rst_files(app, exclude_patterns)
293+
sectinc.fill_docs_to_keep(app, family_tocfiles, 0)
294+
sectinc.set_excluded_docs(app, exclude_patterns)
295+
print(FAMILY + " exclude_patterns is:")
296+
print('[')
297+
for elem in exclude_patterns:
298+
print(elem)
299+
print(']')
300+
301+
# Write to the replacevars.rst.inc file for usage by Sphinx
302+
replacevars.write_replacevars(app, family_replacevars)
303+
print("Device Family Build setup completed")

python-scripts/family_setup.py

Lines changed: 0 additions & 80 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)