How to add code generation target?
Posted: Mon Mar 04, 2019 10:26 am
I need to generate header files at compile time. As https://docs.espressif.com/projects/esp ... onentbuild claims it can be done using Makefile.componentbuild file. However there are no examples and I can not find any in the web.
I have tried to use additional component for that which overrides build and clean targets and sets COMPONENT_ADD_LDFLAGS to empty string. Unfortunately ESP-IDF build system still tries to do something with component's library which is not created in the case of pure code generating component.
As a last resort I can think of a custom target which will be executed before building sources. I don't want to create explicit dependencies for sources on this code generation target since there are quite a lot of files which include generated header and it is tedious to manage these deps manually. Therefore I would like to have this target always built before build target is executed but I don't really know how to do that.
I am talking about Make build system.
Thanks!
I have tried to use additional component for that which overrides build and clean targets and sets COMPONENT_ADD_LDFLAGS to empty string. Unfortunately ESP-IDF build system still tries to do something with component's library which is not created in the case of pure code generating component.
As a last resort I can think of a custom target which will be executed before building sources. I don't want to create explicit dependencies for sources on this code generation target since there are quite a lot of files which include generated header and it is tedious to manage these deps manually. Therefore I would like to have this target always built before build target is executed but I don't really know how to do that.
I am talking about Make build system.
Thanks!