Having trouble with Makefiles


Hi, I am very new to mangOH and legato based development, I have started off just a week ago.

Existing system:

  1. I have installed legato17-08.1 on my host (linux - ubuntu16.04 LTS) computer, used a zip, did not clone.
  2. I have installed latest toolchain (Release 14) from here
  3. I have installed legato application developer studio version 5.2.
  4. I have a mangOH Green board with me, it has a WP8548 chip on it and I have tested it with helloWorld program that I built and deployed on the device using legato application developer studio version 5.2.
  5. I am aware of the process of running ‘bin/legs’ everytime I open a terminal for supporting commands related to legato.
  6. I have set the environment variable LEGATO_ROOT to the directory where I have installed legato-17.08.1

Problem statement:
I have tried many examples (Latest being: https://github.com/startwithsierra/utils-legato-mqtt). But I can not build them.

The error that I see in bash is:

Makefile:7: recipe for target 'wp85' failed
make: *** [wp85] Error 1

Can anyone help me understand what the issue is?

Config toolchain wp85

Can you follow the Getting Started instructions for mangOH Red:
the only difference is, you need to run:
make green_wp85 instead of make red_wp85

Let us know if you see the same problem.


Hi, thanks for responding. The solution that you suggested does make sense, but I have already built the legato using ‘make clean’ and ‘make wp85’ commands when I installed legato.
After I posted this question, I tried putting the example apps (received as .zip from git and then unzipped) in $LEGATO_ROOT/bin/apps/sample/ and then make command (make wp85) worked as it should.

Is that a constraint (Possibly due to some error I made while installation of legato) I am dealing with that I have to put the projects into the LEGATO_ROOT/apps/sample/ or it has always been the way to do it?

Thank you.


It’s a bit confusing, but you have to run make wp85 from the legato folder first. Then you do source bin/configlegatoenv to put the legato build tools into your $PATH. Once you have done that, you either run make red_wp85 or make green_wp85 from the mangOH folder. This builds a legato system that includes the mangOH apps and drivers.


Thank you @asyal and @dfrey.


Hello, I have been a couple of days setting this up, I decided to get a clean install of Ubuntu and followed the tutorials since the precompiled image did not work for me.
I have followed all instructions to the letter except last part of step 7 (l) in setting up legato since the module I’m using is a wp76. Now the problem is when running the make red_wp76 after it builds it gives me this message:
ninja: build stopped: subcommand failed.
Makefile.framework:147 recipe for target ‘liblegato’ failed
make[2]: *** [liblegato] Error 1
make[2]: Leaving directory ‘/home/pedro/legato_framework/legato’
Makefile:376: recipe for target ‘framework_wp76xx’ failed
make[1]: *** [framework_wp76xx] Error 2
make[1]: Leaving directory ‘/home/pedro/legato_framework/legato’
Makefile:34: recipe for target ‘legato_wp76xx’ failed
make: *** [legato_wp76xx] Error 2

Any help on this would be appreciated, I don’t think I have missed anything in the tutorials so I don’t really know whats going wrong the board I have is the MangOH_Red WP7607G.
Thanks in advance.


I think you probably have an error message earlier in the output.


Hello, I’m still having problems when using the “make red_wp76xx” this is the 5th time I run through the tutorial in a brand new Linux system the error seems to be different this time.

/home/pedro/legato_framework/legato/drivers/spisvc/spisvc.mdef: error: ‘/opt/swi/y22-ext/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel’ is not a valid kernel source directory.
Makefile:82: recipe for target ‘red_wp76xx’ failed
make: *** [red_wp76xx] Error 1

please i need some help with this I have been trying to make the board work for over a week now with no success I’m attaching the entire output here: Error_when_make_red_wp76xx (18.3 KB)


@Pedro.Jurado: Please show me the output of ls -l /opt/swi/