Skip to content

Commit fc5d01f

Browse files
Add .. make-target:: directive for make targets, for easier viewing than the current titles.
1 parent 1b015e6 commit fc5d01f

2 files changed

Lines changed: 67 additions & 78 deletions

File tree

‎Doc/tools/extensions/pyspecific.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import re
1313

14+
from docutils import nodes
1415
from sphinx import addnodes
1516
from sphinx.domains.python import PyFunction, PyMethod
1617

@@ -78,6 +79,13 @@ def parse_pdb_command(env, sig, signode):
7879
return fullname
7980

8081

82+
def parse_make_target(env, sig, signode):
83+
"""Transform a make target signature into RST nodes."""
84+
signode += addnodes.desc_name(sig, sig)
85+
signode['ids'].append(nodes.make_id(sig))
86+
return sig
87+
88+
8189
def parse_monitoring_event(env, sig, signode):
8290
"""Transform a monitoring event signature into RST nodes."""
8391
signode += addnodes.desc_addname('sys.monitoring.events.', 'sys.monitoring.events.')
@@ -113,6 +121,7 @@ def setup(app):
113121
app.add_object_type('opcode', 'opcode', '%s (opcode)', parse_opcode_signature)
114122
app.add_object_type('pdbcommand', 'pdbcmd', '%s (pdb command)', parse_pdb_command)
115123
app.add_object_type('monitoring-event', 'monitoring-event', '%s (monitoring event)', parse_monitoring_event)
124+
app.add_object_type('make-target', 'make-target', '%s (make target)', parse_make_target)
116125
app.add_directive_to_domain('py', 'awaitablefunction', PyAwaitableFunction)
117126
app.add_directive_to_domain('py', 'awaitablemethod', PyAwaitableMethod)
118127
app.connect('env-check-consistency', patch_pairindextypes)

‎Doc/using/configure.rst‎

Lines changed: 58 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,107 +1434,87 @@ Main build steps
14341434
Main Makefile targets
14351435
---------------------
14361436

1437-
make
1438-
^^^^
1437+
.. make-target:: make
14391438

1440-
For the most part, when rebuilding after editing some code or
1441-
refreshing your checkout from upstream, all you need to do is execute
1442-
``make``, which (per Make's semantics) builds the default target, the
1443-
first one defined in the Makefile. By tradition (including in the
1444-
CPython project) this is usually the ``all`` target. The
1445-
``configure`` script expands an ``autoconf`` variable,
1446-
``@DEF_MAKE_ALL_RULE@`` to describe precisely which targets ``make
1447-
all`` will build. The three choices are:
1439+
For the most part, when rebuilding after editing some code or
1440+
refreshing your checkout from upstream, all you need to do is execute
1441+
``make``, which (per Make's semantics) builds the default target, the
1442+
first one defined in the Makefile. By tradition (including in the
1443+
CPython project) this is usually the ``all`` target. The
1444+
``configure`` script expands an ``autoconf`` variable,
1445+
``@DEF_MAKE_ALL_RULE@`` to describe precisely which targets ``make
1446+
all`` will build. The three choices are:
14481447

1449-
* ``profile-opt`` (configured with ``--enable-optimizations``)
1450-
* ``build_wasm`` (chosen if the host platform matches ``wasm32-wasi*`` or
1451-
``wasm32-emscripten``)
1452-
* ``build_all`` (configured without explicitly using either of the others)
1448+
* ``profile-opt`` (configured with ``--enable-optimizations``)
1449+
* ``build_wasm`` (chosen if the host platform matches ``wasm32-wasi*`` or
1450+
``wasm32-emscripten``)
1451+
* ``build_all`` (configured without explicitly using either of the others)
14531452

1454-
Depending on the most recent source file changes, Make will rebuild
1455-
any targets (object files and executables) deemed out-of-date,
1456-
including running ``configure`` again if necessary. Source/target
1457-
dependencies are many and maintained manually however, so Make
1458-
sometimes doesn't have all the information necessary to correctly
1459-
detect all targets which need to be rebuilt. Depending on which
1460-
targets aren't rebuilt, you might experience a number of problems. If
1461-
you have build or test problems which you can't otherwise explain,
1462-
``make clean && make`` should work around most dependency problems, at
1463-
the expense of longer build times.
1453+
Depending on the most recent source file changes, Make will rebuild
1454+
any targets (object files and executables) deemed out-of-date,
1455+
including running ``configure`` again if necessary. Source/target
1456+
dependencies are many and maintained manually however, so Make
1457+
sometimes doesn't have all the information necessary to correctly
1458+
detect all targets which need to be rebuilt. Depending on which
1459+
targets aren't rebuilt, you might experience a number of problems. If
1460+
you have build or test problems which you can't otherwise explain,
1461+
``make clean && make`` should work around most dependency problems, at
1462+
the expense of longer build times.
14641463

1464+
.. make-target:: make platform
14651465

1466-
make platform
1467-
^^^^^^^^^^^^^
1466+
Build the ``python`` program, but don't build the standard library
1467+
extension modules. This generates a file named ``platform`` which
1468+
contains a single line describing the details of the build platform,
1469+
e.g., ``macosx-14.3-arm64-3.12`` or ``linux-x86_64-3.13``.
14681470

1469-
Build the ``python`` program, but don't build the standard library
1470-
extension modules. This generates a file named ``platform`` which
1471-
contains a single line describing the details of the build platform,
1472-
e.g., ``macosx-14.3-arm64-3.12`` or ``linux-x86_64-3.13``.
1471+
.. make-target:: make profile-opt
14731472

1473+
Build Python using profile-guided optimization (PGO). You can use the
1474+
configure :option:`--enable-optimizations` option to make this the
1475+
default target of the ``make`` command (``make all`` or just
1476+
``make``).
14741477

1475-
make profile-opt
1476-
^^^^^^^^^^^^^^^^
1478+
.. make-target:: make clean
14771479

1478-
Build Python using profile-guided optimization (PGO). You can use the
1479-
configure :option:`--enable-optimizations` option to make this the
1480-
default target of the ``make`` command (``make all`` or just
1481-
``make``).
1480+
Remove built files.
14821481

1482+
.. make-target:: make distclean
14831483

1484+
In addition to the work done by ``make clean``, remove files
1485+
created by the configure script. ``configure`` will have to be run
1486+
before building again. [#]_
14841487

1485-
make clean
1486-
^^^^^^^^^^
1488+
.. make-target:: make install
14871489

1488-
Remove built files.
1490+
Build the ``all`` target and install Python.
14891491

1492+
.. make-target:: make test
14901493

1491-
make distclean
1492-
^^^^^^^^^^^^^^
1494+
Build the ``all`` target and run the Python test suite with the
1495+
``--fast-ci`` option without GUI tests. Variables:
14931496

1494-
In addition to the work done by ``make clean``, remove files
1495-
created by the configure script. ``configure`` will have to be run
1496-
before building again. [#]_
1497+
* ``TESTOPTS``: additional regrtest command-line options.
1498+
* ``TESTPYTHONOPTS``: additional Python command-line options.
1499+
* ``TESTTIMEOUT``: timeout in seconds (default: 10 minutes).
14971500

1501+
.. make-target:: make ci
14981502

1499-
make install
1500-
^^^^^^^^^^^^
1503+
This is similar to ``make test``, but uses the ``-ugui`` to also run GUI tests.
15011504

1502-
Build the ``all`` target and install Python.
1503-
1504-
1505-
make test
1506-
^^^^^^^^^
1507-
1508-
Build the ``all`` target and run the Python test suite with the
1509-
``--fast-ci`` option without GUI tests. Variables:
1510-
1511-
* ``TESTOPTS``: additional regrtest command-line options.
1512-
* ``TESTPYTHONOPTS``: additional Python command-line options.
1513-
* ``TESTTIMEOUT``: timeout in seconds (default: 10 minutes).
1514-
1515-
1516-
make ci
1517-
^^^^^^^
1518-
1519-
This is similar to ``make test``, but uses the ``-ugui`` to also run GUI tests.
1520-
1521-
.. versionadded:: 3.14
1522-
1523-
1524-
make buildbottest
1525-
^^^^^^^^^^^^^^^^^
1505+
.. versionadded:: 3.14
15261506

1527-
This is similar to ``make test``, but uses the ``--slow-ci``
1528-
option and default timeout of 20 minutes, instead of ``--fast-ci`` option.
1507+
.. make-target:: make buildbottest
15291508

1509+
This is similar to ``make test``, but uses the ``--slow-ci``
1510+
option and default timeout of 20 minutes, instead of ``--fast-ci`` option.
15301511

1531-
make regen-all
1532-
^^^^^^^^^^^^^^
1512+
.. make-target:: make regen-all
15331513

1534-
Regenerate (almost) all generated files. These include (but are not
1535-
limited to) bytecode cases, and parser generator file.
1536-
``make regen-stdlib-module-names`` and ``autoconf`` must be run
1537-
separately for the remaining `generated files <#generated-files>`_.
1514+
Regenerate (almost) all generated files. These include (but are not
1515+
limited to) bytecode cases, and parser generator file.
1516+
``make regen-stdlib-module-names`` and ``autoconf`` must be run
1517+
separately for the remaining `generated files <#generated-files>`_.
15381518

15391519

15401520
C extensions

0 commit comments

Comments
 (0)