How to build only SDK?

hustenhabas
Posts: 18
Joined: Tue Sep 14, 2021 2:18 pm

How to build only SDK?

Postby hustenhabas » Fri Jan 14, 2022 2:41 pm

Hello dear coders. I would like to know how can I use GNU make to build only the esp-idf SDK and then build my app in a separate way. Currently even using "make app" the makefiles compile the whole esp-idf. I need to make my project build independent from the SDK.

How can I compile only the SDK files?
How can I link the SDK compiled files to my custom app make?

Thanks!

ESP_Sprite
Posts: 9014
Joined: Thu Nov 26, 2015 4:08 am

Re: How to build only SDK?

Postby ESP_Sprite » Sat Jan 15, 2022 2:24 am

Are you asking this for compilation speed reasons, or do you have another reason you want to have a precompiled idf? If for speed reasons:
Currently even using "make app" the makefiles compile the whole esp-idf.
That should not happen; CMake should only build the changed source files and their dependencies. One exception is if you change an option in menuconfig; that touches most of the sources you get a near-full rebuild. I'd like to hear more about your setup if that's the issue.

hustenhabas
Posts: 18
Joined: Tue Sep 14, 2021 2:18 pm

Re: How to build only SDK?

Postby hustenhabas » Tue Jan 18, 2022 4:59 pm

ESP_Sprite wrote:
Sat Jan 15, 2022 2:24 am
Are you asking this for compilation speed reasons, or do you have another reason you want to have a precompiled idf? If for speed reasons:

It's for project organization and build pattern of my company. I need create a make command for the SDK to build the .o files and a diferent make command to compile my project and link with the precompiled library. Currently the esp-idf/make/project.mk compile both of them and automatically creates the .elf and .bin.

ESP_Sprite
Posts: 9014
Joined: Thu Nov 26, 2015 4:08 am

Re: How to build only SDK?

Postby ESP_Sprite » Wed Jan 19, 2022 3:13 am

Sorry, there's no 'nice' way to do this. Arduino uses this, but their way to compile the libraries is to simply compile a 'hello world' app and copy out the resulting .a files. ESP-IDF however doesn't really have a way in which you can feed it the SDK .a files and it runs a compile from that, so you'd have to hack the build system to accept that.

Also note that using 'make' for building esp-idf applications is deprecated; for ESP-IDF 4 it already doesn't work for new chips (S3, C3, ...) and for ESP-IDF 5 we'll remove it entirely.

hustenhabas
Posts: 18
Joined: Tue Sep 14, 2021 2:18 pm

Re: How to build only SDK?

Postby hustenhabas » Wed Jan 19, 2022 4:20 pm

ESP_Sprite wrote:
Wed Jan 19, 2022 3:13 am
Sorry, there's no 'nice' way to do this. Arduino uses this, but their way to compile the libraries is to simply compile a 'hello world' app and copy out the resulting .a files. ESP-IDF however doesn't really have a way in which you can feed it the SDK .a files and it runs a compile from that, so you'd have to hack the build system to accept that.
Thanks for the answer!!
now its clear that we should use Cmake and idf.py build

Who is online

Users browsing this forum: No registered users and 129 guests