Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Modifying TI's IUNIVERSAL examples Makefile to create
- # custom applications
- #
- # dispTEC 2010
- # http://disptec.sourceforge.net
- #
- ifeq ($(DEVDIR),)
- $(error ====== DEVDIR variable is empty, invoke this Makefile from the BSP root, or provide the path to it =====)
- endif
- # Includes your Rules.make from the DVSDK directory
- include $(DEVDIR)/fs/Apps.defs
- include $(DEVDIR)/proprietary/dvsdk_1_00_00/Rules.make
- ############# MODIFY HERE ###################
- XDC_INSTALL_DIR=/home/mgruner/RTSCWizard/xdctools_3_20_01_51
- #############################################
- ifdef PLATF
- PLATFORM=$(PLATF)
- endif
- # Location of TI Code Generation Tools if not provided in Rules.make
- ifndef CODEGEN_INSTALL_DIR
- $(error ====== CODEGEN_INSTALL_DIR variable is empty, provide the path to it =====)
- endif
- EXEC_DIR = build
- ############### MODIFY HERE #############################
- APP=fir
- MYPATH=itcr/disptec
- INSTALL_DIR=Disptec_codecs_test
- NAME=disptec
- #########################################################
- # You must include the location of your tools if you do not use a
- # DVSDK Rules.make
- ifndef DVSDK_INSTALL_DIR
- $(error ====== DVSDK_INSTALL_DIR variable is empty, provide the path to it =====)
- endif
- ifeq ($(PLATFORM),dm6446)
- XDC_PLATFORM = ti.platforms.evmDM6446
- XDC_TARGETS = "gnu.targets.arm.GCArmv5T ti.targets.C64P"
- # CROSS_COMPILE = $(MVTOOL_PREFIX)
- else
- ifeq ($(PLATFORM),omap3530)
- XDC_PLATFORM = ti.platforms.evm3530
- XDC_TARGETS = "gnu.targets.arm.GCArmv5T ti.targets.C64P"
- CROSS_COMPILE = $(CSTOOL_PREFIX)
- else
- ifeq ($(PLATFORM), omapL137)
- XDC_PLATFORM = ti.platforms.evmOMAPL137
- XDC_TARGETS = "gnu.targets.arm.GCArmv5T ti.targets.C674"
- #CROSS_COMPILE = /library/cs/arm-2007q3/bin/arm-none-linux-gnueabi-
- else
- ifeq ($(PLATFORM),omapL138)
- XDC_PLATFORM = ti.platforms.evmOMAPL138
- XDC_TARGETS = "gnu.targets.MVArm9 ti.targets.C64P"
- #MVTOOL_PREFIX = $(CSTOOL_PREFIX)
- #MVTOOL_DIR = $(CSTOOL_DIR)
- else
- # You will have to create servers for your platform and target and set
- # the below variables accordingly, see the iuniversal example design doc.
- XDC_PLATFORM =
- XDC_TARGETS =
- CROSS_COMPILE =
- endif
- endif
- endif
- endif
- # Location of Repository
- PACKAGE_DIR = $(shell pwd)
- # Set XDCPATH to contain necessary repositories (variables from Rules.make)
- XDCPATH = ^;$(CURDIR)/packages;$(XDC_INSTALL_DIR)/packages;$(LINK_INSTALL_DIR);$(FC_INSTALL_DIR)/packages;$(CE_INSTALL_DIR)/packages;$(XDAIS_INSTALL_DIR)/packages;$(CODEC_INSTALL_DIR)/packages;$(CMEM_INSTALL_DIR)/packages;$(DMAI_INSTALL_DIR)/packages;$(LPM_INSTALL_DIR)/packages;$(XDC_USER_PATH);$(EDMA3_LLD_INSTALL_DIR)/packages;$(BIOS_INSTALL_DIR)/packages;$(BIOSUTILS_INSTALL_DIR)/packages;
- # Set the number of concurrent build threads (i.e. jobs)
- JOBS = 1
- # Conditionally set the XDCOPTIONS
- XDCOPTIONS=v
- ########################################################
- ## Shouldn't have to modify anything be low this line ##
- ########################################################
- # Currently only Linux apps are supported thus the app extension is always the same
- APP_EXT = v5T
- # Parse XDC_TARGETS to find the ARM and DSP targets
- XDC_ARM_TARGET = $(shell echo $(XDC_TARGETS) | cut -d' ' -f1)
- XDC_DSP_TARGET = $(shell echo $(XDC_TARGETS) | cut -d' ' -f2)
- # Export environment variables needed by config.bld and Makefile.app
- export CODEGEN_INSTALL_DIR
- export XDC_INSTALL_DIR
- export XDC_PLATFORM
- export XDC_TARGETS
- export XDCPATH
- export XDCOPTIONS
- export XDCARGS
- export PACKAGE_DIR
- export PLATFORM_SHORT
- export CROSS_COMPILE
- export XDC_ARM_TARGET
- export XDC_DSP_TARGET
- export APP_EXT
- # Set the location of the xdc executable
- XDC_DIR = $(XDC_INSTALL_DIR)/xdc XDCOPTIONS=$(XDCOPTIONS) XDCTARGETS=$(XDC_TARGETS)
- # Get the suffix of the XDC_PLATFORM to identify appropriate paths
- PLATFORM_SHORT = $(patsubst .%,%,$(suffix $(XDC_PLATFORM)))
- ifeq ($(PLATFORM_SHORT),"")
- $(error Failed to get short platform name from $(XDC_PLATFORM) $(PLATFORM_SHORT))
- endif
- # Search for the server path with all lower case letters
- PLATFORM_SHORT_LC = $(shell echo $(PLATFORM_SHORT) | tr [:upper:] [:lower:])
- SERVER_PATH = $(wildcard packages/$(MYPATH)/servers/$(APP))
- SERVER_PATH_SHORT = $(shell echo $(SERVER_PATH) | cut -d' ' -f1)
- ifeq ($(SERVER_PATH),"")
- $(error No servers found with $(SERVER_EXTENSION) extension)
- endif
- .PHONY: clean clean_apps codecs servers apps $(APP) install build all
- build: all
- all: codecs servers apps install
- help:
- @echo
- @echo "You must specify a build target. Available targets are: "
- @echo " build, codecs, servers, apps, $(APP), install, clean"
- codecs:
- #Optional make process. It's used to compile codec with every application process.
- make -C packages/$(MYPATH)/codecs/$(APP) -f makefile
- $(XDC_DIR) XDCBUILDCFG=$(PACKAGE_DIR)/config.bld -PR packages/$(MYPATH)/codecs/$(APP) $(QOUT) $(ERRQOUT)
- servers:
- #Optional make process. It's used to compile server with every application process.
- make -C packages/$(MYPATH)/servers/$(APP) -f makefile
- $(XDC_DIR) XDCBUILDCFG=$(PACKAGE_DIR)/config.bld -P $(SERVER_PATH) $(QOUT) $(ERRQOUT)
- apps: $(APP)
- $(APP): $(if $(wildcard packages/$(MYPATH)/apps/$(APP)/linux/remote_$(NAME)_platforms_$(PLATFORM_SHORT).cfg), $(APP)_remote) $(if $(wildcard packages/$(MYPATH)/apps/$(APP)/linux/local_$(NAME)_platforms_$(PLATFORM_SHORT).cfg), $(APP)_local)
- $(APP)_remote:
- make -C packages/$(MYPATH)/apps/$(APP) -f $(PACKAGE_DIR)/Makefile.app TARGET=linux/remote_$(NAME)_platforms_$(PLATFORM_SHORT) APP_NAME=$(APP) $(QOUT) $(ERRQOUT)
- $(APP)_local:
- make -C packages/$(MYPATH)/apps/$(APP) -f $(PACKAGE_DIR)/Makefile.app TARGET=linux/local_$(NAME)_platforms_$(PLATFORM_SHORT) APP_NAME=$(APP) $(QOUT) $(ERRQOUT)
- install: installed
- installed: install_$(APP)
- $(V) mkdir -p $(FSROOT)/$(INSTALL_DIR)
- $(V) cp -R build/* $(FSROOT)/$(INSTALL_DIR)
- $(V) touch $@
- install_$(APP): install_$(APP)_remote install_$(APP)_local
- install_$(APP)_local:
- @install -d $(EXEC_DIR)
- @install -m 777 packages/$(MYPATH)/apps/$(APP)/linux/local_$(NAME)_platforms_$(PLATFORM_SHORT)_$(APP).x$(APP_EXT) $(EXEC_DIR)
- install_$(APP)_remote:
- @install -d $(EXEC_DIR)
- @install -m 777 packages/$(MYPATH)/apps/$(APP)/linux/remote_$(NAME)_platforms_$(PLATFORM_SHORT)_$(APP).x$(APP_EXT) $(EXEC_DIR)
- @install -m 777 $(wildcard $(SERVER_PATH_SHORT)/../$(APP)/$(APP).x*) $(EXEC_DIR)
- clean_apps:
- make -C packages/$(MYPATH)/apps/$(APP) APP_NAME=$(APP) -f $(PACKAGE_DIR)/Makefile.app TARGET=linux/remote_$(NAME)_platforms_$(PLATFORM_SHORT) clean
- make -C packages/$(MYPATH)/apps/$(APP) APP_NAME=$(APP) -f $(PACKAGE_DIR)/Makefile.app TARGET=linux/local_$(NAME)_platforms_$(PLATFORM_SHORT) clean
- clean: clean_apps
- $(XDC_DIR) clean -PR packages/$(MYPATH)
- @ rm -rf build/ installed
- preconfig:
- chkconfig:
- buildfs:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement