# Building a custom app into Legato

**URL:** <https://forum.legato.io/t/building-a-custom-app-into-legato/6450>\
**Category:** Legato Application Framework\
**Created:** [March 3, 2023, 3:58pm UTC](https://forum.legato.io/t/building-a-custom-app-into-legato/6450 "2023-03-03T15:58:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![leon.fung](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@leon.fung](https://forum.legato.io/u/leon.fung)\
**Post date:** [March 3, 2023, 3:58pm UTC](https://forum.legato.io/t/building-a-custom-app-into-legato/6450/1 "2023-03-03T15:58:34Z")

</div>

Hi, Currently I upload my application to the WP76xx via `app update custom.app.wp76xx.update 192.168.2.2`

Now I want include my application into Legato and build it all together as a single legato.cwe.  
I’ve created a folder in LegatoAF/Apps/ with all the files copied over from my custom application e.g. customapp.sdef, apps, components and interfaces. and also modified default.sdef to include `$LEGATO_ROOT/apps/customapp.sdef` but `make build wp76xx` fail.

Is there something I’m missing with including my application to Legato?  
Do I need to make my own cmake and makefile for the application as well?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [March 3, 2023, 4:00pm UTC](https://forum.legato.io/t/building-a-custom-app-into-legato/6450/2 "2023-03-03T16:00:08Z")

</div>

you can see here to modify wifi.sdef:

> [@Flash size wp7607](https://forum.legato.io/t/flash-size-wp7607/3805/35):
>
> you can go to legato-19.02.0/modules/WiFi/wifi.sdef, under “apps:” section, add e.g. $LEGATO\_ROOT/apps/sample/helloWorld/helloWorld.adef [image] Now the new app will be included in legato.cwe. Please also note that the max size for legato partition is 8MB.

---

<div class="post-metadata">

**Author:** ![leon.fung](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@leon.fung](https://forum.legato.io/u/leon.fung)\
**Post date:** [March 6, 2023, 11:10am UTC](https://forum.legato.io/t/building-a-custom-app-into-legato/6450/3 "2023-03-06T11:10:24Z")

</div>

I made a mistake in the original post and got mixed up with defining what I have, it is a custom system and not a custom app.  
So what I really want to do is to include my custom system into the legato and NOT an application.

Would modifying wifi.sdef to include customsystem.sdef work?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [March 6, 2023, 12:55pm UTC](https://forum.legato.io/t/building-a-custom-app-into-legato/6450/4 "2023-03-06T12:55:14Z")

</div>

Then why don’t you copy the content of your custom sdef to wifi.sdef?

---

<div class="post-metadata">

**Author:** ![leon.fung](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@leon.fung](https://forum.legato.io/u/leon.fung)\
**Post date:** [March 6, 2023, 1:39pm UTC](https://forum.legato.io/t/building-a-custom-app-into-legato/6450/5 "2023-03-06T13:39:11Z")

</div>

I put the custom system folder into /modules/wifi and replaced the contents of wifi.sdef with customsystem.sdef, and modified the paths in the .sdef

This got my system to build. 😄

Why does it build when wifi.sdef it is used but not customsystem.sdef?  
Are there any other methods (aside from using .update) of embedding my system into legato without having to renaming it to wifi.sdef?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [March 6, 2023, 3:16pm UTC](https://forum.legato.io/t/building-a-custom-app-into-legato/6450/6 "2023-03-06T15:16:48Z")

</div>

I don’t know, not sure if you can modify default.sdef, you can give a try

---

<div class="post-metadata">

**Author:** ![leon.fung](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@leon.fung](https://forum.legato.io/u/leon.fung)\
**Post date:** [March 10, 2023, 5:16pm UTC](https://forum.legato.io/t/building-a-custom-app-into-legato/6450/7 "2023-03-10T17:16:15Z")

</div>

My workaround to not use wifi module is to modify the makefile and kconfig in LegatoAF.

In makefile and kconfig, add an instance of your ‘custom system’ at every location where wifi is called.

It’s not the best solution but it works for me. It seems like WiFi module is added to .config.wp76xx (the config file to assisting building) then overwritten by the custom system.

To answer a previous question I asked, Makefile and Kconfig do not need to be present in the custom system.
