how to structure a project to build multiple binaries?

ecc esp
Posts: 8
Joined: Mon Jan 28, 2019 10:18 pm

how to structure a project to build multiple binaries?

Postby ecc esp » Mon Feb 18, 2019 4:42 pm

I would like to build a number of small utilities and test programs along with the main application in my project. Can anyone point me at an example or "best practice" of how to use the build system to do this? (Preferably using GNU make rather than CMake.)

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: how to structure a project to build multiple binaries?

Postby ESP_Angus » Mon Feb 18, 2019 10:20 pm

Are the utilities and test programs firmware which runs on the ESP32?

If so, then suggest having multiple project directories which share a common "components" directory (the EXTRA_COMPONENT_DIRS variable can be used for this).

It doesn't seem to be mentioned in the docs, but you can also have the Makefiles for the smaller tools set the SDKCONFIG variable to the path of the main project sdkconfig (near the top of the makefile), in order to share one config.

If they're to run on the host, I'm afraid you'll have to make separate standalone makefiles for them.

ecc esp
Posts: 8
Joined: Mon Jan 28, 2019 10:18 pm

Re: how to structure a project to build multiple binaries?

Postby ecc esp » Tue Feb 19, 2019 5:21 pm

The tests and utilities are also ESP32 applications. The issue is how to organize them in a github repo -- they only make sense along with the "main" application, so should somehow be in the same repo. I was thinking the top-level of the repo should be the top level of the project, but I guess I'll follow your suggestion and just have multiple ESP-IDF projects in one repo.

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: how to structure a project to build multiple binaries?

Postby ESP_igrr » Wed Feb 20, 2019 12:55 am

With regards to nested test app layout, you may also check https://github.com/espressif/esp-idf/tr ... /unit_test

Who is online

Users browsing this forum: No registered users and 80 guests