Out-of-tree build is the default for me in various projects. I like to have git submodules / dependencies untouched.
FreeBSD uses (BSD) make and allows out of tree builds and it is possible to specify WRKDIRPREFIX for instance in tmpfs located in RAM. Kernel build also allows passing another variable with specific configuration. So various kernels can be built into different locations. This should be possible also with make in NuttX..? :-) I use custom board and custom application (that requires linking to nuttx-apps) to build NuttX anyways by default. Then my build script copies resulting binary to out of tree bin dir appending timestamp suffix to the firmware image ready to flash. NuttX sources and app sources are git submodules that can be easily updated / changed to a specific version / branch / commit / release. This enables various automation scenarios. This is the layout: project.git/ nuttx.git nuttx-apps.git cederom/boards/myboard cederom/apps/myapp bin scripts doc Above could be extended with "build/board_cfg" location with all configuration and build files specific for a given board..? This location could be provided and set custom in WRKDIRPREFIX env variable so the sources remain untouched..? Alternatively, at this point, user can simply have two nuttx.git subdirectories (i.e. project/nuttx-cm4 and project/nuttx-cm7) with build configuration and binaries for each CPU right? I do not know the details of linking in that situation though. This is interesting problem, as I also have some prototype Maxim MCU with ARM Cortex M as main CPU and modified RISC-V as Hardware Neural Network Accelerator. This is something new. I wonder how the story follows :-) -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info