Topics

Novice question on makefile in yocto environment

Raghu Icecraft Software Trainings
 

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.

Randy MacLeod
 

On 2020-03-29 11:08 p.m., Raghu Icecraft Software Trainings 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.
Did anyone reply off list?

Did you have a look at using the SDK and tips in:

https://www.yoctoproject.org/docs/current/sdk-manual/sdk-manual.html#sdk-adding-makefile-only-software


Also, here's a simple recipe example from the Wind River docs:
https://docs.windriver.com/bundle/Wind_River_Linux_Platform_Developers_Guide_CD/page/mmo1403548803429.html
you should be able to make that work with just oe-core/poky.

If you're still having trouble, post a example Makefile
for 'hello-world' and perhaps someone will help you out.

../Randy


--
# Randy MacLeod
# Wind River Linux

Mike Looijmans
 

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...