2
votes

How can I create a custom batch file for my code generated from Simulink model ?

I can see, if I edit and change my template make file from Configuration Parameter Dialog box, I can get the desired make file.

enter image description here

But I want a custom .bat file too, that calls this make file along with other commands.

I have some environment variable to set and run couple of scripts in .bat file, before compilation begins. Based on these outputs from script the code is to be compiled and linked.

Using Matlab Version: 2012b

1

1 Answers

1
votes

Create a STF_wrap_make_cmd_hook that generates your desired modelname.bat file as shown in the example code here (mathworks login necessary).

You will probably also need to write your own make_yourtarget.m file and edit the make command field shown in your screenshot to use that one instead of make_rtw.

Other hooks into the build process are described here, perhaps the 'before_make' will also be useful.