AnsweredAssumed Answered

Build error at executing gmake

Question asked by Andre Heinemans on Oct 30, 2017
Latest reply on Oct 31, 2017 by Andre Heinemans

Hi

 

I am trying to build a simulink model using the MCToolbox and program it onto a MPC564xL MCU.

 

At the building process there is a problem with execution of the 'gmake' command. The generated makefile (in this case DigitalIO_block_demo.mk) is using windows batch script as shell whereas the gmake executable seem to use the /bin/sh shell.

 

-- build output ----------
### Processing Template Makefile: F:\MCToolbox\rappid564xl\rappid564xl\rappid_564xl_cw.tmf
### Creating DigitalIO_block_demo.mk from F:\MCToolbox\rappid564xl\rappid564xl\rappid_564xl_cw.tmf
### Building DigitalIO_block_demo: .\DigitalIO_block_demo.bat
F:\MCToolbox\rappid564xl\Examples\DigitalIO_block_demo_rappid_rtw>set MATLAB=C:\Program Files\MATLAB\R2017a
F:\MCToolbox\rappid564xl\Examples\DigitalIO_block_demo_rappid_rtw>"C:\Program Files\MATLAB\R2017a\bin\win64\gmake" -f DigitalIO_block_demo.mk  ISPROTECTINGMODEL=NOTPROTECTING GENERATE_ERT_S_FUNCTION=0 INCLUDE_MDL_TERMINATE_FCN=0 COMBINE_OUTPUT_UPDATE_FCNS=1 MULTI_INSTANCE_CODE=0 INTEGER_CODE=0
clean
RELATIVE_PATH_TO_ANCHOR is ..
==== Removing object files from build directory ====
/usr/bin/sh: -c: line 1: syntax error: unexpected end of file
gmake: *** [clean] Error 258
---------------------------

 

The line in the makefile that troubles is: '@if exist *.o del *.o'.
When I replace it with 'rm -f *.o' and run DigitalIO_block_demo.bat then it builds perfectly. (I attached the original and the altered version of the makefile)

 

What could be the reason that 'gmake' does not interpret the commands as windows batch script commands? My colleage does not have this problem. I have installed MINGW/MSYS on my computer for other projects. Could it be that this interferes with this build process?

 

Kind regards,
Andre Heinemans

Outcomes