www.pudn.com > communicationmatlab.rar > GRT_UNIX.CMM


# Copyright (c) 1994-96, The MathWorks, Inc. 
# All Rights Reserved.		 
# $Revision: 1.1 $  $Date: 1996/04/01 18:31:36 $ 
# 
# Edited for DSP Blockset, v1.0. 
# 
# File    : grt_unix.dsp 
# 
# Abstract: 
#	Template Makefile for building a UNIX-based stand-alone 
#	Generic real-time version of Simulink model using generated C code. 
# 
# 	This makefile attempts to conform to the guidelines specified in the 
# 	IEEE Std 1003.2-1992 (POSIX) standard. 
# 
# 	Note that this template can be automatically customized using make_rt.m 
# 	and the "Generate and Build Real-Time" option under the "Code" menu 
# 	heading. 
# 
# 
 
# 
#------------------------ Macros Read By make_rt ------------------------- 
# 
# Note: These macros are parsed by make_nrt.  Thus they should not contain 
#	other macros, as these macros will not be expanded. 
# 
MAKE = make 
QUOTE = \" 
HOST = UNIX 
BUILD = yes 
 
#-------------------------- Customization Macros ------------------------- 
# 
# The following set of macros are customized by the make_nrt program. 
# 
MODEL           = |>MODEL_NAME<| 
MAKEFILE	= |>MAKEFILE_NAME<| 
S_FUNCTIONS     = |>S_FUNCTION_FILENAMES<| 
INTEGRATOR      = |>INTEG_SRC_FILENAME<| 
LOGGER          = |>LOG_SRC_FILENAME<| 
COMM_LINK       = |>COMM_LINK_FILENAME<| 
 
INTEG_DEFINES   = |>INTEG_DEFINES<| 
LOGGING_DEFINES = |>LOGGING_DEFINES<| 
 
MATLAB_ROOT     = |>MATLAB_ROOT<| 
 
#--------------------------- Tool Specifications ------------------------- 
# 
# Modify the following macros to reflect the tools you wish to use for 
# compiling and linking your code. 
# 
CC = cc 
LD = $(CC) 
 
ROLLER = $(MATLAB_ROOT)/toolbox/dspblks/bin/roller 
 
#------------------------------ Include Path ----------------------------- 
 
CODEGEN_ROOT = $(MATLAB_ROOT)/codegen 
 
MATLAB_INCLUDES = \ 
	-I$(MATLAB_ROOT)/simulink/include \ 
	-I$(CODEGEN_ROOT)/common/include \ 
	-I$(CODEGEN_ROOT)/external/rpc \ 
	-I$(MATLAB_ROOT)/toolbox/dspblks 
 
INCLUDES = -I. $(MATLAB_INCLUDES) $(USER_INCLUDES) 
 
#-------------------------------- C Flags -------------------------------- 
 
# Required Options 
REQ_OPTS = 
 
# Optimization Options 
OPT_OPTS = -O  
 
# Debug Options 
DBG_OPTS = 
 
# User Options 
OPTS = 
 
# Options needed to use SIMULINK RPC (Uncomment if desired) 
# RPC_OPTS = -DSIMRPC -D_HPUX_SOURCE 
 
CC_OPTS = $(REQ_OPTS) $(OPT_OPTS) $(DBG_OPTS) $(OPTS) $(RPC_OPTS) 
 
CPP_REQ_DEFINES = -DMODEL_NAME=$(MODEL) -DMULTITASKING 
 
CFLAGS = $(CC_OPTS) $(INCLUDES) $(CPP_REQ_DEFINES) $(CPP_DEFINES) \ 
	$(INTEG_DEFINES) $(LOGGING_DEFINES) 
 
LDFLAGS =  
LIBS = -lm 
 
# For SIMULINK RPC with Solaris 2.X, use the following list of libraries 
# (Uncomment if desired) 
# LIBS = -lm -lsocket -lnsl 
 
#----------------------------- Source Files ------------------------------ 
 
REQ_SRCS = $(MODEL).c grt_main.c rt_sim.c simstruc.c fft.c 
OPT_SRCS = 
S_FCN_SRCS = $(S_FUNCTIONS) 
INT_SRCS = $(INTEGRATOR) 
LOG_SRCS = $(LOGGER) 
RPC_SRCS = sr_interface.c sr_dispatch.c sr_proc.c sr_xdr.c sr_errormsg.c sr_glob.c 
 
# Uncomment the following line to include SIMULINK RPC support 
# EXT_SRCS = $(RPC_SRCS) 
 
SRCS = $(REQ_SRCS) $(OPT_SRCS) $(S_FCN_SRCS) $(INT_SRCS) $(LOG_SRCS) $(EXT_SRCS) 
OBJS = $(SRCS:.c=.o) 
 
PROGRAM = $(MODEL) 
 
#--------------------------------- Rules --------------------------------- 
 
$(PROGRAM) : $(OBJS) 
	$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) 
 
%.o : %.c $(MAKEFILE) 
	@$(ROLLER) -b 75 -t 5 -e $< 
	$(CC) $(CFLAGS) -c $< -o $@ 
 
%.o : $(CODEGEN_ROOT)/rt/common/%.c $(MAKEFILE) 
	$(CC) $(CFLAGS) -c $< 
 
%.o : $(CODEGEN_ROOT)/common/src/%.c $(MAKEFILE) 
	$(CC) $(CFLAGS) -c $< 
 
%.o : $(CODEGEN_ROOT)/external/rpc/%.c $(MAKEFILE) 
	$(CC) $(CFLAGS) -c $< 
 
%.o : $(MATLAB_ROOT)/simulink/src/%.c $(MAKEFILE) 
	$(CC) $(CFLAGS) -c $< 
 
%.o : $(MATLAB_ROOT)/toolbox/dspblks/%.c $(MAKEFILE) 
	$(CC) $(CFLAGS) -c $< 
 
#----------------------------- Dependencies ------------------------------- 
 
grt_main.o : $(MODEL).c