Thanks everyone for the help. I managed to have everything set up to my liking.
As a reference for others trying to manage multiple builds, here is what I did: I created scripts for every build, using the following format: # Example contents of DEBUG.sh kconfig-tweak --enable CONFIG_DEBUG_FEATURES make oldconfig The build type is defined as an environment variable in my system (e.g. BUILD = DEBUG). The top-level Makefile contains: ifeq ($(BUILD), DEBUG) BUILD_DEP = DEBUG.build BUILD_SCRIPT = DEBUG.sh endif ifeq ($(BUILD), RELEASE) BUILD_DEP = RELEASE.build BUILD_SCRIPT = RELEASE.sh endif I changed target all to: all: $(BUILD_PATH)/$(BUILD_DEP) @make -C nuttx and I added the target: $(BUILD_PATH)/$(BUILD_DEP): @make clean @mkdir -p $(BUILD_PATH) @./boards/config/$(BUILD_SCRIPT) @touch $(BUILD_PATH)/$(BUILD_DEP) This way every time I build NuttX, the build configuration is checked by the Makefile dependency. If needed (i.e. every time I change the build type), the project is cleaned and the changes are applied automatically. Now I can have as many configurations as I like, the changes are applied automatically, and the tracked files of my repository are not touched. Στις Κυρ, 26 Ιουλ 2020 στις 1:30 π.μ., ο/η Brennan Ashton < bash...@brennanashton.com> έγραψε: > On Sat, Jul 25, 2020 at 4:09 AM Fotis Panagiotopoulos > <f.j.pa...@gmail.com> wrote: > > > > Perfect! kconfig-tweak is what I was looking for. I will give it a try > > later today. > > > > However at this point I would like to ask. How is a debug build defined > for > > NuttX? > > Surely there are configs that can be changed. But is there any > system-wide > > debug option? > > Is NDEBUG defined in any case? > > > > For example I see CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG which is > > active when CONFIG_DEBUG_SYMBOLS is also active. > > So, I guess CONFIG_DEBUG_SYMBOLS is our general "debug" macro? > > > > My application will most probably need to know whether this is a debug > > build or not. > > Just about all the explicitly debug functionality, it is all behind > CONFIG_DEBUG_FEATURES > so if you wanted to indicate if the build had debug functionality > enabled that would probably be > the variable to use. That said there are a few exceptions including > these which may also be > of interest to you. > CONFIG_STACK_COLORATION > CONFIG_DEBUG_NOOPT > > Debug is a very broad word depending on what you are doing, for > instance I frequently include the nsh when I am developing along with > things like procfs, but I might not have that enabled in the "final" > build. > > --Brennan >