############################################################ # (c)2003-2011 Broadcom Corporation # # This program is the proprietary software of Broadcom Corporation and/or its licensors, # and may only be used, duplicated, modified or distributed pursuant to the terms and # conditions of a separate, written license agreement executed between you and Broadcom # (an "Authorized License"). Except as set forth in an Authorized License, Broadcom grants # no license (express or implied), right to use, or waiver of any kind with respect to the # Software, and Broadcom expressly reserves all rights in and to the Software and all # intellectual property rights therein. IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU # HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY # NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE. # # Except as expressly set forth in the Authorized License, # # 1. This program, including its structure, sequence and organization, constitutes the valuable trade # secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof, # and to use this information only in connection with your use of Broadcom integrated circuit products. # # 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" # AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR # WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO # THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES # OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, # LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION # OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF # USE OR PERFORMANCE OF THE SOFTWARE. # # 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS # LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR # EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR # USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF # THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT # ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE # LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF # ANY LIMITED REMEDY. # # $brcm_Workfile: Makefile $ # $brcm_Revision: 22 $ # $brcm_Date: 9/22/11 12:27p $ # # Module Description: # # Revision History: # # Created: 08/28/2007 by Jon Garrett # # $brcm_Log: /nexus/utils/Makefile $ # # 22 9/22/11 12:27p jtna # SW7425-1333: use MEDIA_RMFF_SUPPORT flag # # 21 4/27/11 6:20p vsilyaev # SW7425-232: Promote ATOM module to separate component # # 20 1/28/11 2:35p jtna # SW7422-232: merge Android changes # # 19 9/29/10 9:33a erickson # SW7420-1123: add linux usermode IPC # # 18 9/8/10 12:05p vsilyaev # SW7468-129: Added video decoder on ZSP # # 17 5/12/10 11:25a erickson # SW7405-4162: cancel implicit compile&link rule so we can do two # implicit rules to compile and link separately # # 16 4/2/10 2:26p erickson # SW7405-4162: some bmedia, bfile and tspsi code is now built into nexus # # 15 4/1/10 2:19p erickson # SW7405-3833: add NEXUS_PREBUILT_BINARY=y support # # 14 2/22/10 5:33p vsilyaev # SW3556-913: Added option to plug Custom File I/O routines to inject # errors # # 13 12/8/09 3:00p gmohile # SW7408-1 : Add support for platforms with no frontend # # 12 10/27/09 3:43p erickson # SW3548-2574: add video test app # # 11 9/16/09 1:42p erickson # SW7400-2511: add B_REFSW_ or NEXUS_ namespace to build variables # # 10 6/16/09 5:13p jtna # PR54802: added record # # 9 5/22/09 10:11a vsilyaev # PR 48944: Removed unneded dependency # # 8 5/19/09 12:38p vsilyaev # PR 48944: Fixed dependency on OBJDIR # # 7 5/4/09 2:38p erickson # PR54807: added message util # # 6 3/19/09 10:54a erickson # PR48944: allow for no ASF and no AVI # # 5 3/13/09 2:44p vsilyaev # PR 53225: Adeed NEXUS_BIN_DIR_SUFFIX and NEXUS_BIN_DIR # # 4 2/5/09 2:08p erickson # PR51151: update # # 3 2/5/09 1:49p erickson # PR51151: added media probe option for playback # # 2 11/17/08 2:19p erickson # PR48944: update # # 1 11/17/08 12:33p erickson # PR48944: add utils # ############################################################ # Nexus examples ifdef COMSPEC # Any DOS environment NEXUS_TOP := $(shell cd .. && cd) else NEXUS_TOP := $(shell cd ../; pwd) endif ifndef PLATFORM $(error PLATFORM is not defined) endif ifeq ($(NEXUS_PREBUILT_BINARY),y) # do "make api" and "make nexus_headers" first, then "make NEXUS_PREBUILT_BINARY=y" include $(NEXUS_TOP)/bin/include/platform_app.inc Q_ ?= @ else # include cross-compiler definitions include $(NEXUS_TOP)/platforms/$(PLATFORM)/build/platform_app.inc endif THEAPPS = \ playback \ message \ record ifneq ($(filter $(PLATFORM), 97408),$(PLATFORM)) THEAPPS += decode \ video endif ifeq ($(B_REFSW_OS),vxworks) # VxWorks needs a wrapper function to call main. VXOBJS = vxworks_cmd.o # We like to use .out for loadable objects. APPSUFFIX = .out APPS = $(addsuffix .out, $(THEAPPS)) else ifeq ($(B_REFSW_OS),linuxkernel) APPSUFFIX = .ko APPS = $(addsuffix ${APPSUFFIX}, $(THEAPPS)) else APPS = $(THEAPPS) endif endif .PHONY: api clean OBJDIR=./obj all: $(APPS) $(OBJDIR)/exists: mkdir -p $(OBJDIR) @touch $@ ifneq ($(NEXUS_PREBUILT_BINARY),y) $(APPS): api endif ifneq ($(findstring linux,$(B_REFSW_OS)),) LDFLAGS := -lnexus${NEXUS_LIB_SUFFIX} -L${NEXUS_BIN_DIR} -lpthread -lm endif # For VxWorks builds, link in the nexus library. ifeq ($(B_REFSW_OS),vxworks) LDFLAGS := -lnexus${NEXUS_LIB_SUFFIX} -L${NEXUS_BIN_DIR} endif # For Android builds ifeq ($(B_REFSW_ANDROID),y) # The following script assumes the gcc version number is the last field on the first line GCC_VERSION ?= $(shell $(CC) --version | $(AWK) 'NR == 1 { print $$NF }') ANDROID_LIB = $(ANDROID)/out/target/product/bcm$(BCHP_CHIP)/obj/lib LDFLAGS := -EL \ -lnexus${NEXUS_LIB_SUFFIX} -L${NEXUS_BIN_DIR} $(EXTRA_DRM_OBJS) \ -Bdynamic \ -Wl,-T,$(ANDROID)/build/core/mipself.x \ -Wl,-dynamic-linker,/system/bin/linker \ -Wl,--gc-sections \ -Wl,-z,nocopyreloc \ -Wl,--no-undefined \ -Wl,-rpath-link=$(ANDROID_LIB) \ -L$(ANDROID_LIB) \ -nostdlib \ $(ANDROID_LIB)/crtbegin_dynamic.o \ $(B_REFSW_TOOLCHAIN_DIR)/lib/gcc/mipsel-linux-uclibc/$(GCC_VERSION)/libgcc.a \ $(B_REFSW_TOOLCHAIN_DIR)/lib/gcc/mipsel-linux-uclibc/$(GCC_VERSION)/libgcc_eh.a \ $(ANDROID_LIB)/crtend_android.o \ -lc -lm endif # This builds the Nexus api api: $(MAKE) -C $(NEXUS_TOP)/build # This cleans nexus and local apps clean: clean_apps $(MAKE) -C $(NEXUS_TOP)/build clean clean_apps: -$(RM) -r $(APPS) $(OBJDIR) # This is the minimum needed to compile and link with Nexus CFLAGS += $(NEXUS_CFLAGS) $(addprefix -I,$(NEXUS_APP_INCLUDE_PATHS)) $(addprefix -D,$(NEXUS_APP_DEFINES)) # Always build with debug CFLAGS += -g # media probe (only needed for playback and record) BSEAV = $(NEXUS_TOP)/../BSEAV include $(BSEAV)/lib/bfile/bfile.inc ifeq ($(MEDIA_AVI_SUPPORT),y) include $(BSEAV)/lib/avi/bavi.inc endif ifeq ($(MEDIA_ASF_SUPPORT),y) include $(BSEAV)/lib/asf/basf.inc endif ifeq ($(MEDIA_RMFF_SUPPORT),y) include $(BSEAV)/lib/media/rmff/brmff.inc endif include $(BSEAV)/lib/utils/batom.inc include $(BSEAV)/lib/media/bmedia.inc CFLAGS += $(addprefix -I,$(BMEDIA_INCLUDES) $(BFILE_MEDIA_INCLUDES)) -I$(BSEAV)/lib/mpeg2_ts_parse -I$(BSEAV)/lib/tspsi CFLAGS += $(addprefix -D,$(BMEDIA_PROBE_DEFINES)) DECODE_SRCS += ./cmdline_args.c ./fileio_custom.c DECODE_OBJS = $(foreach file, $(DECODE_SRCS), $(OBJDIR)/$(notdir $(patsubst %.c, %.o, $(file)))) vpath %.c $(foreach file, $(DECODE_SRCS) $(MESSAGE_SRCS), $(dir $(patsubst %.c, %.o, $(file)))) test: @echo $(EXTRA_OBJS) @echo $(foreach file, $(EXTRA_SRCS), $(dir $(patsubst %.c, %.o, $(file)))) $(OBJDIR)/%.o: %.c ${OBJDIR}/exists @echo [Compile... $<] $(Q_)$(CC) -c -o $@ $< $(CFLAGS) # this is not implicit because we don't link in $(DECODE_OBJS) message: $(OBJDIR)/message.o $(VXOBJS) @echo [Link... $@] ifeq ($(B_REFSW_OS),linuxkernel) ${Q_}$(LD) ${LDFLAGS} --strip-debug -r $(filter %.o, $^) ${NEXUS_BIN_DIR}/libnexus.a -o $@ else $(Q_)$(CC) -o $@ $(filter %.o, $^) $(LDFLAGS) endif cp $@ ${NEXUS_BIN_DIR} # cancel this implicit rule so we can do separate compile & link w/ implicit rules %: %.c %: $(OBJDIR)/%.o $(DECODE_OBJS) $(VXOBJS) @echo [Link... $@] ifeq ($(B_REFSW_OS),linuxkernel) ${Q_}$(LD) ${LDFLAGS} --strip-debug -r $(filter %.o, $^) ${NEXUS_BIN_DIR}/libnexus.a -o $@ else $(Q_)$(CC) -o $@ $(filter %.o, $^) $(LDFLAGS) endif cp $@ ${NEXUS_BIN_DIR} ifeq ($(B_REFSW_OS),vxworks) # Explicit rule for building vxworks wrapper app vxworks_cmd.o: vxworks_cmd.c @echo [Compile... $<] $(Q_)$(CC) -o $@ $< $(CFLAGS) endif install: all