📄 ex33_pid.mk
字号:
# Copyright 1994-2004 The MathWorks, Inc.
#
# File : accel_vc.tmf $Revision: 1.21.4.11 $
#
# Abstract:
# Accelerator template makefile for building a Windows-based,
# RTW generated mex-file of Simulink model using generated C code
# and the
# Microsoft Visual C/C++ compiler versions 6.0, 7.1
#
# 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. Specify OPT_OPTS=-g to
# create a mex file for debugging.
# MEX_OPTS - User specific mex 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 accel.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 = accel.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.
MODEL = ex33_pid
MODULES = ex33_pid_acc_data.c rt_nonfinite.c
MAKEFILE = ex33_pid.mk
MATLAB_ROOT = C:\MATLAB701
ALT_MATLAB_ROOT = C:\MATLAB701
MATLAB_BIN = C:\MATLAB701\bin\win32
ALT_MATLAB_BIN = C:\MATLAB701\bin\win32
S_FUNCTIONS =
S_FUNCTIONS_LIB =
SOLVER = ode45.c
NUMST = 1
TID01EQ = 0
NCSTATES = 12
MEM_ALLOC = RT_STATIC
BUILDARGS = ADD_MDL_NAME_TO_GLOBALS=1
MODELREFS =
SHARED_SRC =
SHARED_SRC_DIR =
SHARED_BIN_DIR =
SHARED_LIB =
#--------------------------- Model and reference models -----------------------
MODELLIB = ex33_pidlib.lib
MODELREF_LINK_LIBS =
MODELREF_INC_PATH =
RELATIVE_PATH_TO_ANCHOR = ..
MODELREF_TARGET_TYPE = NONE
!if "$(MATLAB_ROOT)" != "$(ALT_MATLAB_ROOT)"
MATLAB_ROOT = $(ALT_MATLAB_ROOT)
!endif
!if "$(MATLAB_BIN)" != "$(ALT_MATLAB_BIN)"
MATLAB_BIN = $(ALT_MATLAB_BIN)
!endif
#--------------------------- Tool Specifications ------------------------------
!include $(MATLAB_ROOT)\rtw\c\tools\vctools.mak
MEX = $(MATLAB_BIN)\mex
CC = $(MATLAB_BIN)\mex -c
LIBCMD = lib
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
# Additional includes
MATLAB_INCLUDES = $(MATLAB_INCLUDES);d:\bookga2005
MATLAB_INCLUDES = $(MATLAB_INCLUDES);d:\bookga2005\ex33_pid_accel_rtw
MATLAB_INCLUDES = $(MATLAB_INCLUDES);$(MATLAB_ROOT)\rtw\c\libsrc
INCLUDE = .;$(RELATIVE_PATH_TO_ANCHOR);$(MATLAB_INCLUDES);$(ADD_INCLUDES);$(INCLUDE);$(MODELREF_INC_PATH)
!if "$(SHARED_SRC_DIR)" != ""
INCLUDE = $(INCLUDE);$(SHARED_SRC_DIR)
!endif
#------------------------ C and MEX optimization options -----------------------
DEFAULT_OPT_OPTS = -O
MEX_OPTS =
OPT_OPTS = $(DEFAULT_OPT_OPTS)
MEX_OPT_OPTS = $(OPT_OPTS) # passed to 'mex -c'
!if "$(MEX_OPTS)" == "-g"
MEX_OPT_OPTS =
!endif
#-------------------------------- Mex Options ---------------------------------
MEX_FLAGS = $(MEX_OPTS) $(MEX_OPT_OPTS) $(MEX_OPT_FILE)
#----------------------------- Source Files -----------------------------------
USER_SRCS =
OBJS = $(MODEL)_acc.obj $(MODULES:.c=.obj) $(USER_SRCS:.c=.obj)
SHARED_OBJS = $(SHARED_SRC:.c=.obj)
#-------------------------- Additional Libraries ------------------------------
LIBS =
!if "$(OPT_OPTS)" == "$(DEFAULT_OPT_OPTS)"
LIBS = $(LIBS) $(MATLAB_ROOT)\rtw\c\lib\win32\rtwlib_rtwsfcn_vc.lib
!else
LIBS = $(LIBS) rtwlib.lib
!endif
LIBUT = $(MATLAB_ROOT)\rtw\c\lib\win32\libut_vc.lib
LIBS = $(LIBS) $(LIBUT)
CMD_FILE = $(MODEL).lnk
GEN_LNK_SCRIPT = $(MATLAB_ROOT)\rtw\c\tools\mkvc_lnk.pl
#--------------------------------- Rules ---------------------------------------
all: set_environment_variables ..\$(MODEL)_acc.dll
..\$(MODEL)_acc.dll : $(OBJS) $(SHARED_LIB) $(LIBS)
@echo ### Linking ...
$(PERL) $(GEN_LNK_SCRIPT) $(CMD_FILE) $(OBJS)
$(MEX) $(MEX_FLAGS) @$(CMD_FILE) $(S_FUNCTIONS_LIB) $(SHARED_LIB) $(LIBS) -outdir ..
@echo ### Created mex file: $(MODEL)_acc.dll
# Look in simulink/src helper files
{$(MATLAB_ROOT)\simulink\src}.c.obj :
@echo ### Compiling $<
$(CC) $(MEX_FLAGS) $<
# Additional sources
{$(MATLAB_ROOT)\rtw\c\libsrc}.c.obj :
@echo ### Compiling $<
$(CC) $(MEX_FLAGS) $<
# Put these rules last, otherwise nmake will check toolboxes first
{..}.c.obj :
@echo ### Compiling $<
$(CC) $(MEX_FLAGS) $(USER_INCLUDES) $<
.c.obj :
@echo ### Compiling $<
@if exist $*.pdb del $*.pdb
@if exist ..\$(MODEL)_acc.pdb del ..\$(MODEL)_acc.pdb
$(CC) $(MEX_FLAGS) $(USER_INCLUDES) $<
!if "$(SHARED_LIB)" != ""
$(SHARED_LIB) : $(SHARED_SRC)
@echo ### Creating $@
@$(CC) $(MEX_FLAGS) -outdir $(SHARED_BIN_DIR)\ @<<
$?
<<
@$(LIBCMD) /nologo /out:$@ $(SHARED_OBJS)
@echo ### Created $@
!endif
set_environment_variables:
@set INCLUDE=$(INCLUDE)
@set LIB=$(LIB)
@set MATLAB=$(MATLAB_ROOT)
# Libraries:
MODULES_rtwlib = \
rt_atan2.obj \
rt_atan232.obj \
rt_backsubcc_dbl.obj \
rt_backsubcc_sgl.obj \
rt_backsubrc_dbl.obj \
rt_backsubrc_sgl.obj \
rt_backsubrr_dbl.obj \
rt_backsubrr_sgl.obj \
rt_enab.obj \
rt_forwardsubcc_dbl.obj \
rt_forwardsubcc_sgl.obj \
rt_forwardsubcr_dbl.obj \
rt_forwardsubcr_sgl.obj \
rt_forwardsubrc_dbl.obj \
rt_forwardsubrc_sgl.obj \
rt_forwardsubrr_dbl.obj \
rt_forwardsubrr_sgl.obj \
rt_hypot.obj \
rt_hypot32.obj \
rt_i32zcfcn.obj \
rt_intrp1flatcd.obj \
rt_intrp1flatcf.obj \
rt_intrp1flatd.obj \
rt_intrp1flatf.obj \
rt_intrp1lincd.obj \
rt_intrp1lincf.obj \
rt_intrp1linxd.obj \
rt_intrp1linxf.obj \
rt_intrp2flatcd.obj \
rt_intrp2flatcf.obj \
rt_intrp2flatd.obj \
rt_intrp2flatf.obj \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -