I’m trying to add an extra script that needs to be called every time that the user (me) hits the Build button.
Here’s what I have tried:
At the bottom of my script, I have tried each of these individually:
env.AddPreAction("$BUILD_DIR/src/KiniMain.cpp.o", before_build) - That only runs the script if KiniMain.c is going to be compiled. The timing of the script execution is right, but I want this to get triggered both when there is any changed source files and also when there is no changed source files. I want the script to be executed at this point, always.
env.AddPreAction("$BUILD_DIR/firmware.elf", before_build) - That only runs the script if the firmware.elf files is definitely going to be made. If there are no changes to the source files, then my extra_scripts does not get called. However, this runs my script after the compilation of the source files which is too late for my needs.
env.AddPreAction("buildprog", before_build) - doesn’t run my script at all.
env.AddPreAction("build", before_build) - doesn’t run my script at all.
I’ve tried a few other things too without success, like adding a new target, but I am out of ideas. Any help would be appreciated.
from my extra_scripts file. I didn’t dawn on me that I already had what I needed except that the only work I was doing at the time the script was being executed was to add a preAction function.
Instead, now, when my extra scripts runs, I just do the work I need to do, make any necessary changes to the one header file I am interested in, and the build system will compile the appropriate files, if I’ve made changes to that header, or if there are other changes unrelated that need to be compiled. I’m sure there are edge cases I need to watch for, but for now I’ve made a lot of progress.