On 30-03-2020 05:08, Raghu Icecraft Software Trainings via Lists.Yoctoproject.Org wrote:
Hi, I have some general idea on makefile in C, C++ environment. Related to my Yocto project having a very tough time in getting my makefile ready on shape after almost every development change. Is there any specific Troubleshooting based guidance available some where ? I have also tried looking for old posts in this group. Please suggest if I have to post this question, somewhere else.
For anything more advanced than one or two C files, avoid handcrafting makefiles and use autotools or cmake.
A helloworld makefile that takes "helloworld.c" or "helloworld.cpp" and creates an executable can be as simple as this:
helloworld: helloworld.o
And that's it. Notice the total absence of compiler and linker invocations, your environment already knows how to do that. Adding more to this makefile will usually only make it worse...