View difference between Paste ID: zuNL7PUt and
SHOW: | | - or go back to the newest paste.
1-
1+
#
2
#		Modifying TI's IUNIVERSAL examples Makefile to create
3
#			    custom applications
4
#
5
#				dispTEC 2010
6
#			http://disptec.sourceforge.net
7
#
8
9
ifeq ($(DEVDIR),)
10
$(error ====== DEVDIR variable is empty, invoke this Makefile from the BSP root, or provide the path to it =====)
11
endif
12
13
# Includes your Rules.make from the DVSDK directory
14
include $(DEVDIR)/fs/Apps.defs
15
16
include $(DEVDIR)/proprietary/dvsdk_1_00_00/Rules.make
17
18
############# MODIFY HERE ###################
19
XDC_INSTALL_DIR=/home/mgruner/RTSCWizard/xdctools_3_20_01_51
20
#############################################
21
22
ifdef PLATF
23
    PLATFORM=$(PLATF)
24
endif
25
26
# Location of TI Code Generation Tools if not provided in Rules.make
27
ifndef CODEGEN_INSTALL_DIR
28
$(error ====== CODEGEN_INSTALL_DIR variable is empty, provide the path to it =====)    
29
endif
30
31
EXEC_DIR = build
32
33
############### MODIFY HERE #############################
34
APP=fir
35
MYPATH=itcr/disptec
36
INSTALL_DIR=Disptec_codecs_test
37
NAME=disptec
38
#########################################################
39
40
# You must include the location of your tools if you do not use a 
41
# DVSDK Rules.make
42
ifndef DVSDK_INSTALL_DIR
43
$(error ====== DVSDK_INSTALL_DIR variable is empty, provide the path to it =====)
44
endif
45
46
ifeq ($(PLATFORM),dm6446)
47
    XDC_PLATFORM = ti.platforms.evmDM6446
48
    XDC_TARGETS = "gnu.targets.arm.GCArmv5T ti.targets.C64P"
49
#    CROSS_COMPILE = $(MVTOOL_PREFIX)
50
else
51
ifeq ($(PLATFORM),omap3530)
52
    XDC_PLATFORM = ti.platforms.evm3530
53
    XDC_TARGETS = "gnu.targets.arm.GCArmv5T ti.targets.C64P"
54
    CROSS_COMPILE = $(CSTOOL_PREFIX)
55
else
56
ifeq ($(PLATFORM), omapL137)
57
    XDC_PLATFORM = ti.platforms.evmOMAPL137
58
    XDC_TARGETS = "gnu.targets.arm.GCArmv5T ti.targets.C674"
59
#CROSS_COMPILE = /library/cs/arm-2007q3/bin/arm-none-linux-gnueabi-
60
else
61
ifeq ($(PLATFORM),omapL138)
62
    XDC_PLATFORM = ti.platforms.evmOMAPL138
63
    XDC_TARGETS = "gnu.targets.MVArm9 ti.targets.C64P"
64
#MVTOOL_PREFIX = $(CSTOOL_PREFIX)
65
#MVTOOL_DIR    = $(CSTOOL_DIR)
66
else
67
# You will have to create servers for your platform and target and set
68
# the below variables accordingly, see the iuniversal example design doc.
69
    XDC_PLATFORM = 
70
    XDC_TARGETS =
71
    CROSS_COMPILE = 
72
endif
73
endif
74
endif
75
endif
76
# Location of Repository
77
PACKAGE_DIR = $(shell pwd)
78
79
# Set XDCPATH to contain necessary repositories (variables from Rules.make)
80
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;
81
82
# Set the number of concurrent build threads (i.e. jobs)
83
JOBS = 1
84
85
# Conditionally set the XDCOPTIONS
86
XDCOPTIONS=v
87
88
########################################################
89
## Shouldn't have to modify anything be low this line ##
90
########################################################
91
92
# Currently only Linux apps are supported thus the app extension is always the same
93
APP_EXT = v5T
94
95
# Parse XDC_TARGETS to find the ARM and DSP targets
96
XDC_ARM_TARGET = $(shell echo $(XDC_TARGETS) | cut -d' ' -f1)
97
XDC_DSP_TARGET = $(shell echo $(XDC_TARGETS) | cut -d' ' -f2)
98
99
# Export environment variables needed by config.bld and Makefile.app
100
export CODEGEN_INSTALL_DIR
101
export XDC_INSTALL_DIR
102
export XDC_PLATFORM
103
export XDC_TARGETS
104
export XDCPATH
105
export XDCOPTIONS
106
export XDCARGS
107
export PACKAGE_DIR
108
export PLATFORM_SHORT
109
export CROSS_COMPILE
110
export XDC_ARM_TARGET
111
export XDC_DSP_TARGET
112
export APP_EXT
113
114
# Set the location of the xdc executable
115
XDC_DIR = $(XDC_INSTALL_DIR)/xdc XDCOPTIONS=$(XDCOPTIONS) XDCTARGETS=$(XDC_TARGETS)
116
117
# Get the suffix of the XDC_PLATFORM to identify appropriate paths
118
PLATFORM_SHORT = $(patsubst .%,%,$(suffix $(XDC_PLATFORM)))
119
120
ifeq ($(PLATFORM_SHORT),"")
121
$(error Failed to get short platform name from $(XDC_PLATFORM) $(PLATFORM_SHORT))
122
endif
123
124
# Search for the server path with all lower case letters
125
PLATFORM_SHORT_LC = $(shell echo $(PLATFORM_SHORT) | tr [:upper:] [:lower:])
126
SERVER_PATH = $(wildcard packages/$(MYPATH)/servers/$(APP))
127
SERVER_PATH_SHORT  = $(shell echo $(SERVER_PATH) | cut -d' ' -f1)
128
129
130
ifeq ($(SERVER_PATH),"")
131
$(error No servers found with $(SERVER_EXTENSION) extension)
132
endif
133
134
.PHONY: clean clean_apps codecs servers apps $(APP) install build all
135
136
build: all
137
138
all: codecs servers apps install
139
140
help:
141
	@echo 
142
	@echo "You must specify a build target. Available targets are: "
143
	@echo "    build, codecs, servers, apps, $(APP), install, clean"
144
145
codecs:
146
#Optional make process. It's used to compile codec with every application process.
147
	make -C packages/$(MYPATH)/codecs/$(APP) -f makefile
148
	$(XDC_DIR) XDCBUILDCFG=$(PACKAGE_DIR)/config.bld -PR packages/$(MYPATH)/codecs/$(APP) $(QOUT) $(ERRQOUT)
149
150
servers:
151
#Optional make process. It's used to compile server with every application process.
152
	make -C packages/$(MYPATH)/servers/$(APP) -f makefile
153
	$(XDC_DIR) XDCBUILDCFG=$(PACKAGE_DIR)/config.bld -P $(SERVER_PATH) $(QOUT) $(ERRQOUT)
154
	
155
156
apps: $(APP)
157
158
$(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)
159
160
$(APP)_remote:
161
	make -C packages/$(MYPATH)/apps/$(APP) -f $(PACKAGE_DIR)/Makefile.app TARGET=linux/remote_$(NAME)_platforms_$(PLATFORM_SHORT) APP_NAME=$(APP) $(QOUT) $(ERRQOUT)
162
163
$(APP)_local:
164
	make -C packages/$(MYPATH)/apps/$(APP) -f $(PACKAGE_DIR)/Makefile.app TARGET=linux/local_$(NAME)_platforms_$(PLATFORM_SHORT) APP_NAME=$(APP) $(QOUT) $(ERRQOUT)
165
166
install: installed
167
168
installed: install_$(APP)
169
	$(V) mkdir -p $(FSROOT)/$(INSTALL_DIR)
170
	$(V) cp -R build/* $(FSROOT)/$(INSTALL_DIR)
171
	$(V) touch $@
172
173
174
install_$(APP):  install_$(APP)_remote  install_$(APP)_local
175
176
install_$(APP)_local:
177
	@install -d $(EXEC_DIR)
178
	@install -m 777 packages/$(MYPATH)/apps/$(APP)/linux/local_$(NAME)_platforms_$(PLATFORM_SHORT)_$(APP).x$(APP_EXT) $(EXEC_DIR)
179
180
install_$(APP)_remote:
181
	@install -d $(EXEC_DIR)
182
	@install -m 777 packages/$(MYPATH)/apps/$(APP)/linux/remote_$(NAME)_platforms_$(PLATFORM_SHORT)_$(APP).x$(APP_EXT) $(EXEC_DIR)
183
	@install -m 777 $(wildcard $(SERVER_PATH_SHORT)/../$(APP)/$(APP).x*) $(EXEC_DIR)
184
185
clean_apps:
186
	make -C packages/$(MYPATH)/apps/$(APP) APP_NAME=$(APP) -f $(PACKAGE_DIR)/Makefile.app TARGET=linux/remote_$(NAME)_platforms_$(PLATFORM_SHORT) clean
187
	make -C packages/$(MYPATH)/apps/$(APP) APP_NAME=$(APP) -f $(PACKAGE_DIR)/Makefile.app TARGET=linux/local_$(NAME)_platforms_$(PLATFORM_SHORT) clean
188
189
clean: clean_apps
190
	$(XDC_DIR) clean -PR packages/$(MYPATH)
191
	@ rm -rf build/ installed
192
193
preconfig:
194
chkconfig:
195
buildfs: