v01d opened a new issue #633: URL: https://github.com/apache/incubator-nuttx-apps/issues/633
An application `Make.defs` can define multiple builtin applications by using something like: ```Makefile MAINCSRCS = a.c b.c PROGNAME = a b ``` When building `a.c` the `-Dmain=a_main` will be defined, and similarly for `b.c`. However, the logic in `Application.mk` simply iterates `PROGNAME` in order to build each `main` definition. This assumes that all targets will be built. When only one of these is built (as part of a previous build), it will mismatch the corresponding program name (it will go in order from first `PROGNAME` entry). The correct solution would be to find the index of the C file in `MAINCSRCS` and get the corresponding entry in `PROGNAME`. Make does not implement such a function and there's some trickery to do so: https://stackoverflow.com/questions/9674711/makefile-find-a-position-of-word-in-a-variable As the `Application.mk` file is already really convoluted I don't want to keep making this worse. Any better ideas? This of course would be much easier if we just used the `.c` file name as PROGNAME but that would be a breaking change for apps using a different name. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
