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!
How to build only SDK?
-
- Posts: 9040
- Joined: Thu Nov 26, 2015 4:08 am
Re: How to build only SDK?
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:
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.Currently even using "make app" the makefiles compile the whole esp-idf.
-
- Posts: 18
- Joined: Tue Sep 14, 2021 2:18 pm
Re: How to build only SDK?
ESP_Sprite wrote: ↑Sat Jan 15, 2022 2:24 amAre 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.
-
- Posts: 9040
- Joined: Thu Nov 26, 2015 4:08 am
Re: How to build only SDK?
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.
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.
-
- Posts: 18
- Joined: Tue Sep 14, 2021 2:18 pm
Re: How to build only SDK?
Thanks for the answer!!ESP_Sprite wrote: ↑Wed Jan 19, 2022 3:13 amSorry, 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.
now its clear that we should use Cmake and idf.py build