Hello,
I have asked something similar in the past but since the yahoo group seems to be nonexisting I felt to ask about it again since I'm having other problems with this.
I'm currently writing my own set of apps in apps/external/ organized as apps/external/app1, apps/external/app2, etc. Each app has the following structure:
ls app/
Kconfig Make.dep Makefile src
Inside src, the source files may be organized in subdirectories. For this to work, I defined my CXXSRCS variable including the path relative to the application root ("app") in this case. The first problem was that depend rules did not work correctly since, for some reason, the left-hand side of depend rules lacked the complete path and I had to do the following to fix it in my app Makefile:
depend: .depend
@sed -ri 's%^(.*): (\S+/)?%\2\1: \2%g' Make.dep
So far I haven't questioned much about this setup but now I realized that when doing "make clean" from nuttx/ (or, more specifically make apps_clean), my object files are not deleted. After going deep into the build system I found that only object files at the application directory are removed, with a step such as "rm *.o".
This was unexpected since I thought that, since in Application.mk the list of object files is built (in OBJS variable) this could be used to remove all object files, irregardless of their location inside the application directory. Again, to "fix" this, I did something like:
clean: extraclean
extraclean:
rm -f $(OBJS)
(if I redefined clean I got some warnings and it also didn't feel right to override a NuttX rule).
So, my question is: is there a better workflow I should be using to expose my application with subdirectories to NuttX build system? Alternatively, would it be possible/reasonable to add the removal of $(OBJS) as part of the apps build system? Regarding the Make.dep generation I do not even fully understand why it is happening since, again, I would expect the build system to have the required information.
Best,
Matias