RTW Programmatically Set Define Flag
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mashrur Alam
am 28 Jan. 2021
Kommentiert: Fangjun Jiang
am 30 Jan. 2021
I am using Simulink to do code gen and build SW for my TI hardware. I am able to successfully build my code by including a custom define flag to the build process:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/502943/image.png)
This ensure that I have this definition in the generated make file
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/502948/image.png)
However I want to include this define programatically. How can I do this through matlab code?
I tried using the below and it did not work
myModelBuildInfo = RTW.BuildInfo;
addDefines(myModelBuildInfo,'-DBOOTLOADER_CAN_FLASH','OPTS');
0 Kommentare
Akzeptierte Antwort
Fangjun Jiang
am 28 Jan. 2021
That info is saved with your model, you can set it up
set_param('ModelName','CustomDefine','-DBOOTLOADER')
4 Kommentare
Fangjun Jiang
am 30 Jan. 2021
depending on your toolchain setting, set 'BuildConfiguration' to be 'Specify', then set the last line of 'CustomToolchainOptions', where you can specify the makefile name in {'-f $(MAKEFILE)'}
>> get_param(bdroot,'BuildConfiguration')
ans =
'Specify'
>> get_param(bdroot,'CustomToolchainOptions')
ans =
1×14 cell array
Columns 1 through 4
{'C Compiler'} {'-c -w -noregist…'} {'Linker'} {'-s -L$(LCC_LIB)…'}
Columns 5 through 8
{'Shared Library …'} {'-dll -entry Lib…'} {'Archiver'} {0×0 char}
Columns 9 through 13
{'Download'} {0×0 char} {'Execute'} {0×0 char} {'Make Tool'}
Column 14
{'-f $(MAKEFILE)'}
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Build Configuration finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!