# mkdir engine
# mv app/app_cfg.cfg engine
# cp app/makefile engine
# cp app/makefile_profile engine

1.  Added audio_decoder_dummy.c, audio_encoder_dummy.c, video_encoder_dummy.c video_decoder_dummy.c engine_dummy.c (provided files)

2. Copy makefile and makefile_profile.mak from application directory into engine directory

engine/app_cfg.cfg
2.5  Removed DMAI stuff from engine/app_cfg.cfg
REMOVE the following lines:

/* Load dmai support */
var dmai = xdc.loadPackage( 'ti.sdo.dmai' );

/* myDisplay is a modified dmai Display module with extended support */
var myDisplay = xdc.loadPackage( 'ti.tto.myDisplay' );



**makefile_profile.mak
3.  Changed
PROGNAME := app
	to
PROGNAME := engine
4. Changed
# ----------------------------------------
# -----    build executable (.x)    ------
# ----------------------------------------
$(PROGNAME)_$(PROFILE).xv5T : $(C_OBJS) $(PROFILE)/$(CONFIG)/linker.cmd 
	@echo; echo "1.  ----- Need to generate executable file: $@ "
	@$(CC) $(CFLAGS) $(LINKER_FLAGS) $^ -o $@
	@echo "          Successfully created executable : $@ " ; echo

	to

# ----------------------------------------
# -----    build engine deliverable (.x)    ------
# ----------------------------------------
$(PROGNAME)_$(PROFILE).ov5T : $(C_OBJS) $(PROFILE)/$(CONFIG)/linker.cmd 
	@echo; echo "1.  ----- Need to generate executable file: $@ "
	@$(CC) $(CFLAGS) $(LINKER_FLAGS) -Wl,-r -nostdlib $^ -o $@
	@echo "          Successfully created engine deliverable : $@ " ; echo

5.  Changed
.PHONY  : all 
all : $(PROGNAME)_$(PROFILE).xv5T
	@echo ; echo "The target ($<) has been built." 
	@echo

	to

.PHONY  : all 
all : $(PROGNAME)_$(PROFILE).ov5T
	@echo ; echo "The target ($<) has been built." 
	@echo

6.  changed
.PHONY : clean
clean  : 
	@echo ; echo "--------- Cleaning up files for $(PROFILE) -----"
	rm -rf $(PROFILE)
	rm -rf $(PROGNAME)_$(PROFILE).xv5T
	rm -rf $(EXEC_DIR)/$(PROGNAME)_$(PROFILE).xv5T 
	rm -rf $(C_DEPS)
	rm -rf $(C_OBJS)
	@echo

to

.PHONY : clean
clean  : 
	@echo ; echo "--------- Cleaning up files for $(PROFILE) -----"
	rm -rf $(PROFILE)
	rm -rf $(PROGNAME)_$(PROFILE).ov5T
	rm -rf $(C_DEPS)
	rm -rf $(C_OBJS)
	@echo

7.  removed install rule

8.  changed
LINKER_FLAGS := -lpthread -L$(LLIB_INSTALL_DIR)/lib -lasound 
	to
LINKER_FLAGS := 

**app/makefile_profile.mak
****** (note-- not engine/makefile_profile.mak!)
9.  Added engine deliverable rule
# ----------------------------------------
# -----   Engine Deliverable Rule   ------
# ----------------------------------------

# Use .phony inappropriately to force makefile call
# engine's makefile will determine if rebuild is necessary
#.phony ../engine/engine_DEBUG.ov5t

../engine/engine_DEBUG.ov5T:
	cd ../engine; make all

#.phony ../engine/engine_RELEASE.ov5T

../engine/engine_RELEASE.ov5T:
	cd ../engine; make all

10.  Added DMAI libs and search path variables

DMAI_LIBS := $(PWD)/../../myDisplay/packages/ti/tto/myDisplay/lib/release/myDisplay.av5T $(DMAI_INSTALL_DIR)/packages/ti/sdo/dmai/lib/dmai_linux_omap3530.a470MV

DMAI_INCLUDES = -I"$(CE_INSTALL_DIR)/packages" -I"$(XDAIS_INSTALL_DIR)/packages" -I"$(FC_INSTALL_DIR)/packages" -I"$(XDC_INSTALL_DIR)/packages" -I"$(DMAI_INSTALL_DIR)/packages" -I"$(PWD)/../../myDisplay/packages" -Dxdc_target_types__="gnu/targets/arm/std.h"


10.  Added engine.o as dependency to application build rule:
# ----------------------------------------
# -----    build executable (.x)    ------
# ----------------------------------------
$(PROGNAME)_$(PROFILE).xv5T : $(C_OBJS) $(PROFILE)/$(CONFIG)/linker.cmd ../engine/engine_$(PROFILE).ov5T
	@echo; echo "1.  ----- Need to generate executable file: $@ "
	@$(CC) $(CFLAGS) $(LINKER_FLAGS) $^ -o $@
	@echo "          Successfully created executable : $@ " ; echo

11.  Updated build applicaiton rule for DMAI libs and search paths
# ----------------------------------------
# -----    build executable (.x)    ------
# ----------------------------------------
$(PROGNAME)_$(PROFILE).xv5T : $(C_OBJS) $(DMAI_LIBS) ../engine/engine_$(PROFILE).ov5T
	@echo; echo "1.  ----- Need to generate executable file: $@ "
	@$(CC) $(CFLAGS) $(DMAI_INCLUDES) $(LINKER_FLAGS) $^ -o $@
	@echo "          Successfully created executable : $@ " ; echo

12.  Updated object file rule to remove configuro search paths and add in dmai search paths
# ----------------------------------------
# -----    Object File Rule (.o)    ------
# ----------------------------------------
$(PROFILE)/%.o : %.c $(PROFILE)/$(CONFIG)/compiler.opt 
	@echo
	@echo "2.  ----- Need to generate:      $@ (due to: $(wordlist 1,1,$?) ...)"
	@mkdir -p $(dir $@)
	$(AT) $(CC) $(CFLAGS) $($(PROFILE)_CFLAGS) $(DMAI_INCLUDES) -c $< -o $@
	@echo "          Successfully created:  $@ "



**app_cfg.cfg
(Note, this is app/app_cfg.cfg, not to be confused with engine/app_cfg.cfg!)
11. Created a DMAI-only app_cfg.cfg (note: DMAI requires configuration of OSAL layer):
/*  
 *  app_cfg.cfg
 *
 *  RTSC package manager configuration file
 *  Imports and configures codec engine packages and some other packages
 */

/* Load support for the Codec Engine */
var osalGlobal = xdc.useModule( 'ti.sdo.ce.osal.Global' );

/* Configure CE to use it's Linux version */
osalGlobal.runtimeEnv = osalGlobal.LINUX;

/* Load dmai support */
var dmai = xdc.loadPackage( 'ti.sdo.dmai' );

/* myDisplay is a modified dmai Display module with extended support */
var myDisplay = xdc.loadPackage( 'ti.tto.myDisplay' );



12.  Added engine directory to clean rule
	cd ../engine; make clean

** engine/makefile_profile.mak

13. Changed name of config file
CONFIG   := app_cfg
	to
CONFIG   := engine_cfg

14.  Changed name of config file in directory
# mv app_cfg.cfg engine_cfg.cfg

14.  Removed compiler.opt from object file build rule

15.  (optional) Removed configuro rule and app_cfg.cfg touch rule from app/makefile_profile.mak 

16.  (optional) Removed configuro related variables section, the following variables removed:
XDCROOT
CONFIGURO
XDCPATH
CONFIG
TARGET
PLATFORM

17. (optional)  Removed .precious statement for link.cmd and compiler.opt
