I am trying to figure out how to modify the contents of the auto generated Makefile in ARM DS. Currently it deletes all .o, .d, and .axf files.
My linker creates some .txt files and a binary and I have a post-build command that produces an image file. I want to force the make clean to also include the linker outputs and the application image. Is the auto-generated makefile modifiable so that I can add those files to the clean function or do I need to write a script that does this?
HiMy name is Stephen and I work at Arm.The auto-generated makefiles are not directly modifiable by the user, but only indirectly when changing options via the GUI.I'm not aware of any way to force the auto-generated makefiles to clean away artifacts created from a post-build step.To clean away artifacts created from a post-build step, some options for you are to:1) add a pre-build step to delete them, or2) change the default build command (in Properties > C/C++ Build) so that instead of invoking make, it calls a script that first deletes them and then calls make, or3) write a hand-crafted makefile that does what you need, then change your project to be a makefile-builder project (to use the hand-crafted makefile) rather than a managed-builder project (which auto-generates its own makefiles). There are plenty of examples of hand-crafted makefiles in the supplied Arm DS examples.Hope this helpsStephen
Hi Stephen, I did get the second option to work but it adds an extra layer. Looking at the auto-generated makefile I see that there are arguments that you can set through these files:
OPTIONAL_TOOL_DEPS := \$(wildcard ../makefile.defs) \$(wildcard ../makefile.init) \$(wildcard ../makefile.targets) \We use the makefile.defs file to build our .axf so I just want to make sure you couldn't do something like for the clean function.
Right now the clean function populates everything without the use of an input variable so just want to confirm there is nothing like this that you can do.
clean:
-$(RM) *list of all .o, .d, .axf file* vs ideal: -$(RM) *{INPUT_VAR}