#
#  Copyright 2007 by Texas Instruments Incorporated.
#  
#  All rights reserved. Property of Texas Instruments Incorporated.
#  Restricted rights to use, duplicate or disclose this code are
#  granted through contract.
#  
#

#
#  ======== makefile ========
#  GNUmake-based makefile.
#

# This file describes the build for a Codec Engine Server.  This makefile has
# special sections to accomodate inclusion of the Codec Engine, while the rest
# is standard GNU make.  Codec Engine-specific additions are marked with
# the [CE] tag.

# [CE] define EXAMPLES_ROOTDIR to point to root of <CE/examples> directory
EXAMPLES_ROOTDIR := $(CURDIR)/../../../../../..

# include the file that defines paths to XDC packages and XDC tools
include $(EXAMPLES_ROOTDIR)/xdcpaths.mak

# add the examples repository to the package path.
# This is necessary because this server's configuration uses the codecs
# in the examples repository
XDC_PATH := $(EXAMPLES_ROOTDIR);$(XDC_PATH)

# Update this to your build environment!
CGTOOLS := /home/user/dvevm_1_10/cg6x_6_0_11

# compiler and linker
CC = $(CGTOOLS)/bin/cl6x
LINK = $(CGTOOLS)/bin/lnk6x

# [CE] Configuro settings.  CONFIGPKG is the basename of your application's
# config script
CONFIGPKG = video_copy

# [CE] Name the xdc target and platform
XDCTARGET = ti.targets.C64P
XDCPLATFORM = ti.platforms.evmDM6446

# [CE] configuro-generated files
COMPILER_FILE = $(CONFIGPKG)/compiler.opt
LINKER_FILE = $(CONFIGPKG)/linker.cmd

# [CE] The path to the configuro utility
CONFIGURO = XDCPATH="$(XDC_PATH)" $(XDC_INSTALL_DIR)/xs xdc.tools.configuro

# [CE] Augment the standard $(CFLAGS) variable, adding the
# Configuro-generated compiler file.
CFLAGS = -@ $(CONFIGPKG)/compiler.opt

# final executable
all: video_copy.x64P

# [CE] The generated linker and compiler files depend on the generated
# config package
$(LINKER_FILE) $(COMPILER_FILE) : $(CONFIGPKG)

# [CE] The generated config package depends on the 2 config scripts
$(CONFIGPKG) : $(CONFIGPKG).cfg $(CONFIGPKG).tcf
	$(CONFIGURO) -c $(CGTOOLS) -o $(CONFIGPKG) \
		-t $(XDCTARGET) -p $(XDCPLATFORM) \
                --tcf $(CONFIGPKG).cfg

# "normal" makefile settings and rules follow.
%.obj : %.c $(COMPILER_FILE)
	$(CC) $(CFLAGS) -c $<


# app.out, in addition to its standard stuff, must specify the
# auto-generated $(LINKER_FILE)
video_copy.x64P: main.obj $(LINKER_FILE)
	$(LINK) -o $@ -c $^


# clean rule
clean:
	rm -rf video_copy.x64P *.obj $(CONFIGPKG)
#
#  @(#) ti.sdo.ce.examples.servers.video_copy; 1,0,0,32; 4-6-2007 17:48:28; /db/atree/library/trees/ce-f22x/src/
#

