Page 1 of 1

how to structure a project to build multiple binaries?

Posted: Mon Feb 18, 2019 4:42 pm
by ecc esp
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.)

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

Posted: Mon Feb 18, 2019 10:20 pm
by ESP_Angus
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.

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

Posted: Tue Feb 19, 2019 5:21 pm
by ecc esp
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.

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

Posted: Wed Feb 20, 2019 12:55 am
by ESP_igrr
With regards to nested test app layout, you may also check https://github.com/espressif/esp-idf/tr ... /unit_test