Custom build step with multiple inputs in IAR
I have a project in IAR Workbench th开发者_C百科at requires a custom build step to build an intermediate file; this file is put together from a set of other files with a common extension (i.e. there is an intermediate linking step for the input files in a domain specific language).
It appears to me that the "Custom Tool" can only process a single input file at a time; is this true, or is there a checkmark that needs to be set so all files matching the extension list are passed in a single run?
There is no support for having custom build steps which can consume more than one source file at a time. The custom build step works like a compiler, and not like a linker.
Put the files with a common extension into their own group folder. The right-click the group folder and select options, custom build, override inherited settings.
Then you can use a "make" program to generate the intermediate file from all the secondary source files by putting those filenames into a file that make executes.
yes, the make will be run for every file, but since the intermediate file will be newer than all the secondary source files after the first iteration, it won't do much when called for each of the remaining secondary source files.
Not perfect, but should work. Downside is managing the file listing all the input files to create the intermediate file you need.
In newer workbench versions (I checked EWARM 7.60 and newer) the custom build step accepts a list of files for both the input and output of the tool. These file lists are both added to the internal dependency tree.
The file extension for the custom build step does not necessarily need to match the "real" generated files. You can also use a "fake" file (e.g. dummy.step
) to run an external tool with a external batch file, which then provides all necessary files at once to the tool.
The disadvantage of this approach is, that you need to manage the list of files manually and twice (within the external batch file for the tool and within the build step configuration for the correct dependency tree).
精彩评论