# Having trouble with Makefiles

**URL:** <https://mangoh.discourse.group/t/having-trouble-with-makefiles/816>\
**Category:** mangOH Green\
**Created:** [October 16, 2017, 7:39am UTC](https://mangoh.discourse.group/t/having-trouble-with-makefiles/816 "2017-10-16T07:39:34Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![WedaPashi](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WedaPashi](https://mangoh.discourse.group/u/WedaPashi)\
**Post date:** [October 16, 2017, 7:39am UTC](https://mangoh.discourse.group/t/having-trouble-with-makefiles/816/1 "2017-10-16T07:39:34Z")

</div>

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](https://source.sierrawireless.com/resources/legato/downloads/)
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](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?

---

<div class="post-metadata">

**Author:** ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)\
**Post date:** [October 16, 2017, 8:17pm UTC](https://mangoh.discourse.group/t/having-trouble-with-makefiles/816/2 "2017-10-16T20:17:41Z")

</div>

Can you follow the Getting Started instructions for mangOH Red:  
[http://mangoh.io/mangoh-red-resources-getting-started](http://mangoh.io/mangoh-red-resources-getting-started)  
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.

---

<div class="post-metadata">

**Author:** ![WedaPashi](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WedaPashi](https://mangoh.discourse.group/u/WedaPashi)\
**Post date:** [October 17, 2017, 6:33am UTC](https://mangoh.discourse.group/t/having-trouble-with-makefiles/816/3 "2017-10-17T06:33:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [October 18, 2017, 2:54am UTC](https://mangoh.discourse.group/t/having-trouble-with-makefiles/816/4 "2017-10-18T02:54:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![WedaPashi](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WedaPashi](https://mangoh.discourse.group/u/WedaPashi)\
**Post date:** [October 31, 2017, 6:14am UTC](https://mangoh.discourse.group/t/having-trouble-with-makefiles/816/5 "2017-10-31T06:14:50Z")

</div>

Thank you @asyal and @dfrey.

---

<div class="post-metadata">

**Author:** ![Pedro.Jurado](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/pedro.jurado/32/600_2.png) [@Pedro.Jurado](https://mangoh.discourse.group/u/Pedro.Jurado)\
**Post date:** [August 24, 2018, 2:30pm UTC](https://mangoh.discourse.group/t/having-trouble-with-makefiles/816/6 "2018-08-24T14:30:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [August 24, 2018, 10:28pm UTC](https://mangoh.discourse.group/t/having-trouble-with-makefiles/816/7 "2018-08-24T22:28:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Pedro.Jurado](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/pedro.jurado/32/600_2.png) [@Pedro.Jurado](https://mangoh.discourse.group/u/Pedro.Jurado)\
**Post date:** [August 31, 2018, 11:23am UTC](https://mangoh.discourse.group/t/having-trouble-with-makefiles/816/8 "2018-08-31T11:23:23Z")

</div>

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.

\*\* ERROR:  
/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](https://mangoh.discourse.group/uploads/short-url/gj82BVs0KboNWCEVYrSdx5k7wZd) (18.3 KB)

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [September 6, 2018, 4:42pm UTC](https://mangoh.discourse.group/t/having-trouble-with-makefiles/816/9 "2018-09-06T16:42:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tadera](https://avatars.discourse-cdn.com/v4/letter/t/f14d63/32.png) [@tadera](https://mangoh.discourse.group/u/tadera)\
**Post date:** [July 28, 2020, 2:12pm UTC](https://mangoh.discourse.group/t/having-trouble-with-makefiles/816/10 "2020-07-28T14:12:21Z")

</div>

I’m also having problems with “makefile” when using a WP76 chip and the mangOH Green.  
I tried both “make wp76” and “make green\_wp76” but both don’t seem to work:

"Bad configuration environment file path: /home/mangoh/workspace/leaf-data/wp76stable/wp76-legato/build/wp76/config.sh’ "

Then I checked the path and saw that there were only the following folders: “tools” and “wp76xx” so I decided to run “make wp76xx” but this also doesn’t work.

Can anyone give me a tip what I can do next?

 ![makefilerror](https://us1.discourse-cdn.com/flex016/uploads/mangoh/original/2X/1/16b6c7e0d2d1842dcbfc09d1736ebfe53e81f258.png) ![makefilerror2](https://us1.discourse-cdn.com/flex016/uploads/mangoh/original/2X/2/26046794ecfe5dbf3931270f4f3d1ec31517072d.png) ![makefilerror3](https://us1.discourse-cdn.com/flex016/uploads/mangoh/original/2X/b/b3eff8002ef1e9d1eb00d63944fe93693f9aed37.png)

---

<div class="post-metadata">

**Author:** ![tadera](https://avatars.discourse-cdn.com/v4/letter/t/f14d63/32.png) [@tadera](https://mangoh.discourse.group/u/tadera)\
**Post date:** [August 3, 2020, 7:09am UTC](https://mangoh.discourse.group/t/having-trouble-with-makefiles/816/11 "2020-08-03T07:09:30Z")

</div>

Does anyone know what the problem is?
