Page 1 of 1

Building multiple targets inside the same project

Posted: Fri Mar 08, 2019 9:17 am
by bobcatt
Hi

I have an esp-idf project for which I would like to compile two bin (firmware) files, each containing their own void app_main().

What I would like to have is something like this :
  • main_app.c with my main application
  • factory_app.c with a minimal application
Then, when I do make all, I get:
  • project_name.(bin|elf) as per usual
  • factory_app.(bin|elf) as a 2nd esp-32 firmware for factory purpose
Could someone give any pointer on this please?

Re: Building multiple targets inside the same project

Posted: Fri Mar 08, 2019 3:46 pm
by PeterR
This illustrates one approach where two builds share the same source code:
https://github.com/espressif/esp-idf/tr ... /unit_test

If you need conditional compilation within some of the files then add a compilation flag.
I think cleaner this way than all in one directory:
/project/production
/project/factory
etc