How can I use batch files to create an executable for a model which has model references?
Ältere Kommentare anzeigen
Let's say we have models r1 and r2 where r1 is a model reference inside r2. When we generate code for r2 via Simulink coder - Generate code only, everything works fine and we get the artifacts. In the artifacts, we have a 'r2.bat' file in 'r2_grt_rtw\'.
When we run 'r2_grt_rtw\r2.bat' the make process fails as it does not know how to make or find 'r1' model libraries. Now, the 'r2_grt_rtw\r2.bat' build will pass if we manually make 'r1.bat' found in 'slprj\grt\r1' and we also need to build the shared library using 'slprj\grt\_sharedutils\rtwshared.bat'.
Questions:
- How can I automate this such that the making of model references and shared libraries links these two, i.e. executing 'slprj\grt\r1\r1.bat' and 'slprj\grt\_sharedutils\rtwshared.bat' becomes part of 'r2_grt_rtw\r2.bat'?
- If the first question is not feasible then how can we add custom hooks into 'r2_grt_rtw\r2.bat' or 'r2_grt_rtw\r2.mk' through Simulink Coder, to achieve the execution of 'slprj\grt\r1\r1.bat', 'slprj\grt\_sharedutils\rtwshared.bat' and potentially more model references batch scripts? My assumption here is that hooks in a makefile can help us in executing make commands for referenced models.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Simulink Coder finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!