Liste des Groupes | Revenir à ca embedded |
On 2025-03-21, David Brown <david.brown@hesbynett.no> wrote:Agreed - it is not the pattern that the famous paper warned against. But it /is/ recursive make. And in general, I think recursive make can potentially be useful in various ways, but you have to be very careful about how you use it in order to do so safely (and efficiently - but of course safety and correctness is the priority).>OK, that is not the classic recursive make pattern (ie. run make in each
The way I use recursive makes is /really/ recursive - the main make
(typically split into a few include makefiles for convenience, but only
one real make) handles everything, and it does some of that be calling
/itself/ recursively. It is quite common for me to build multiple
program images from one set of source - perhaps for different variants
of a board, with different features enabled, and so on. So I might use
"make prog=board_a" to build the image for board a, and "make
prog=board_b" for board b. Each build will be done in its own directory
- builds/build_a or builds/build_b. Often I will want to build for both
boards - then I will do "make prog="board_a board_b"" (with a default
setting for the most common images).
subdirectory).
I do that (ie. building for multiple boards) using build
scripts that are external to make.
cu
Michael
Les messages affichés proviennent d'usenet.