Control Build Process Compiling and Linking
After generating code for a model, the build process determines whether to compile and link an executable program. Various factors guide this determination:
- Generate code only option - When you select this option, the code generator produces code for the model, including a makefile. 
- Generate makefile option - When you clear this option, the code generator does not produce a makefile for the model. You must specify post code generation processing, including compilation and linking, as a user-defined command, as explained in Customize Post-Code-Generation Build Processing. 
- Makefile-only target - The Microsoft® Visual C++® Project Makefile versions of the - grtand Embedded Coder® target configurations generate a Visual C++ project makefile (- model.mak- model.mak
- HOSTtemplate makefile variable- The template makefile variable - HOSTidentifies the type of system upon which your executable is intended to run. The variable can be set to one of three possible values:- PC,- UNIX, or- ANY.- By default, - HOSTis set to- UNIXin template makefiles designed for use with The Open Group UNIX® platforms (such as- grt_unix.tmf), and to- PCin the template makefiles designed for use with development systems for the PC (such as- grt_vcx64.tmf).- If the Simulink® software is running on the same type of system as the system specified by the - HOSTvariable, then the executable is built. Otherwise,- If - HOST = ANY, an executable is still built. This option is useful when you want to cross-compile a program for a system other than the one that the Simulink software is running on.
- Otherwise, processing stops after generating the model code and the makefile; the following message is displayed on the MATLAB® command line. - ### Make will not be invoked - template makefile is for a different host