# 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: 4.2, 5.0, 6.0 # # Note that this template is automatically customized by the Real-Time # Workshop build procedure to create ".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.ProjectDirSuffix' see grt.tlc # # $Revision: 1.22 $ $Date: 2002/05/16 13:01:59 $ $Author: Xjhouska $ # Copyright 1994-2002 The MathWorks, Inc. # #------------------------ 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 = rtwin.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 .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 # CC_OPTIMIZE - yes (1) or no (0): Generate optimized code # REBUILD_ALL - yes (1) or no (0): Rebuild all files MODEL = ECPDSPResetmdl MODULES = ECPDSPResetmdl_data.c MAKEFILE = ECPDSPResetmdl.mk MATLAB_ROOT = C:\MatLab6p5 MATLAB_BIN = C:\MatLab6p5\bin\win32 S_FUNCTIONS = ecpdspreset.c S_FUNCTIONS_LIB = SOLVER = NUMST = 1 TID01EQ = 0 NCSTATES = 0 BUILDARGS = ADD_MDL_NAME_TO_GLOBALS=1 MULTITASKING = 0 EXT_MODE = 1 CC_OPTIMIZE = 1 REBUILD_ALL = 1 #--------------------------- 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)\toolbox\rtw\targets\rtwin\src # Additional file include paths MATLAB_INCLUDES = $(MATLAB_INCLUDES);c:\matlab6p5\rtw\c\libsrc INCLUDE = .;$(MATLAB_INCLUDES);$(INCLUDE) #------------------------ External mode --------------------------------------- !if $(EXT_MODE) == 1 EXT_SRC = updown.c ext_svr.c EXT_CC_OPTS = -DEXT_MODE !else EXT_SRC = EXT_CC_OPTS = !endif #----------------- Compiler and Linker Options -------------------------------- # General Compiler Options cflags = -c -Zp8 -J -Gd -W3 -GF -Gs1048576 # Optimization Options # Change OPT_OPTS but never DEFAULT_OPT_OPTS !!! !if $(CC_OPTIMIZE) == 1 DEFAULT_OPT_OPTS = -O2 -Oa !else DEFAULT_OPT_OPTS = -Od -Oi !endif OPT_OPTS = $(DEFAULT_OPT_OPTS) # Uncomment this line to move warning level to W4 # cflags = $(cflags:W3=W4) CC_OPTS = $(OPT_OPTS) $(OPTS) $(EXT_CC_OPTS) CPP_REQ_DEFINES = -DMODEL=$(MODEL) -DRT -DNUMST=$(NUMST) \ -DTID01EQ=$(TID01EQ) -DNCSTATES=$(NCSTATES) \ -DMT=$(MULTITASKING) CFLAGS = $(cflags) $(CC_OPTS) $(CPP_REQ_DEFINES) $(USER_INCLUDES) LDFLAGS = #----------------------------- Source Files ----------------------------------- REQ_SRCS = $(MODEL).c $(MODULES) rt_stub.c rt_sim.c rt_nonfinite.c \ $(SOLVER) $(EXT_SRC) USER_SRCS = SRCS = $(REQ_SRCS) $(USER_SRCS) $(S_FUNCTIONS) OBJS = $(SRCS:.c=.obj) #--------------------------- Additional Libraries ----------------------------- LIBS = !if "$(OPT_OPTS)" == "$(DEFAULT_OPT_OPTS)" LIBS = $(LIBS) $(MATLAB_ROOT)\rtw\c\lib\win32\rtwlib_rtwin_vc.lib !else LIBS = $(LIBS) rtwlib.lib !endif RTWINTGTLIB = $(MATLAB_ROOT)\toolbox\rtw\targets\rtwin\lib\rtmodvc.lib $(MATLAB_ROOT)\toolbox\rtw\targets\rtwin\lib\rtvclib.lib CMD_FILE = $(MODEL).lnk #--------------------------------- Rules -------------------------------------- ..\$(MODEL).rwd : _before_ $(OBJS) $(LIBS) $(CMD_FILE) @echo ### Linking ... $(LD) $(OBJS) $(RTWINTGTLIB) $(LIBS) $(S_FUNCTIONS_LIB) @$(CMD_FILE) -out:$@ @del $(*R).exp @del $(*R).lib @del $(CMD_FILE) @echo ### Created Real-Time Windows Target module $(MODEL).rwd. $(CMD_FILE) : $(MAKEFILE) @rem <<$@ -dll -base:0x70000000 -stack:0,0 -heap:0,0 -machine:IX86 -ignore:4078 -ignore:4210 -merge:.rdata=.text -merge:.data=.text -section:.text,ERW -opt:ref -incremental:no -fullbuild -nodefaultlib -version:2.00 -osversion:4.00 -subsystem:native,4.00 -export:Header -export:Inquiry -export:Disable -export:Enable -export:GetBoards <