doc: Change Makefile and doc for building docs to CMake
Now that CMake is supported for building the docs, adapt the instructions to build the documentation to the new mechanism and also adapt the root-level Makefile to support building using CMake. Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
parent
ae69934cb9
commit
7480f17d50
11
Makefile
11
Makefile
|
@ -2,16 +2,9 @@
|
|||
# Top level makefile for things not covered by cmake
|
||||
#
|
||||
|
||||
ifeq ($(VERBOSE),1)
|
||||
Q =
|
||||
else
|
||||
Q = @
|
||||
endif
|
||||
|
||||
MAKEFLAGS += --no-print-directory
|
||||
export Q
|
||||
BUILDDIR ?= doc/_build
|
||||
|
||||
# Documentation targets
|
||||
# ---------------------------------------------------------------------------
|
||||
htmldocs:
|
||||
$(Q)$(MAKE) -C doc htmldocs
|
||||
mkdir -p ${BUILDDIR} && cmake -G"Unix Makefiles" -B${BUILDDIR} -Hdoc/ && make -s -C ${BUILDDIR} htmldocs
|
||||
|
|
|
@ -82,18 +82,44 @@ Running the documentation processors
|
|||
The ``/doc`` directory in your cloned copy of the Zephyr project git
|
||||
repo has all the .rst source files, extra tools, and Makefile for
|
||||
generating a local copy of the Zephyr project's technical documentation.
|
||||
Assuming the local Zephyr project copy is ``~/zephyr``, here are the
|
||||
commands to generate the html content locally:
|
||||
Assuming the local Zephyr project copy is in a folder ``zephyr`` in your home
|
||||
folder, here are the commands to generate the html content locally:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
$ cd ~/zephyr
|
||||
$ source zephyr-env.sh
|
||||
$ make htmldocs
|
||||
# On Linux/macOS
|
||||
cd ~/zephyr
|
||||
source zephyr-env.sh
|
||||
mkdir -p doc/_build && cd doc/_build
|
||||
# On Windows
|
||||
cd %userprofile%\zephyr
|
||||
zephyr-env.cmd
|
||||
mkdir doc\_build & cd doc/_build
|
||||
|
||||
# Use cmake to configure a Ninja-based build system:
|
||||
cmake -GNinja ..
|
||||
# Now run ninja on the generated build system:
|
||||
ninja htmldocs
|
||||
|
||||
Depending on your development system, it will take about 15 minutes to
|
||||
collect and generate the HTML content. When done, you can view the HTML
|
||||
output with your browser started at ``~/zephyr/doc/_build/html/index.html``
|
||||
output with your browser started at ``doc/_build/html/index.html``
|
||||
|
||||
If you want to build the documentation from scratch you can use this command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
ninja pristine
|
||||
|
||||
On Unix platforms a convenience :file:`Makefile` at the root folder
|
||||
of the Zephyr repository can be used to build the documentation directly from
|
||||
there:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
cd ~/zephyr
|
||||
source zephyr-env.sh
|
||||
make htmldocs
|
||||
|
||||
Filtering expected warnings
|
||||
***************************
|
||||
|
|
Loading…
Reference in a new issue