Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Build a simulink model with RTW with s-function
Date: Mon, 9 Nov 2009 15:20:20 +0000 (UTC)
Organization: Delphi Diesel Systems
Lines: 21
Message-ID: <hd9bvk$fsu$1@fred.mathworks.com>
References: <hd12j6$r88$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257780020 16286 172.30.248.35 (9 Nov 2009 15:20:20 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 9 Nov 2009 15:20:20 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1071163
Xref: news.mathworks.com comp.soft-sys.matlab:583569


"Massimiliano " <massimiliano.cialdiNOSP@Mpowersoft.it> wrote in message <hd12j6$r88$1@fred.mathworks.com>...
> I have a simple simulink model model containing an s-function that refers to a c file called SG_c.c.
> 
> I build RT windows target. I get the following error
> 
> gmake: *** No rule to make target `SG_c.obj', needed by `../rtwinIdent1.rwd'.  Stop. 
> 
> So I compile SG_c.c by hand whith the following command line:
> wcc386 -fo=SG_c.obj -wcd=202 -wcd=302 -wcd=400 -wcd=1180 -zq -ei -zp8 -6r -fpi87 -zl -wx  -oneatxh  -DEXT_MODE -DUSE_RTMODEL -DMODEL=rtwinIdent1 -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -D__OBSCURE_STREAM_INTERNALS  -I.;..;F:\PROGRA~1\MATLAB\R2008b\simulink\include;F:\PROGRA~1\MATLAB\R2008b\extern\include;F:\PROGRA~1\MATLAB\R2008b\rtw\c\src;F:\PROGRA~1\MATLAB\R2008b\rtw\c\src\ext_mode\common;F:\PROGRA~1\MATLAB\R2008b\toolbox\rtw\targets\rtwin\src;F:\PROGRA~1\MATLAB\R2008b\toolbox\rtw\targets\rtwin\openwat\include;<etc...> SG_c.c 
> 
> after that step all works.
> 
> How can I configure RTW builder to include SG_c.c in sources list, to make it comile automagically?
> 
> thanks

Massimiliano,
the s-funct block has a parameter called "sfunctionmodules" specifically for defining this sort of dependencies (at least in previous versions - I'm not running yours, but hopefully it still works).
You can use set_param / get_param to access it from m-scripts as usual.
HTH 
Riccardo