Search code examples
matlabmakefilesimulinkmatlab-deployment

Makefile Error in Matlab Real-Time Workshop


I'm using Real-Time Workshop to auto-generate executables for VxWorks, but I am getting an error at the following command:

J:\Tornado\tests\add\add_tornado_rtw>make -f add.mk  GENERATE_REPORT=0 TMW_EXTMODE_TESTING=0 RTWCAPIPARAMS=0 RTWCAPISIGNALS=0 MODELLIB=addlib.lib RELATIVE_PATH_TO_ANCHOR=.. MODELREF_TARGET_TYPE=NONE  
add.mk:345: *** target pattern contains no `%'.  Stop.
### Real-Time Workshop build procedure for model: 'add' aborted due to an error.

Here is the makefile: http://pastebin.com/m5bdf2c4c


Solution

  • I'm guessing that your "make" is Cygwin's make, which does not allow native windows paths with colons in them:

    MATLAB_ROOT         = C:\Program Files\MATLAB\R2008b
    ...
    %.o : $(MATLAB_ROOT)/rtw/c/tornado/%.c
            $(CC) $(CFLAGS) $(RT_MAIN_DEFINES) $<
    

    This will expand to

    %.o : C:\Program Files\MATLAB\R2008b/rtw/c/tornado/%.c
            $(CC) $(CFLAGS) $(RT_MAIN_DEFINES) $<
    

    i.e. make assumes that "C" is the pattern (which it doesn't find a % in).

    Bugzilla report on the matter: https://chess.eecs.berkeley.edu/bugzilla/show_bug.cgi?id=55

    You can download a patched version of make from here: http://www.cmake.org/files/cygwin/make.exe