-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodec_engine.mak
178 lines (151 loc) · 5.95 KB
/
codec_engine.mak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#
# Copyright (c) 2012, Texas Instruments Incorporated
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of Texas Instruments Incorporated nor the names of
# its contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
#
# ==== Standard Variables ====
#
# These vars are used when installing CE content
DESTDIR ?= <UNDEFINED>
packagesdir ?= /packages
libdir ?= /lib
includedir ?= /include
ifeq ($(docdir),)
docdir := /share/ti/codec_engine/doc
xdcdocdir := /docs/codec_engine
else
xdcdocdir := $(docdir)
endif
ifeq ($(prefix),)
prefix := /usr
xdcprefix := /
else
xdcprefix := $(prefix)
endif
include ./products.mak
#
# Set XDCOPTIONS. Use -v for a verbose build.
#
#XDCOPTIONS=v
export XDCOPTIONS
# JOBS is the max number of parallel build commands to run concurrently.
# You can often get a build performance lift by setting JOBS to a value > 1,
# however debugging build errors is tough(!), so the default setting is 1.
JOBS=1
#######################################################
## Shouldn't have to modify anything below this line ##
#######################################################
#
# Set XDCARGS to some of the variables above. XDCARGS are passed
# to the XDC build engine, which loads codec_engine.bld, which
# extracts these variables and use them to determine what to build and
# which toolchains to use.
#
# Note that not all of these variables need to be set to something valid.
# Unfortunately, since these vars are unconditionally assigned, your build line
# will be longer and more noisy than necessary (e.g., it will include CC_V5T
# assignment even if you're just building for C64P).
#
# Some background is here:
# http://rtsc.eclipse.org/docs-tip/Command_-_xdc#Environment_Variables
#
XDCARGS= \
ti.targets.C64P=\"$(ti.targets.C64P)\" \
ti.targets.C674=\"$(ti.targets.C674)\" \
ti.targets.arm.elf.M3=\"$(ti.targets.arm.elf.M3)\" \
ti.targets.elf.C64P=\"$(ti.targets.elf.C64P)\" \
ti.targets.elf.C64T=\"$(ti.targets.elf.C64T)\" \
ti.targets.elf.C66=\"$(ti.targets.elf.C66)\" \
ti.targets.elf.C674=\"$(ti.targets.elf.C674)\" \
gnu.targets.arm.GCArmv5T=\"$(gnu.targets.arm.GCArmv5T)\" \
google.targets.arm.Bionic=\"$(google.targets.arm.Bionic)\"
# Set XDCPATH to contain necessary repositories.
XDCPATH = $(XDAIS_INSTALL_DIR)/packages;$(BIOS_INSTALL_DIR)/packages;$(CMEM_INSTALL_DIR)/packages;$(LINK_INSTALL_DIR)/packages;$(OSAL_INSTALL_DIR)/packages;$(FC_INSTALL_DIR)/packages;$(EDMA3_LLD_INSTALL_DIR)/packages;$(IPC_INSTALL_DIR)/packages
# Set your XDC executable command
XDC = $(XDC_INSTALL_DIR)/xdc XDCARGS="$(XDCARGS)" XDCBUILDCFG=./codec_engine.bld
# Conditionally set XDCOPTIONS=v for verbose builds
#XDCOPTIONS=v
export XDCOPTIONS
export XDCPATH
# Helper variables
PRODUCTS=$(subst packages/,,$(wildcard packages/ti/sdo/*))
LIBS = $(shell cd packages && find . -name '*.av5T' -or -name '*.av7A' -type f)
HEADERS = $(shell cd packages && find . -name '*.h' -type f -not \( -name "package.defs.h" -o -name "_*.h" \))
DOCS = $(wildcard *.html) docs
LIBDIR = $(DESTDIR)/$(prefix)/$(libdir)
INCDIR = $(DESTDIR)/$(prefix)/$(includedir)
DOCDIR = $(DESTDIR)/$(prefix)/$(docdir)
PACKAGESDIR = $(DESTDIR)/$(xdcprefix)/$(packagesdir)
XDCDOCDIR = $(DESTDIR)/$(xdcprefix)/$(xdcdocdir)
# Helper functions
define purge
@find $(PACKAGESDIR)/$(1) -name $(2) -exec rm -rf {} \;
endef
# Targets
all: .all-packages
# This builds all packages rooted in ./packages
.all-packages:
$(XDC) --jobs=$(JOBS) -Pr ./packages
# This cleans all packages rooted in ./packages
clean:
$(XDC) --jobs=$(JOBS) clean -Pr ./packages
install-packages:
@echo "Installing packages into $(PACKAGESDIR)..."
@mkdir -p $(PACKAGESDIR)
@cd packages && cp --parents -rf $(PRODUCTS) $(PACKAGESDIR)
# $(foreach prod,$(PRODUCTS),$(call purge,$(prod),'*.c'))
# $(foreach prod,$(PRODUCTS),$(call purge,$(prod),'*.bld'))
@echo "Installing documentation into $(XDCDOCDIR)..."
@mkdir -p $(XDCDOCDIR)
@cp -rf $(DOCS) xdoc $(XDCDOCDIR)
install:
@echo "Installing libraries into $(LIBDIR)..."
@mkdir -p $(LIBDIR)
@cd packages && cp --parents -f $(LIBS) $(LIBDIR)
@echo "Installing header files into $(INCDIR)..."
@mkdir -p $(INCDIR)
@cd packages && cp --parents -f $(HEADERS) $(INCDIR)
@echo "Installing documentation into $(DOCDIR)..."
@mkdir -p $(DOCDIR)
@cp -rf $(DOCS) $(DOCDIR)
help:
@echo
@echo "Available build targets are:"
@echo
@echo " install-packages"
@echo " Install CE packages and docs"
@echo
@echo " install"
@echo " Install CE headers, libraries and docs"
@echo
#
# @(#) codec_engine_3_22_01_06; 1, 0, 0,1; 2-24-2012 19:49:44; /db/atree/library/trees/ce/ce-t06/src/ xlibrary
#