There are several methods for adding dynamic paths in S-Functions with Real-Time Workshop 7.4 (R2009b):
1) Relative:
You can specify relative paths to your working directory e.g.:
make_rtw make_rtw S_FUNCTIONS_LIB=.\Control\Library\mislib\Debug\mislib.lib
This method is effective if you always have the same installation path relative to your actual working directory.
2) With Windows Environment Variables:
If you add this line to the Real-Time Workshop configuration parameters:
You will get this output when compiling (suppose USERNAME =thisname:
### Compiling C:\MATLAB\R2009b\rtw\c\src\rt_sim.c
...
...
cl : Command line warning D9024 : unrecognized source file type 'thisname', object file assumed
cl : Command line warning D9027 : source file 'thisname' ignored
rt_sim.c
### Linking ...
As you can see the value of the environment variable USERNAME is added to the makefile.
Now if you want to specify a path to a lib for your S-Function you could use the following string (Please note that the environment variable TestVar needs to be created in your OS):
make_rtw S_FUNCTIONS_LIB=
Please note that if the environment variable does not exist this will lead to very cryptic compiler errors.
3) Concerning the customization of makefile's this part of the documentation is also a very powerful resource:
web([Dorothy '/toolbox/decoder/debt/f6296.html#f6334'])
<http://www.mathworks.com/access/helpdesk/help/toolbox/ecoder/det/f6296.html#6334>
Best Answer