# Makefile.common # # Specifies common settings for all build scripts. # # Copyright (C) 2008-2010 Texas Instruments Incorporated - http://www.ti.com/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation version 2.1 of the License. # # This program is distributed #as is# WITHOUT ANY WARRANTY of any kind, # whether express or implied; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. #------------------------------------------------------------------------------ # User specified paths: # EZSDK_INSTALL_DIR # location of EZSDK installation directory; settings from the DVSDK's # Rules.make will be used for the build. # TARGET_ROOT_DIR # root directory of target filesystem on host machine # GSTREAMER_DIR # location of gstreamer installation on target filesystem. This setting # should assume that "/" is the root file system of the target, not the # host. # CROSS_COMPILER # Cross compiler being used. A default is chosen based on the platform # you are building for, but you can set it explicitly to one of these # values: # MVL_5_0: MontaVista v5.0 # CS_2008Q1: CodeSourcery v2008q1 # CS_2009Q1: CodeSourcery v2009q1 # GST_TI_PLATFORM # In most cases this variable will be automatically set to be the same # as the PLATFORM variable in the Rules.make for the DVSDK. Currently # the only time it must be set here is when building for dm6467 or # dm6467t. # # These paths must be specified or the build will fail. #------------------------------------------------------------------------------ TARGET_ROOT_DIR = /home2/hari/ti-ezsdk_dm816x-evm_5_03_01_15/rootfs GSTREAMER_DIR = /usr GST_TI_PLATFORM = dm816x EZSDK_INSTALL_DIR = /home2/hari/ti-ezsdk_dm816x-evm_5_03_01_15 #------------------------------------------------------------------------------ # Build configuration: # # VERBOSE # Set to "true" to see all build commands. #------------------------------------------------------------------------------ VERBOSE = true #------------------------------------------------------------------------------ # Pull in build settings from the DVSDK, and error-check the settings we get. #------------------------------------------------------------------------------ ifndef EZSDK_INSTALL_DIR $(error EZSDK_INSTALL_DIR must be set in Makefile before building) endif include $(EZSDK_INSTALL_DIR)/Rules.make # Set GST_TI_PLATFORM from the DVSDK's variable if it hasn't been set already ifndef GST_TI_PLATFORM $(error when building for dm816x or dm814x, the platform type must be specified explicity at the top of Makefile.commom with GST_TI_PLATFORM=dm814x or GST_TI_PLATFORM=dm816x) endif # DVSDK 1.30 doesn't include DMAI, so make sure it gets added to the Rules.make ifneq ($(GST_TI_PLATFORM), dm816x) ifneq ($(GST_TI_PLATFORM), dm814x) $(error the platform type must be specified explicity at the top of Makefile.commom with GST_TI_PLATFORM=dm814x or GST_TI_PLATFORM=dm816x) endif endif # Ensure the target root directory is set. ifndef TARGET_ROOT_DIR $(error TARGET_ROOT_DIR must be set in Makefile before building) endif # Export Rules.make variables so they are visible to the sub-makes export BIOS_INSTALL_DIR export CE_INSTALL_DIR export CMEM_INSTALL_DIR export CODEC_INSTALL_DIR export DMAI_INSTALL_DIR export FC_INSTALL_DIR export LINK_INSTALL_DIR export LINK_XDC_ROOT = $(LINK_INSTALL_DIR)/packages export LINUXLIBS_INSTALL_DIR export LINUXKERNEL_INSTALL_DIR export LPM_INSTALL_DIR export MVTOOL_DIR export MVTOOL_PREFIX export GST_TI_PLATFORM export XDAIS_INSTALL_DIR export XDC_INSTALL_DIR export EDMA3_LLD_INSTALL_DIR export USER_XDC_PATH export LINUX_DEVKIT_DIR export UIA_INSTALL_DIR #------------------------------------------------------------------------------ # Location of gstreamer installation on target #------------------------------------------------------------------------------ TARGET_GSTREAMER_DIR = $(TARGET_ROOT_DIR)/$(GSTREAMER_DIR) #------------------------------------------------------------------------------ # Set a default cross compiler if one has not been specified #------------------------------------------------------------------------------ ifndef CROSS_COMPILER ifeq ($(GST_TI_PLATFORM), dm355) CROSS_COMPILER=CS_2009Q1 endif ifeq ($(GST_TI_PLATFORM), dm6446) CROSS_COMPILER=MVL_5_0 endif ifeq ($(GST_TI_PLATFORM), dm6467) CROSS_COMPILER=MVL_5_0 endif ifeq ($(GST_TI_PLATFORM), dm6467t) CROSS_COMPILER=CS_2009Q1 endif ifeq ($(GST_TI_PLATFORM), dm365) CROSS_COMPILER=CS_2009Q1 endif ifeq ($(GST_TI_PLATFORM), dm368) CROSS_COMPILER=CS_2009Q1 endif ifeq ($(GST_TI_PLATFORM), omap3530) CROSS_COMPILER=CS_2008Q1 endif ifeq ($(GST_TI_PLATFORM), omapl138) CROSS_COMPILER=CS_2009Q1 endif ifeq ($(GST_TI_PLATFORM), dm3730) CROSS_COMPILER=CS_2009Q1 endif ifeq ($(GST_TI_PLATFORM), dm816x) CROSS_COMPILER=CS_2009Q1 endif ifeq ($(GST_TI_PLATFORM), dm814x) CROSS_COMPILER=CS_2009Q1 endif endif #------------------------------------------------------------------------------ # Set the CROSS_COMPILE_PREFIX variable, this is used by libtool while linking # the cross compiled libraries on MV platform #------------------------------------------------------------------------------ # NOTE: If you're using the MontaVista toolchain, CROSS_COMPILE_PREFIX must be # the location of the filesystem within the MontaVista directory, not # your custom filesystem. MontaVista will sometimes fail to link # libraries such as -lpthread correctly if you specify a target # filesystem in a different location. #------------------------------------------------------------------------------ export CROSS_COMPILE_PREFIX = $(TARGET_ROOT_DIR) ifeq ($(CROSS_COMPILER), MVL_5_0) export CROSS_COMPILE_PREFIX = $(MVLTOOL_DIR)/target endif #------------------------------------------------------------------------------ # Set XDC target and platform based on PLATFORM variable #------------------------------------------------------------------------------ ifeq ($(GST_TI_PLATFORM), dm355) export XDC_TARGET = gnu.targets.arm.GCArmv5T export XDC_PLATFORM = ti.platforms.evmDM355 export MVTOOL_PREFIX = $(CSTOOL_PREFIX) export MVTOOL_DIR = $(CSTOOL_DIR) export PLATFORM_XDC = $(XDC_PLATFORM) export CROSS_COMPILE = $(CSTOOL_PREFIX) endif ifeq ($(GST_TI_PLATFORM), dm6446) export XDC_TARGET = gnu.targets.MVArm9 export XDC_PLATFORM = ti.platforms.evmDM6446 endif ifeq ($(GST_TI_PLATFORM), dm365) export XDC_TARGET = gnu.targets.arm.GCArmv5T export XDC_PLATFORM = ti.platforms.evmDM365 export MVTOOL_PREFIX = $(CSTOOL_PREFIX) export MVTOOL_DIR = $(CSTOOL_DIR) export PLATFORM_XDC = $(XDC_PLATFORM) export CROSS_COMPILE = $(CSTOOL_PREFIX) export LIBTOOL_SYSROOT_PATH = $(LINUXLIBS_INSTALL_DIR)/.. export ENABLE_TIDISPLAYSINK2 = true endif ifeq ($(GST_TI_PLATFORM), dm368) export XDC_TARGET = gnu.targets.arm.GCArmv5T export XDC_PLATFORM = ti.platforms.evmDM365 export MVTOOL_PREFIX = $(CSTOOL_PREFIX) export MVTOOL_DIR = $(CSTOOL_DIR) export PLATFORM_XDC = $(XDC_PLATFORM) export CROSS_COMPILE = $(CSTOOL_PREFIX) export LIBTOOL_SYSROOT_PATH = $(LINUXLIBS_INSTALL_DIR)/.. export ENABLE_TIDISPLAYSINK2 = true endif ifeq ($(GST_TI_PLATFORM), dm6467) export XDC_TARGET = gnu.targets.MVArm9 export XDC_PLATFORM = ti.platforms.evmDM6467 endif ifeq ($(GST_TI_PLATFORM), dm6467t) export XDC_TARGET = gnu.targets.arm.GCArmv5T export XDC_PLATFORM = ti.platforms.evmDM6467 export LINK_XDC_ROOT = $(LINK_INSTALL_DIR) export MVTOOL_PREFIX = $(CSTOOL_PREFIX) export MVTOOL_DIR = $(CSTOOL_DIR) export PLATFORM_XDC = $(XDC_PLATFORM) export CROSS_COMPILE = $(CSTOOL_PREFIX) endif ifeq ($(GST_TI_PLATFORM), omap3530) export XDC_TARGET = gnu.targets.arm.GCArmv5T export XDC_PLATFORM = ti.platforms.evm3530 export MVTOOL_PREFIX = $(CSTOOL_PREFIX) export MVTOOL_DIR = $(CSTOOL_DIR) export PLATFORM_XDC = $(XDC_PLATFORM) export CROSS_COMPILE = $(CSTOOL_PREFIX) export LINK_XDC_ROOT = $(LINK_INSTALL_DIR) export C6ACCEL_INSTALL_DIR export ENABLE_C6ACCEL = true export C6ACCEL_PLATFORM = $(GST_TI_PLATFORM) export LIBTOOL_SYSROOT_PATH=$(LINUXLIBS_INSTALL_DIR)/.. export ENABLE_TIDISPLAYSINK2 = true endif ifeq ($(GST_TI_PLATFORM), dm3730) export XDC_TARGET = gnu.targets.arm.GCArmv5T export XDC_PLATFORM = ti.platforms.evm3530 export MVTOOL_PREFIX = $(CSTOOL_PREFIX) export MVTOOL_DIR = $(CSTOOL_DIR) export PLATFORM_XDC = $(XDC_PLATFORM) export CROSS_COMPILE = $(CSTOOL_PREFIX) export LINK_XDC_ROOT = $(LINK_INSTALL_DIR) export C6ACCEL_INSTALL_DIR export ENABLE_C6ACCEL = true export C6ACCEL_PLATFORM = omap3530 export LIBTOOL_SYSROOT_PATH=$(LINUXLIBS_INSTALL_DIR)/.. export ENABLE_TIDISPLAYSINK2 = true endif ifeq ($(GST_TI_PLATFORM), omapl138) export XDC_TARGET = gnu.targets.arm.GCArmv5T export XDC_PLATFORM = ti.platforms.evmOMAPL138 export MVTOOL_PREFIX = $(CSTOOL_PREFIX) export MVTOOL_DIR = $(CSTOOL_DIR) export PLATFORM_XDC = $(XDC_PLATFORM) export CROSS_COMPILE = $(CSTOOL_PREFIX) export LINK_XDC_ROOT = $(LINK_INSTALL_DIR) export C6ACCEL_INSTALL_DIR export ENABLE_C6ACCEL = true export C6ACCEL_PLATFORM = $(GST_TI_PLATFORM) export LIBTOOL_SYSROOT_PATH=$(LINUXLIBS_INSTALL_DIR)/.. export ENABLE_TIDISPLAYSINK2 = true endif ifeq ($(GST_TI_PLATFORM), dm816x) export MVTOOL_PREFIX = $(CSTOOL_PREFIX) export MVTOOL_DIR = $(CSTOOL_DIR) export CROSS_COMPILE = $(CSTOOL_PREFIX) export LINUXLIBS_INSTALL_DIR=$(LINUX_DEVKIT_DIR)/arm-none-linux-gnueabi/usr export LIBTOOL_SYSROOT_PATH=$(LINUXLIBS_INSTALL_DIR)/.. export OMX_INSTALL_DIR export OMX_PLATFORM = ti816x-evm export SYSBIOS_INSTALL_DIR export OSAL_INSTALL_DIR export IPC_INSTALL_DIR export SYSLINK_INSTALL_DIR export IVAHD_HDVICP20API_INSTALL_DIR export TMS470_CODEGEN_INSTALL_DIR export HDVPSS_INSTALL_DIR export XDC_TARGET = gnu.targets.arm.GCArmv5T export XDC_PLATFORM = ti.platforms.evmTI816X export PLATFORM_XDC = $(XDC_PLATFORM) export CROSS_COMPILE = $(CSTOOL_PREFIX) export OMTB_INSTALL_DIR export LINUXUTILS_INSTALL_DIR endif ifeq ($(GST_TI_PLATFORM), dm814x) export MVTOOL_PREFIX = $(CSTOOL_PREFIX) export MVTOOL_DIR = $(CSTOOL_DIR) export CROSS_COMPILE = $(CSTOOL_PREFIX) export LINUXLIBS_INSTALL_DIR=$(LINUX_DEVKIT_DIR)/arm-none-linux-gnueabi/usr export LIBTOOL_SYSROOT_PATH=$(LINUXLIBS_INSTALL_DIR)/.. export OMX_INSTALL_DIR export OMX_PLATFORM = ti814x-evm export SYSBIOS_INSTALL_DIR export OSAL_INSTALL_DIR export IPC_INSTALL_DIR export SYSLINK_INSTALL_DIR export IVAHD_HDVICP20API_INSTALL_DIR export TMS470_CODEGEN_INSTALL_DIR export HDVPSS_INSTALL_DIR export XDC_TARGET = gnu.targets.arm.GCArmv5T export XDC_PLATFORM = ti.platforms.evmTI816X export PLATFORM_XDC = $(XDC_PLATFORM) export CROSS_COMPILE = $(CSTOOL_PREFIX) export OMTB_INSTALL_DIR export LINUXUTILS_INSTALL_DIR endif #------------------------------------------------------------------------------ # CPPFLAGS/CFLAGS/LDFLAGS that should be used when building packages. # # CPPFLAGS_all - Prerocessor flags used with all platforms # CPPFLAGS_ - Additional preprocessor flags for # # CFLAGS_all - Compiler flags used with all platforms # CFLAGS_ - Additional compiler flags for # # LDFLAGS_all - Linker flags used with all platforms # LDFLAGS_ - Additional linker flags for # # Note on platforms that have "-I$(LINUXKERNEL_INSTALL_DIR)/include": # # On MVL-based LSPs we need to include the LSP headers directly # in order to gain access to custom V4L2 ioctls. This is ok on MVL-based # platforms, as we know the kernel headers in the PSP are in sync with # the kernel headers in the gcc toolset. However, it is not safe to do # this on platforms that use non-MVL PSPs. Fortunately, the new PSPs based # on the later GIT kernels do not have custom ioctls, so including the PSP # headers directly is not needed, and the headers that come with gcc should # be sufficient. #------------------------------------------------------------------------------ CPPFLAGS_all = -DPlatform_$(GST_TI_PLATFORM) CPPFLAGS_all += -I$(TARGET_GSTREAMER_DIR)/include CPPFLAGS_dm6446 = -DMVL_LSP CPPFLAGS_dm6446 += -I$(LINUXKERNEL_INSTALL_DIR)/include CPPFLAGS_dm6467 = -DMVL_LSP CPPFLAGS_dm6467 += -I$(LINUXKERNEL_INSTALL_DIR)/include CPPFLAGS_dm355 = -I$(LINUXLIBS_INSTALL_DIR)/include CPPFLAGS_dm365 = -I$(LINUXLIBS_INSTALL_DIR)/include CPPFLAGS_dm365 += -I$(LINUXKERNEL_INSTALL_DIR)/include CPPFLAGS_dm368 = -I$(LINUXLIBS_INSTALL_DIR)/include CPPFLAGS_dm368 += -I$(LINUXKERNEL_INSTALL_DIR)/include CPPFLAGS_dm6467t = -I$(LINUXLIBS_INSTALL_DIR)/include CPPFLAGS_omap3530 = -I$(LINUXLIBS_INSTALL_DIR)/include CPPFLAGS_dm3730 = -I$(LINUXLIBS_INSTALL_DIR)/include CPPFLAGS_omapl138 = -I$(LINUXLIBS_INSTALL_DIR)/include CPPFLAGS_dm816x = -I$(LINUXKERNEL_INSTALL_DIR)/include -I$(LINUXKERNEL_INSTALL_DIR)/arch/arm/include CPPFLAGS_dm816x += -I$(LINUXLIBS_INSTALL_DIR)/include CPPFLAGS_dm814x = -I$(LINUXKERNEL_INSTALL_DIR)/include -I$(LINUXKERNEL_INSTALL_DIR)/arch/arm/include CPPFLAGS_dm814x += -I$(LINUXLIBS_INSTALL_DIR)/include CFLAGS_all = -O2 CFLAGS_dm355 = -march=armv5te -mtune=arm926ej-s CFLAGS_dm6446 = -march=armv5te -mtune=arm926ej-s CFLAGS_dm365 = -march=armv5te -mtune=arm926ej-s CFLAGS_dm368 = -march=armv5te -mtune=arm926ej-s CFLAGS_dm6467 = -march=armv5te -mtune=arm926ej-s CFLAGS_dm6467t = -march=armv5te -mtune=arm926ej-s CFLAGS_omapl138 = -march=armv5te -mtune=arm926ej-s CFLAGS_omap3530 = -march=armv7-a -mtune=cortex-a8 CFLAGS_omap3530 += -mfpu=neon -mfloat-abi=softfp CFLAGS_dm3730 = -march=armv7-a -mtune=cortex-a8 CFLAGS_dm3730 += -mfpu=neon -mfloat-abi=softfp CFLAGS_dm816x = -march=armv7-a -mtune=cortex-a8 CFLAGS_dm816x += -mfpu=neon -mfloat-abi=softfp CFLAGS_dm814x = -march=armv7-a -mtune=cortex-a8 CFLAGS_dm814x += -mfpu=neon -mfloat-abi=softfp ASFLAGS_dm816x = -march=armv7-a -mtune=cortex-a8 ASFLAGS_dm816x += -mfpu=neon -mfloat-abi=softfp ASFLAGS_dm814x = -march=armv7-a -mtune=cortex-a8 ASFLAGS_dm814x += -mfpu=neon -mfloat-abi=softfp LDFLAGS_all = -L$(TARGET_GSTREAMER_DIR)/lib LDFLAGS_dm355 = -L$(LINUXLIBS_INSTALL_DIR)/lib LDFLAGS_dm365 = -L$(LINUXLIBS_INSTALL_DIR)/lib LDFLAGS_dm368 = -L$(LINUXLIBS_INSTALL_DIR)/lib LDFLAGS_dm6467t = -L$(LINUXLIBS_INSTALL_DIR)/lib LDFLAGS_omap3530 = -L$(LINUXLIBS_INSTALL_DIR)/lib LDFLAGS_dm3730 = -L$(LINUXLIBS_INSTALL_DIR)/lib LDFLAGS_omapl138 = -L$(LINUXLIBS_INSTALL_DIR)/lib LDFLAGS_dm816x = -L$(LINUXLIBS_INSTALL_DIR)/lib LDFLAGS_dm814x = -L$(LINUXLIBS_INSTALL_DIR)/lib #------------------------------------------------------------------------------ # Enable ALSA support based on the CROSS_COMPILER we're using #------------------------------------------------------------------------------ ifeq ($(CROSS_COMPILER), MVL_5_0) export ALSA_SUPPORT = --enable-alsa endif ifeq ($(CROSS_COMPILER), CS_2008Q1) export ALSA_SUPPORT = --enable-alsa --with-alsa-inc-prefix=$(LINUXLIBS_INSTALL_DIR)/include --with-alsa-prefix=$(LINUXLIBS_INSTALL_DIR)/lib endif ifeq ($(CROSS_COMPILER), CS_2009Q1) export ALSA_SUPPORT = --enable-alsa --with-alsa-inc-prefix=$(LINUXLIBS_INSTALL_DIR)/include --with-alsa-prefix=$(LINUXLIBS_INSTALL_DIR)/lib endif #------------------------------------------------------------------------------ # Configure amount of output we will generate based on the VERBOSE variable # setting. #------------------------------------------------------------------------------ ifeq ($(VERBOSE), false) override CMD_PREFIX = @ override TAR_VERBOSE = override CONFIGURE_VERBOSE = -q override PATCH_VERBOSE = -s override MAKE_VERBOSE = -s else override CMD_PREFIX = override TAR_VERBOSE = v override CONFIGURE_VERBOSE = override PATCH_VERBOSE = override MAKE_VERBOSE = endif #------------------------------------------------------------------------------ # If the word "install" appears on the command line, we will invoke sub-make # commands with "make install" instead of just "make". #------------------------------------------------------------------------------ ifeq ($(findstring install,$(MAKECMDGOALS)),install) override BUILD_INSTALL = install else override BUILD_INSTALL = endif #------------------------------------------------------------------------------ # Configure command set up to do a cross-compile and install into the target # filesystem. #------------------------------------------------------------------------------ CC_CONFIGURE_OPTS = --build=i686-linux --host=arm-linux CC_CONFIGURE_OPTS = --build=i686-linux --host=arm-none-linux-gnueabi CC_CONFIGURE_OPTS += --prefix=$(TARGET_GSTREAMER_DIR) CC_CONFIGURE_OPTS += NM=$(MVTOOL_PREFIX)nm CC_CONFIGURE_OPTS += RANLIB=$(MVTOOL_PREFIX)ranlib CC_CONFIGURE_OPTS += CPPFLAGS="$(CPPFLAGS_all) $(CPPFLAGS_$(GST_TI_PLATFORM))" CC_CONFIGURE_OPTS += CFLAGS="$(CFLAGS_all) $(CFLAGS_$(GST_TI_PLATFORM))" CC_CONFIGURE_OPTS += ASFLAGS="$(ASFLAGS_$(GST_TI_PLATFORM))" CC_CONFIGURE_OPTS += LDFLAGS="$(LDFLAGS_all) $(LDFLAGS_$(GST_TI_PLATFORM))" export CC = $(MVTOOL_PREFIX)gcc export CXX = $(MVTOOL_PREFIX)g++ export PKG_CONFIG_PATH = $(TARGET_GSTREAMER_DIR)/lib/pkgconfig export PKG_CONFIG_LIBDIR = $(PKG_CONFIG_PATH)