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: Fri, 6 Nov 2009 13:03:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 56
Message-ID: <hd16q7$pec$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 1257512583 26060 172.30.248.35 (6 Nov 2009 13:03:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 6 Nov 2009 13:03:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2079977
Xref: news.mathworks.com comp.soft-sys.matlab:583000


"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?

I have some other infos
I use:
Matlab 7.7.0.471 (R2008b)

Sept 17,2008



Simulink 7.2 (R2008b)

Aug 04, 2008



RTW 7.2 (R2008b)

Aug 04, 2008


And I want to compile a RT Windows Target

I have a directory where my model is, called model_dir.
In model_dir there are my simulink model (rtwinIdent1.mdl) and s-function c file SG_c.c

When I build with Ctrl+B, are created 2 subdirs: slprj and rtwinIdent1_rtwin where are created all source files needed to compile the target: are created some .c and .h files and make file rtwinIdent1.mk

When build it enters rtwinIdent1_rtwin directory and calls gmake as follows:
"F:\PROGRA~1\MATLAB\R2008b\bin\win32\gmake" -f rtwinIdent1.mk  GENERATE_REPORT=0 EXTMODE_STATIC_ALLOC=0 EXTMODE_STATIC_ALLOC_SIZE=1000000 TMW_EXTMODE_TESTING=0

unfortunatelly make file contains a line like this:
S_FUNCTIONS          := SG_c.c

So whel it build it cannot find SG_c.c because it is placed on the upper directory.
How can makefile be generated with correct referenze to SG_c.c file? Where I am wrong?

I can use 2 workarounds:
1) I make the build process to only generate file, then I edit rtwinIdent1.mk to get the line
S_FUNCTIONS          := ../SG_c.c
and then calls gmake from dos command line with correct parameters
2) I copy SG_c.c into rtwinIdent1_rtwin directory

thanks