Custom Target - execute a firmware build


I would like to setup a custom target. Before executing it’s code it would have to launch a firmware build. How can i programatically request the firmware build ?
The concerned chip is the esp8266 and the firmware size is to big for OTA, thus i have to upload prior a small sized firmware and then upload the final firmware.


I finaly managed to include the firmware build dependency.

My custom target had to look like this: