I have been working on an application for the past several months. Now want to get it running on NuttX. I don't have much experience porting applications to NuttX and have some dumb newbie questions (I mostly worked on the other side of the application/OS interface).
If I have an application that builds and runs on Linux and I want to port it to NuttX, I would basically just provide the Kconfig files, Make.defs files, and Makefiles as expected by the build system, then just link my application anywhere in the app/ source tree. But how does the code know that it is running on NuttX? There is no CONFIG_NUTTX, there is no OS_managed __NUTTX__ definition. I do see a __NUTTX__ definition defined in some application Makefiles in apps/, but this is a chicken'n'egg problem. They use custom Makefiles to provide these definitions. But what if you want the same application build logic to support either platform. I don't see any way to do that. Has anyone thought of way to do this? Or do you all use custom Makefile for the NuttX build? Greg