Skip to content

Conversation

@tinnedkarma
Copy link
Contributor

@tinnedkarma tinnedkarma commented Oct 6, 2025

Summary

It feels like I am always getting side-tracked while working on NuttX.

Makefile based build system is one of those areas. It seems to be lacking documentation. Most of the features I discovered by actually reading and understanding the Makefiles content.

This PR (I'll keep it in draft for the time being) wants to start that progress. (Do we have a way to compile the documentation locally?)
I am not sure how, or where should I store the files (this whole rst documentation is still new for me).
I'll need help for licensing also. I've copy-pasted the license text into the file, but it seems that my file is the only one that does that. I'll keep documenting as I uncover more about it.

The scope of this PR is just to define how to start, and to document the root Makefile and Unix.mk files.
Smaller chunks of text are easier to process, and I'll need reviews to confirm the content correctness.

Also, feel free to point out what you want to see documented for the make build system

Impact

Improve documentation. More to read, hopefully, also usefull.

Testing

N/A. No impact over the codebase.

@github-actions github-actions bot added Area: Documentation Improvements or additions to documentation Size: M The size of the change in this PR is medium labels Oct 6, 2025
@acassis
Copy link
Contributor

acassis commented Oct 6, 2025

@tinnedkarma yes, there is a Documentation explaining how to compile the Documentation locally.
Basically you just need to have the right packages installed and execute:
$ cd Documentation
$ make html

@acassis acassis requested review from jerpelea and linguini1 October 6, 2025 12:05
@simbit18
Copy link
Contributor

simbit18 commented Oct 6, 2025

@linguini1
Copy link
Contributor

Thank you! NuttX has been struggling with documentation so it's good to see improvements in that area.

@tinnedkarma
Copy link
Contributor Author

@acassis @linguini1
Do not mind the content, most of it will be reworded.
But, the concept is there, I am not looking to explain in too many words the build flow (as I called it) but rather explain key points, such as files, targets or variables that alters the build process.
Some feedback over this approach early on will be helpful

Copy link
Contributor

@hartmannathan hartmannathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This documentation is extremely helpful. Thank you for noticing that it was lacking and for helping to improve it!

.. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
.. License for the specific language governing permissions and limitations
.. under the License.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that we should probably include the license text in the documentation files. Thanks for doing this here!

Copy link
Member

@raiden00pl raiden00pl Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely disagree with this. It makes the documentation files less readable for terminal users. If it is not required by Apache then we should not clutter the documentation with license headers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I agree with both.
Though I do not know how the licensing work, if it is per file, as in the productive code base, or it can be per project.
But I completely agree, I also cat files rather than opening the web page, rst is fairly readable in the terminal, less boilerplate is always welcome.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, since it's added automatically, then it's redundant to add it here manually. Let's remove the boilerplate and make the docs more readable :-)

Due to *requirements, constraints, and the complexity of the build process*, NuttX divides
this work into multiple files, each handling specific parts of the build process.

Stated in :doc:`/introduction/inviolables`, multiple platforms should be supported:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Stated in :doc:`/introduction/inviolables`, multiple platforms should be supported:
As stated in :doc:`/introduction/inviolables`, multiple platforms should be supported:


- :ref:`flatlibs_mk`: Kernel and user-space built into a single `blob`.
- :ref:`protectedlibs_mk`: Kernel and user-space built as two separate `blobs`.
- :ref:`kernelibs_mk`: Kernel build into single `blob`. User apps must be loaded
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- :ref:`kernelibs_mk`: Kernel build into single `blob`. User apps must be loaded
- :ref:`kernelibs_mk`: Kernel built into single `blob`. User apps must be loaded

- :ref:`kernelibs_mk`: Kernel build into single `blob`. User apps must be loaded
into memory for execution.

NuttX targets multiple libs, or `silos`, each handling it's own compilation:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NuttX targets multiple libs, or `silos`, each handling it's own compilation:
NuttX targets multiple libs, or `silos`, each handling its own compilation:


.. note::

Gregory Nutt have a nice presetation about
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Gregory Nutt have a nice presetation about
Gregory Nutt has a nice presentation about

pageId=139629399&preview=/139629402/140774623/nuttx-3-archoverview.pdf>`_

There the `silo` concept is explained. Only the `silos` there are listed below as libs.
The build modes influences the needed libs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The build modes influences the needed libs.
The build mode influences the needed libs.

Verbosity
---------

The ``V`` variable can be passed to make to control the build verbosity.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ``V`` variable can be passed to make to control the build verbosity.
The ``V`` variable can be passed to `make` to control the build verbosity.

Win.mk
------

Although targeting different platforms, both **Win.mk** and **Unix.mk** aims the same output.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Although targeting different platforms, both **Win.mk** and **Unix.mk** aims the same output.
Although targeting different platforms, both **Win.mk** and **Unix.mk** aim to produce the same output.

------

Although targeting different platforms, both **Win.mk** and **Unix.mk** aims the same output.
The need for independent files is due to the differences in the platforms approaches.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The need for independent files is due to the differences in the platforms approaches.
The need for independent files is due to the differences in the platforms' approaches.

^^^^^^^

The main reason for the use of dummies is to handle some specific scenarios, such as external
code bases, custom chips and boards or overcome tooling limitation. If any of the features below
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
code bases, custom chips and boards or overcome tooling limitation. If any of the features below
code bases, custom chips and boards or to overcome tooling limitations. If any of the features below

@tinnedkarma
Copy link
Contributor Author

This documentation is extremely helpful. Thank you for noticing that it was lacking and for helping to improve it!

Hello @hartmannathan,

Thanks for the review, I am still throwing words at random.
English not being my native language doesn't help either.

How was the read, I am a bit worried about the structure of the document being all over the place. I try to summarize the important points of the build system, rather than explain how it works step by step.

Does the content make sense? Would you do things differently?

@hartmannathan
Copy link
Contributor

This documentation is extremely helpful. Thank you for noticing that it was lacking and for helping to improve it!

Hello @hartmannathan,

Thanks for the review, I am still throwing words at random.

English not being my native language doesn't help either.

How was the read, I am a bit worried about the structure of the document being all over the place. I try to summarize the important points of the build system, rather than explain how it works step by step.

Does the content make sense? Would you do things differently?

Hello @tinnedkarma, I think this document reads just fine. It gathers together in one place a pretty good high-level description of the build system (at least the Make-based part) that we were lacking for a while. The suggestions I gave in the review are just small grammatical nits to improve the English. No worries if English is not your native language! It's still pretty good :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Documentation Improvements or additions to documentation Size: L The size of the change in this PR is large Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants