📄 ipa_control.mk
字号:
# Copyright 1994-2000 The MathWorks, Inc.
#
# File : grt_vc.tmf $Revision: 1.58 $
#
# Abstract:
# Real-Time Workshop template makefile for building a WindowsNT-based
# stand-alone generic real-time version of Simulink model using
# generated C code and the
# Microsoft Visual C/C++ compiler versions: 5.0, 6.0
#
# Note that this template is automatically customized by the Real-Time
# Workshop build procedure to create "<model>.mk"
#
# The following defines can be used to modify the behavior of the
# build:
#
# OPT_OPTS - Optimization option. Default is -O2. To enable
# debugging specify as OPT_OPTS=-Zd.
# OPTS - User specific options.
# USER_SRCS - Additional user sources, such as files needed by
# S-functions.
# USER_INCLUDES - Additional include paths
# (i.e. USER_INCLUDES="-Iwhere-ever -Iwhere-ever2")
#
# This template makefile is designed to be used with a system target
# file that contains 'rtwgensettings.BuildDirSuffix' see grt.tlc
#------------------------ Macros read by make_rtw -----------------------------
#
# The following macros are read by the Real-Time Workshop build procedure:
#
# MAKECMD - This is the command used to invoke the make utility
# HOST - What platform this template makefile is targeted for
# (i.e. PC or UNIX)
# BUILD - Invoke make from the Real-Time Workshop build procedure
# (yes/no)?
# SYS_TARGET_FILE - Name of system target file.
MAKECMD = nmake
HOST = PC
BUILD = yes
SYS_TARGET_FILE = grt.tlc
#---------------------- Tokens expanded by make_rtw ---------------------------
#
# The following tokens, when wrapped with "|>" and "|<" are expanded by the
# Real-Time Workshop build procedure.
#
# MODEL_NAME - Name of the Simulink block diagram
# MODEL_MODULES - Any additional generated source modules
# MAKEFILE_NAME - Name of makefile created from template makefile <model>.mk
# MATLAB_ROOT - Path to were MATLAB is installed.
# MATLAB_BIN - Path to MATLAB executable.
# S_FUNCTIONS - List of S-functions.
# S_FUNCTIONS_LIB - List of S-functions libraries to link.
# SOLVER - Solver source file name
# NUMST - Number of sample times
# TID01EQ - yes (1) or no (0): Are sampling rates of continuous task
# (tid=0) and 1st discrete task equal.
# NCSTATES - Number of continuous states
# BUILDARGS - Options passed in at the command line.
# MULTITASKING - yes (1) or no (0): Is solver mode multitasking
# EXT_MODE - yes (1) or no (0): Build for external mode
MODEL = IPa_control
MODULES =
MAKEFILE = IPa_control.mk
MATLAB_ROOT = D:\MATLABR12
MATLAB_BIN = D:\MATLABR12\bin\win32
S_FUNCTIONS =
S_FUNCTIONS_LIB =
SOLVER = ode5.c
NUMST = 2
TID01EQ = 1
NCSTATES = 3
BUILDARGS =
MULTITASKING = 0
EXT_MODE = 0
#--------------------------- Tool Specifications ------------------------------
!include $(MATLAB_ROOT)\rtw\c\tools\vctools.mak
PERL = $(MATLAB_ROOT)\sys\perl\win32\bin\perl
#------------------------------ Include/Lib Path ------------------------------
MATLAB_INCLUDES = $(MATLAB_ROOT)\simulink\include
MATLAB_INCLUDES = $(MATLAB_INCLUDES);$(MATLAB_ROOT)\extern\include
MATLAB_INCLUDES = $(MATLAB_INCLUDES);$(MATLAB_ROOT)\rtw\c\src
MATLAB_INCLUDES = $(MATLAB_INCLUDES);$(MATLAB_ROOT)\rtw\c\libsrc
# Additional file include paths
INCLUDE = ..;$(MATLAB_INCLUDES);$(VC_INCLUDE)
#------------------------ External mode ---------------------------------------
# uncomment -DVERBOSE to have information printed to stdout
!if $(EXT_MODE) == 1
EXT_SRC = ext_svr.c updown.c ext_svr_transport.c
EXT_CC_OPTS = -DEXT_MODE # -DVERBOSE
EXT_LIB = wsock32.lib
!else
EXT_SRC =
EXT_CC_OPTS =
EXT_LIB =
!endif
#----------------- Compiler and Linker Options --------------------------------
# Optimization Options
# Set OPT_OPTS=-Zd for debugging
OPT_OPTS = $(DEFAULT_OPT_OPTS)
# General User Options
OPTS =
CC_OPTS = $(OPT_OPTS) $(OPTS) $(EXT_CC_OPTS)
CPP_REQ_DEFINES = -DMODEL=$(MODEL) -DRT -DNUMST=$(NUMST) \
-DTID01EQ=$(TID01EQ) -DNCSTATES=$(NCSTATES) \
-DMT=$(MULTITASKING) -DHAVESTDIO
# Uncomment this line to move warning level to W4
# cflags = $(cflags:W3=W4)
CFLAGS = $(CC_OPTS) $(CPP_REQ_DEFINES) $(USER_INCLUDES) \
$(cflags) $(cvars)
LDFLAGS = $(ldebug) $(conflags) $(EXT_LIB) $(conlibs)
#----------------------------- Source Files -----------------------------------
REQ_SRCS = $(MODEL).c $(MODULES) grt_main.c rt_sim.c rtwlog.c rt_nonfinite.c \
$(SOLVER) $(EXT_SRC)
USER_SRCS =
SRCS = $(REQ_SRCS) $(USER_SRCS) $(S_FUNCTIONS)
OBJS = $(SRCS:.c=.obj)
!if "$(OPT_OPTS)" == "$(DEFAULT_OPT_OPTS)"
RTWLIB = $(MATLAB_ROOT)\rtw\c\lib\win32\rtwlib_vc.lib
!else
RTWLIB = rtwlib.lib
!endif
LIBSRC = $(MATLAB_ROOT)\rtw\c\libsrc
CMD_FILE = $(MODEL).lnk
GEN_LNK_SCRIPT = $(MATLAB_ROOT)\rtw\c\tools\mkvc_lnk.pl
#--------------------------------- Rules --------------------------------------
..\$(MODEL).exe : set_environment_variables $(OBJS) $(RTWLIB)
@echo ### Linking ...
$(PERL) $(GEN_LNK_SCRIPT) $(CMD_FILE) $(OBJS)
$(LD) $(LDFLAGS) $(RTWLIB) $(S_FUNCTIONS_LIB) @$(CMD_FILE) -out:$@
@del $(CMD_FILE)
@echo ### Created executable $(MODEL).exe
{$(MATLAB_ROOT)\rtw\c\grt}.c.obj :
@echo ### Compiling $<
$(CC) $(CFLAGS) $<
{$(MATLAB_ROOT)\rtw\c\src}.c.obj :
@echo ### Compiling $<
$(CC) $(CFLAGS) $<
# Additional sources
# Look in simulink/src helper files
{$(MATLAB_ROOT)\simulink\src}.c.obj :
@echo ### Compiling $<
$(CC) $(CFLAGS) $<
# Put these rule last, otherwise nmake will check toolboxes first
{..}.c.obj :
@echo ### Compiling $<
$(CC) $(CFLAGS) $<
.c.obj :
@echo ### Compiling $<
$(CC) $(CFLAGS) $<
set_environment_variables:
@set INCLUDE=$(INCLUDE)
@set LIB=$(LIB)
# Libraries:
rtwlib.lib: rtw_proj.tmw $(MAKEFILE)
@echo ### Creating rtwlib.lib
@SET MATLAB=$(MATLAB_ROOT)
@SET RTW_CC=$(CC)
@SET RTW_CFLAGS=$(CFLAGS)
@SET RTW_LIBCMD=$(LIBCMD) /nologo /out:$@
$(PERL) $(LIBSRC)\mklib.pl $(LIBSRC) $@
#----------------------------- Dependencies -----------------------------------
$(OBJS) : $(MAKEFILE) rtw_proj.tmw
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -