source: svn/newcon3bcm2_21bu/nexus/utils/Makefile

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 8.8 KB
Line 
1############################################################
2#     (c)2003-2011 Broadcom Corporation
3#
4#  This program is the proprietary software of Broadcom Corporation and/or its licensors,
5#  and may only be used, duplicated, modified or distributed pursuant to the terms and
6#  conditions of a separate, written license agreement executed between you and Broadcom
7#  (an "Authorized License").  Except as set forth in an Authorized License, Broadcom grants
8#  no license (express or implied), right to use, or waiver of any kind with respect to the
9#  Software, and Broadcom expressly reserves all rights in and to the Software and all
10#  intellectual property rights therein.  IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU
11#  HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY
12#  NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE.
13#
14#  Except as expressly set forth in the Authorized License,
15#
16#  1.     This program, including its structure, sequence and organization, constitutes the valuable trade
17#  secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof,
18#  and to use this information only in connection with your use of Broadcom integrated circuit products.
19#
20#  2.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
21#  AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR
22#  WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
23#  THE SOFTWARE.  BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES
24#  OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE,
25#  LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION
26#  OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF
27#  USE OR PERFORMANCE OF THE SOFTWARE.
28#
29#  3.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS
30#  LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR
31#  EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR
32#  USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF
33#  THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT
34#  ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
35#  LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF
36#  ANY LIMITED REMEDY.
37#
38# $brcm_Workfile: Makefile $
39# $brcm_Revision: 22 $
40# $brcm_Date: 9/22/11 12:27p $
41#
42# Module Description:
43#
44# Revision History:
45#
46# Created: 08/28/2007 by Jon Garrett
47#
48# $brcm_Log: /nexus/utils/Makefile $
49#
50# 22   9/22/11 12:27p jtna
51# SW7425-1333: use MEDIA_RMFF_SUPPORT flag
52#
53# 21   4/27/11 6:20p vsilyaev
54# SW7425-232: Promote ATOM module to separate component
55#
56# 20   1/28/11 2:35p jtna
57# SW7422-232: merge Android changes
58#
59# 19   9/29/10 9:33a erickson
60# SW7420-1123: add linux usermode IPC
61#
62# 18   9/8/10 12:05p vsilyaev
63# SW7468-129: Added video decoder on ZSP
64#
65# 17   5/12/10 11:25a erickson
66# SW7405-4162: cancel implicit compile&link rule so we can do two
67#  implicit rules to compile and link separately
68#
69# 16   4/2/10 2:26p erickson
70# SW7405-4162: some bmedia, bfile and tspsi code is now built into nexus
71#
72# 15   4/1/10 2:19p erickson
73# SW7405-3833: add NEXUS_PREBUILT_BINARY=y support
74#
75# 14   2/22/10 5:33p vsilyaev
76# SW3556-913: Added option to plug  Custom File I/O routines to inject
77#  errors
78#
79# 13   12/8/09 3:00p gmohile
80# SW7408-1 : Add support for platforms with no frontend
81#
82# 12   10/27/09 3:43p erickson
83# SW3548-2574: add video test app
84#
85# 11   9/16/09 1:42p erickson
86# SW7400-2511: add B_REFSW_ or NEXUS_ namespace to build variables
87#
88# 10   6/16/09 5:13p jtna
89# PR54802: added record
90#
91# 9   5/22/09 10:11a vsilyaev
92# PR 48944: Removed unneded dependency
93#
94# 8   5/19/09 12:38p vsilyaev
95# PR 48944: Fixed dependency on OBJDIR
96#
97# 7   5/4/09 2:38p erickson
98# PR54807: added message util
99#
100# 6   3/19/09 10:54a erickson
101# PR48944: allow for no ASF and no AVI
102#
103# 5   3/13/09 2:44p vsilyaev
104# PR 53225: Adeed NEXUS_BIN_DIR_SUFFIX and NEXUS_BIN_DIR
105#
106# 4   2/5/09 2:08p erickson
107# PR51151: update
108#
109# 3   2/5/09 1:49p erickson
110# PR51151: added media probe option for playback
111#
112# 2   11/17/08 2:19p erickson
113# PR48944: update
114#
115# 1   11/17/08 12:33p erickson
116# PR48944: add utils
117#
118############################################################
119# Nexus examples
120
121ifdef COMSPEC
122# Any DOS environment
123NEXUS_TOP := $(shell cd .. && cd)
124else
125NEXUS_TOP := $(shell cd ../; pwd)
126endif
127
128ifndef PLATFORM
129$(error PLATFORM is not defined)
130endif
131
132ifeq ($(NEXUS_PREBUILT_BINARY),y)
133# do "make api" and "make nexus_headers" first, then "make NEXUS_PREBUILT_BINARY=y"
134include $(NEXUS_TOP)/bin/include/platform_app.inc
135Q_ ?= @
136else
137# include cross-compiler definitions
138include $(NEXUS_TOP)/platforms/$(PLATFORM)/build/platform_app.inc
139endif
140
141THEAPPS = \
142        playback \
143        message \
144        record
145
146ifneq ($(filter $(PLATFORM), 97408),$(PLATFORM))
147THEAPPS += decode \
148           video
149endif
150
151
152ifeq ($(B_REFSW_OS),vxworks)
153# VxWorks needs a wrapper function to call main.
154VXOBJS = vxworks_cmd.o
155# We like to use .out for loadable objects.
156APPSUFFIX = .out
157APPS = $(addsuffix .out, $(THEAPPS))
158else
159ifeq ($(B_REFSW_OS),linuxkernel)
160APPSUFFIX = .ko
161APPS = $(addsuffix ${APPSUFFIX}, $(THEAPPS))
162else
163APPS = $(THEAPPS)
164endif
165endif
166
167.PHONY: api clean
168OBJDIR=./obj
169
170all: $(APPS)
171
172$(OBJDIR)/exists:
173        mkdir -p $(OBJDIR)
174        @touch $@
175
176ifneq ($(NEXUS_PREBUILT_BINARY),y)
177$(APPS): api
178endif
179
180ifneq ($(findstring linux,$(B_REFSW_OS)),)
181LDFLAGS := -lnexus${NEXUS_LIB_SUFFIX} -L${NEXUS_BIN_DIR} -lpthread -lm
182endif
183
184# For VxWorks builds, link in the nexus library.
185ifeq ($(B_REFSW_OS),vxworks)
186LDFLAGS := -lnexus${NEXUS_LIB_SUFFIX} -L${NEXUS_BIN_DIR}
187endif
188
189# For Android builds
190ifeq ($(B_REFSW_ANDROID),y)
191
192# The following script assumes the gcc version number is the last field on the first line
193GCC_VERSION ?= $(shell $(CC) --version |  $(AWK) 'NR == 1 { print $$NF }')
194
195ANDROID_LIB = $(ANDROID)/out/target/product/bcm$(BCHP_CHIP)/obj/lib
196LDFLAGS := -EL \
197    -lnexus${NEXUS_LIB_SUFFIX} -L${NEXUS_BIN_DIR} $(EXTRA_DRM_OBJS) \
198    -Bdynamic \
199    -Wl,-T,$(ANDROID)/build/core/mipself.x \
200    -Wl,-dynamic-linker,/system/bin/linker \
201    -Wl,--gc-sections \
202    -Wl,-z,nocopyreloc \
203    -Wl,--no-undefined \
204    -Wl,-rpath-link=$(ANDROID_LIB) \
205    -L$(ANDROID_LIB) \
206    -nostdlib \
207    $(ANDROID_LIB)/crtbegin_dynamic.o \
208    $(B_REFSW_TOOLCHAIN_DIR)/lib/gcc/mipsel-linux-uclibc/$(GCC_VERSION)/libgcc.a \
209        $(B_REFSW_TOOLCHAIN_DIR)/lib/gcc/mipsel-linux-uclibc/$(GCC_VERSION)/libgcc_eh.a \
210        $(ANDROID_LIB)/crtend_android.o \
211    -lc -lm
212endif
213
214# This builds the Nexus api
215api:
216        $(MAKE) -C $(NEXUS_TOP)/build
217
218# This cleans nexus and local apps
219clean: clean_apps
220        $(MAKE) -C $(NEXUS_TOP)/build clean
221
222clean_apps:
223        -$(RM) -r $(APPS) $(OBJDIR)
224
225# This is the minimum needed to compile and link with Nexus
226CFLAGS += $(NEXUS_CFLAGS) $(addprefix -I,$(NEXUS_APP_INCLUDE_PATHS)) $(addprefix -D,$(NEXUS_APP_DEFINES))
227
228# Always build with debug
229CFLAGS += -g
230
231# media probe (only needed for playback and record)
232BSEAV = $(NEXUS_TOP)/../BSEAV
233include $(BSEAV)/lib/bfile/bfile.inc
234ifeq ($(MEDIA_AVI_SUPPORT),y)
235include $(BSEAV)/lib/avi/bavi.inc
236endif
237ifeq ($(MEDIA_ASF_SUPPORT),y)
238include $(BSEAV)/lib/asf/basf.inc
239endif
240ifeq ($(MEDIA_RMFF_SUPPORT),y)
241include $(BSEAV)/lib/media/rmff/brmff.inc
242endif
243include $(BSEAV)/lib/utils/batom.inc
244include $(BSEAV)/lib/media/bmedia.inc
245CFLAGS += $(addprefix -I,$(BMEDIA_INCLUDES) $(BFILE_MEDIA_INCLUDES)) -I$(BSEAV)/lib/mpeg2_ts_parse -I$(BSEAV)/lib/tspsi
246CFLAGS += $(addprefix -D,$(BMEDIA_PROBE_DEFINES))
247
248DECODE_SRCS += ./cmdline_args.c ./fileio_custom.c
249
250DECODE_OBJS = $(foreach file, $(DECODE_SRCS), $(OBJDIR)/$(notdir $(patsubst %.c, %.o, $(file))))
251
252vpath %.c $(foreach file, $(DECODE_SRCS) $(MESSAGE_SRCS), $(dir $(patsubst %.c, %.o, $(file))))
253
254test:
255        @echo $(EXTRA_OBJS)
256        @echo $(foreach file, $(EXTRA_SRCS), $(dir $(patsubst %.c, %.o, $(file))))
257
258$(OBJDIR)/%.o: %.c ${OBJDIR}/exists
259        @echo [Compile... $<]
260        $(Q_)$(CC) -c -o $@ $< $(CFLAGS)
261
262# this is not implicit because we don't link in $(DECODE_OBJS)
263message: $(OBJDIR)/message.o $(VXOBJS)
264        @echo [Link... $@]
265ifeq ($(B_REFSW_OS),linuxkernel)
266        ${Q_}$(LD) ${LDFLAGS} --strip-debug -r $(filter %.o, $^) ${NEXUS_BIN_DIR}/libnexus.a -o $@
267else
268        $(Q_)$(CC) -o $@ $(filter %.o, $^) $(LDFLAGS)
269endif
270        cp $@ ${NEXUS_BIN_DIR}
271
272# cancel this implicit rule so we can do separate compile & link w/ implicit rules
273%: %.c
274
275%: $(OBJDIR)/%.o $(DECODE_OBJS) $(VXOBJS)
276        @echo [Link... $@]
277ifeq ($(B_REFSW_OS),linuxkernel)
278        ${Q_}$(LD) ${LDFLAGS} --strip-debug -r $(filter %.o, $^) ${NEXUS_BIN_DIR}/libnexus.a -o $@
279else
280        $(Q_)$(CC) -o $@ $(filter %.o, $^) $(LDFLAGS)
281endif
282        cp $@ ${NEXUS_BIN_DIR}
283
284ifeq ($(B_REFSW_OS),vxworks)
285# Explicit rule for building vxworks wrapper app
286vxworks_cmd.o: vxworks_cmd.c
287        @echo [Compile... $<]
288        $(Q_)$(CC) -o $@ $< $(CFLAGS)
289endif
290
291install: all
292
Note: See TracBrowser for help on using the repository browser.