📄 exm09222_2.mk
字号:
# Copyright 1994-2000 The MathWorks, Inc.
#
# File : accel_lcc.tmf $Revision: 1.12 $
#
# Abstract:
# Accelerator template makefile for building a PC-based,
# RTW generated mex-file of Simulink model using generated C code.
# LCC compiler version 2.4.
#
# This makefile attempts to conform to the guidelines specified in the
# IEEE Std 1003.2-1992 (POSIX) standard. It is designed to be used
# with GNU Make (gmake) which is located in matlabroot/rtw/bin/win32.
#
# 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:
#
# MEX_OPTS - User specific mex options.
# OPT_OPTS - Optimization options. Default is none. To enable
# debugging specify as OPT_OPTS=-g.
# 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")
# (For Lcc, have a '/'as file seperator before the
# file name instead of a '\' .
# i.e., d:\work\proj1/myfile.c - reqd for 'gmake')
#
# 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 = "%MATLAB%\rtw\bin\win32\gmake"
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 = exm09222_2
MODULES =
MAKEFILE = exm09222_2.mk
MATLAB_ROOT = F:\QIULIN\MATLAB6
MATLAB_BIN = F:\QIULIN\MATLAB6\bin\win32
S_FUNCTIONS =
S_FUNCTIONS_LIB =
SOLVER =
NUMST = 1
TID01EQ =
NCSTATES = 0
MEM_ALLOC = RT_STATIC
BUILDARGS =
#--------------------------- Tool Specifications -------------------------------
LCC = $(MATLAB_ROOT)\sys\lcc
include $(MATLAB_ROOT)\rtw\c\tools\lcctools.mak
MEX = $(MATLAB_BIN)\mex.bat
CC = $(MATLAB_BIN)\mex.bat -c
#------------------------------ Include Path -----------------------------------
# Additional includes
ADD_INCLUDES = \
# see MATLAB_INCLUES and COMPILER_INCLUDES from lcctool.mak
INCLUDES = -I. -I.. $(MATLAB_INCLUDES) $(ADD_INCLUDES) \
$(COMPILER_INCLUDES) $(USER_INCLUDES)
#------------------------ C and MEX optimization options -----------------------
MEX_OPTS =
OPT_OPTS = $(DEFAULT_OPT_OPTS)
MEX_OPT_OPTS = $(OPT_OPTS) # passed to 'mex -c'
ifeq "$(MEX_OPTS)" "-g"
MEX_OPT_OPTS =
endif
#-------------------------------- Mex Options ---------------------------------
MEX_OPT_FILE = -f $(MATLAB_BIN)\mexopts\lccopts.bat
MEX_FLAGS = $(MEX_OPT_OPTS) $(MEX_OPTS) $(MEX_OPT_FILE)
#----------------------------- Source Files -----------------------------------
USER_SRCS =
USER_OBJS = $(USER_SRCS:.c=.obj)
LOCAL_USER_OBJS = $(notdir $(USER_OBJS))
SRCS = $(MODEL)_acc.c $(MODULES)
OBJS = $(SRCS:.c=.obj) $(USER_OBJS)
LINK_OBJS = $(SRCS:.c=.obj) $(LOCAL_USER_OBJS)
ifeq ($(OPT_OPTS),$(DEFAULT_OPT_OPTS))
RTWLIB = $(MATLAB_ROOT)\rtw\c\lib\win32\rtwlib_rtwsfcn_lcc.lib
else
RTWLIB = rtwlib.lib
endif
LIBSRC = $(MATLAB_ROOT)\rtw\c\libsrc
MKLIB_PL = $(LIBSRC)\mkliblcc.pl
PROGRAM = ../$(MODEL)_acc.dll
#--------------------------------- Rules --------------------------------------
$(PROGRAM) : $(OBJS) $(RTWLIB)
@echo ### Linking ...
$(MEX) $(MEX_FLAGS) -outdir .. $(LINK_OBJS) $(RTWLIB) $(S_FUNCTIONS_LIB)
@echo ### Created mex file: $(MODEL)_acc.dll
%.obj : %.c
$(CC) $(MEX_FLAGS) $(INCLUDES) $<
%.obj : ../%.c
$(CC) $(MEX_FLAGS) $(INCLUDES) $<
%.obj : $(MATLAB_ROOT)/simulink/src/%.c
$(CC) $(MEX_FLAGS) $(INCLUDES) $<
rtwlib.lib : $(MAKEFILE) rtw_proj.tmw
@echo Creating $@ from $(MATLAB_ROOT)/rtw/c/libsrc/*.c
@if exist $@ del $@
$(PERL) $(MKLIB_PL) $(LIBSRC) $@ "$(CC)" "$(MEX_FLAGS)" $(LIBCMD)
clean :
@echo ### Deleting the objects, rtwlib.lib and $(PROGRAM)
@del rtwlib.lib $(OBJS) ..\$(MODEL)_acc.dll
#----------------------------- Dependencies -------------------------------
$(OBJS) : $(MAKEFILE) rtw_proj.tmw
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -