include Rules.make COMPONENTS:=$(DMAI_INSTALL_DIR) $(LINK_INSTALL_DIR) $(XDAIS_INSTALL_DIR) $(CMEM_INSTALL_DIR) $(EDMA3_LLD_INSTALL_DIR) $(FC_INSTALL_DIR) $(CE_INSTALL_DIR) $(XDC_INSTALL_DIR) $(BIOSUTILS_INSTALL_DIR) $(BIOS_INSTALL_DIR) $(DVTB_INSTALL_DIR) $(CODEC_INSTALL_DIR) REPOSITORIES:=$(addsuffix /packages, $(COMPONENTS)) CHECKLIST:=$(REPOSITORIES) $(CODEGEN_INSTALL_DIR)/bin/cl6x $(MVTOOL_PREFIX)gcc $(LINUXKERNEL_INSTALL_DIR)/Documentation $(DEMO_INSTALL_DIR)/$(PLATFORM) $(PSP_INSTALL_DIR)/docs .PHONY: all clean everything clobber help cmem cmem_clean dmai dmai_clean dm355mm dm355mm_clean dsplink dsplink_arm dsplink_dsp dsplink_samples dsplink_clean codecs codecs_clean linux linux_clean info check install #============================================================================== # Set up platform dependent variables. #============================================================================== ifeq ($(PLATFORM),dm6446) LINUXKERNEL_CONFIG=davinci_all_defconfig LINUXSAMPLES_PLATFORM=dm644x DSPLINK_CONFIG=--platform=DAVINCI --nodsp=1 --dspcfg_0=DM6446GEMSHMEM --dspos_0=DSPBIOS5XX --gppos=MVL5G --comps=ponslrm DSPLINK_MODULE=$(LINK_INSTALL_DIR)/packages/dsplink/gpp/export/BIN/Linux/DAVINCI/RELEASE/dsplinkk.ko DMAI_PLATFORM=dm6446_al else ifeq ($(PLATFORM),dm6467) LINUXKERNEL_CONFIG=davinci_all_defconfig LINUXSAMPLES_PLATFORM=dm646x DSPLINK_CONFIG=--platform=DAVINCIHD --nodsp=1 --dspcfg_0=DM6467GEMSHMEM --dspos_0=DSPBIOS5XX --gppos=MVL5G --comps=ponslrm DSPLINK_MODULE=$(LINK_INSTALL_DIR)/packages/dsplink/gpp/export/BIN/Linux/DAVINCIHD/RELEASE/dsplinkk.ko DMAI_PLATFORM=dm6467_al else ifeq ($(PLATFORM),dm355) LINUXKERNEL_CONFIG=davinci_dm355_defconfig LINUXSAMPLES_PLATFORM=dm355 DMAI_PLATFORM=dm355_al else $(error PLATFORM not set correctly: $(PLATFORM)) endif endif endif #============================================================================== # The default build target. #============================================================================== all: check cmem dm355mm dmai #============================================================================== # Clean up the targets built by 'make all'. #============================================================================== clean: cmem_clean dm355mm_clean dmai_clean #============================================================================== # Build everything rebuildable. #============================================================================== everything: check codecs linux dsplink all #============================================================================== # Clean up all targets. #============================================================================== clobber: clean dsplink_clean linux_clean codecs_clean #============================================================================== # A help message target. #============================================================================== help: @echo @echo "Available build targets are:" @echo @echo " check : Make sure Rules.make is set up properly" @echo " info : List versions of DVSDK components" @echo @echo " all : Build the components below" @echo " clean : Remove files generated by the 'all' target" @echo @echo " cmem : Build the CMEM kernel module for $(PLATFORM)" @echo " cmem_clean : Remove generated cmem files." @echo @echo " dmai : Build DMAI for $(PLATFORM)_al" @echo " dmai_clean : Remove generated DMAI files." @echo @echo " dm355mm : Build the dm355mm kernel module" @echo " dm355mm_clean : Remove generated dm355mm files" @echo @echo "The following targets have to be explicitly built and cleaned:" @echo @echo " everything : Rebuild everything including below targets" @echo " clobber : Remove all generated files" @echo @echo " dsplink : Configure and build DSP Link for $(PLATFORM) ARM and DSP" @echo " dsplink_arm : Configure and build DSP Link for $(PLATFORM) ARM" @echo " dsplink_dsp : Configure and build DSP Link for $(PLATFORM) DSP" @echo " dsplink_samples : Build DSP Link ARM and DSP sample applications " @echo " dsplink_clean : Remove generated DSP Link files" @echo @echo " codecs : Build codec servers for $(PLATFORM)" @echo " codecs_clean : Remove generated codec server files" @echo @echo " linux : Build Linux kernel uImage for $(PLATFORM)" @echo " linux_clean : Remove generated Linux kernel files" @echo @echo " install : Install binaries to $(EXEC_DIR)" @echo #============================================================================== # Target for listing information about the DVSDK components. #============================================================================== info: check @LINUXKERNEL_INSTALL_DIR="$(LINUXKERNEL_INSTALL_DIR)" CODEGEN_INSTALL_DIR="$(CODEGEN_INSTALL_DIR)" GCC_PREFIX="$(MVTOOL_PREFIX)" XDC_INSTALL_DIR="$(XDC_INSTALL_DIR)" REPOSITORIES="$(REPOSITORIES)" $(DVSDK_INSTALL_DIR)/bin/info.sh #============================================================================== # Target for checking that the Rules.make file is set up properly. #============================================================================== check: @CHECKLIST="$(CHECKLIST)" $(DVSDK_INSTALL_DIR)/bin/check.sh #============================================================================== # Build the Linux kernel. Also, an explicit cleanup target is defined. #============================================================================== linux: $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) CROSS_COMPILE=$(MVTOOL_PREFIX) $(LINUXKERNEL_CONFIG) $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) CROSS_COMPILE=$(MVTOOL_PREFIX) uImage @echo @echo "Your kernel image can be found at $(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/uImage" linux_clean: $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) CROSS_COMPILE=$(MVTOOL_PREFIX) clean #============================================================================== # Build the CMEM kernel module for the configured platform, and make sure the # kernel_binaries directory is kept in sync. Also, an explicit cleanup target # is defined. #============================================================================== cmem: $(MAKE) -C $(CMEM_INSTALL_DIR)/packages/ti/sdo/linuxutils/cmem/src/interface ../../lib/cmem.a470MV $(MAKE) -C $(CMEM_INSTALL_DIR)/packages/ti/sdo/linuxutils/cmem/src/module @mkdir -p $(DVSDK_INSTALL_DIR)/kernel_binaries/$(PLATFORM) @cp $(CMEM_INSTALL_DIR)/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.ko $(DVSDK_INSTALL_DIR)/kernel_binaries/$(PLATFORM)/ @echo @echo "cmemk.ko kernel module can be found under $(DVSDK_INSTALL_DIR)/kernel_binaries/$(PLATFORM)" cmem_clean: $(MAKE) -C $(CMEM_INSTALL_DIR)/packages/ti/sdo/linuxutils/cmem/src/module clean $(MAKE) -C $(CMEM_INSTALL_DIR)/packages/ti/sdo/linuxutils/cmem/src/interface clean #============================================================================== # Build the *evaluation* codec servers for the configured platform. Also, an # explicit cleanup target is defined. #============================================================================== codecs: ifneq ($(PLATFORM),dm355) $(MAKE) -C $(CODEC_INSTALL_DIR) DVSDK_INSTALL_DIR=$(DVSDK_INSTALL_DIR) BIOS_INSTALL_DIR=$(BIOS_INSTALL_DIR) XDC_INSTALL_DIR=$(XDC_INSTALL_DIR) CE_INSTALL_DIR=$(CE_INSTALL_DIR) FC_INSTALL_DIR=$(FC_INSTALL_DIR) CMEM_INSTALL_DIR=$(CMEM_INSTALL_DIR) CODECS_INSTALL_DIR=$(CODEC_INSTALL_DIR) BIOSUTILS_INSTALL_DIR=$(BIOSUTILS_INSTALL_DIR) XDAIS_INSTALL_DIR=$(XDAIS_INSTALL_DIR) LINK_INSTALL_DIR=$(LINK_INSTALL_DIR) XDCARGS=\"eval\" endif codecs_clean: ifneq ($(PLATFORM),dm355) $(MAKE) -C $(CODEC_INSTALL_DIR) DVSDK_INSTALL_DIR=$(DVSDK_INSTALL_DIR) BIOS_INSTALL_DIR=$(BIOS_INSTALL_DIR) XDC_INSTALL_DIR=$(XDC_INSTALL_DIR) CE_INSTALL_DIR=$(CE_INSTALL_DIR) FC_INSTALL_DIR=$(FC_INSTALL_DIR) CMEM_INSTALL_DIR=$(CMEM_INSTALL_DIR) CODECS_INSTALL_DIR=$(CODEC_INSTALL_DIR) BIOSUTILS_INSTALL_DIR=$(BIOSUTILS_INSTALL_DIR) XDAIS_INSTALL_DIR=$(XDAIS_INSTALL_DIR) LINK_INSTALL_DIR=$(LINK_INSTALL_DIR) XDCARGS=\"eval\" clean endif #============================================================================== # Build the dm355mm kernel module (if the configured platform is dm355). Also, # an explicit cleanup target is defined. #============================================================================== dm355mm: ifeq ($(PLATFORM),dm355) $(MAKE) -C $(CODEC_INSTALL_DIR)/dm355mm/module KERNEL_DIR=$(LINUXKERNEL_INSTALL_DIR) @mkdir -p $(DVSDK_INSTALL_DIR)/kernel_binaries/$(PLATFORM) @cp $(CODEC_INSTALL_DIR)/dm355mm/module/dm350mmap.ko $(DVSDK_INSTALL_DIR)/kernel_binaries/$(PLATFORM)/ @echo @echo "dm350mmap.ko kernel module can be found under $(DVSDK_INSTALL_DIR)/kernel_binaries/$(PLATFORM)" endif dm355mm_clean: ifeq ($(PLATFORM),dm355) $(MAKE) -C $(CODEC_INSTALL_DIR)/dm355mm/module KERNEL_DIR=$(LINUXKERNEL_INSTALL_DIR) clean endif #============================================================================== # Build the Davinci Multimedia Application Interface for the configured # platform. Also, an explicit cleanup target is defined. #============================================================================== dmai: @$(MAKE) -C $(DMAI_INSTALL_DIR) PLATFORM=${DMAI_PLATFORM} \ CE_INSTALL_DIR_${DMAI_PLATFORM}=$(CE_INSTALL_DIR) \ CODEC_INSTALL_DIR_${DMAI_PLATFORM}=$(CODEC_INSTALL_DIR) \ LINK_INSTALL_DIR_${DMAI_PLATFORM}=$(LINK_INSTALL_DIR) \ CMEM_INSTALL_DIR_${DMAI_PLATFORM}=$(CMEM_INSTALL_DIR) \ FC_INSTALL_DIR_${DMAI_PLATFORM}=$(FC_INSTALL_DIR) \ LPM_INSTALL_DIR_${DMAI_PLATFORM}=$(LPM_INSTALL_DIR) \ XDAIS_INSTALL_DIR_${DMAI_PLATFORM}=$(XDAIS_INSTALL_DIR) \ BIOS_INSTALL_DIR_${DMAI_PLATFORM}=$(BIOS_INSTALL_DIR) \ LINUXLIBS_INSTALL_DIR_${DMAI_PLATFORM}=$(LINUXLIBS_INSTALL_DIR)\ LINUXKERNEL_INSTALL_DIR_${DMAI_PLATFORM}=$(LINUXKERNEL_INSTALL_DIR) \ CROSS_COMPILE_${DMAI_PLATFORM}=$(CSTOOL_PREFIX) \ XDC_INSTALL_DIR_${DMAI_PLATFORM}=$(XDC_INSTALL_DIR) \ EXEC_DIR_${DMAI_PLATFORM}=$(EXEC_DIR) all @echo @echo "DMAI applications can be found under $(DMAI_INSTALL_DIR)/packages/ti/sdo/dmai/apps" @echo "To install them to $(EXEC_DIR) enter $(DMAI_INSTALL_DIR) and execute 'make install'" dmai_clean: $(MAKE) -C $(DMAI_INSTALL_DIR) PLATFORM=${DMAI_PLATFORM} clean #============================================================================== # Build DSP Link for the configured platform. Also, an explicit cleanup target # is defined. #============================================================================== dsplink: dsplink_arm dsplink_dsp dsplink_samples dsplink_cfg: ifneq ($(PLATFORM),dm355) DSPLINK=$(LINK_INSTALL_DIR)/packages/dsplink perl $(LINK_INSTALL_DIR)/packages/dsplink/config/bin/dsplinkcfg.pl $(DSPLINK_CONFIG) else $(error DSP Link build is not supported for $(PLATFORM)) endif dsplink_arm: dsplink_cfg DSPLINK=$(LINK_INSTALL_DIR)/packages/dsplink $(XDC_INSTALL_DIR)/gmake -C $(LINK_INSTALL_DIR)/packages/dsplink/gpp/src BASE_TOOLCHAIN=$(MVTOOL_DIR) BASE_BUILDOS=$(LINUXKERNEL_INSTALL_DIR) @mkdir -p $(DVSDK_INSTALL_DIR)/kernel_binaries/$(PLATFORM) @cp $(DSPLINK_MODULE) $(DVSDK_INSTALL_DIR)/kernel_binaries/$(PLATFORM)/ @echo @echo "dsplinkk.ko kernel module can be found under $(DVSDK_INSTALL_DIR)/kernel_binaries/$(PLATFORM)" dsplink_dsp: dsplink_cfg DSPLINK=$(LINK_INSTALL_DIR)/packages/dsplink $(XDC_INSTALL_DIR)/gmake -C $(LINK_INSTALL_DIR)/packages/dsplink/dsp/src BASE_SABIOS=$(BIOS_INSTALL_DIR) XDCTOOLS_DIR=$(XDC_INSTALL_DIR) BASE_CGTOOLS=$(CODEGEN_INSTALL_DIR) dsplink_samples: DSPLINK=$(LINK_INSTALL_DIR)/packages/dsplink $(XDC_INSTALL_DIR)/gmake -C $(LINK_INSTALL_DIR)/packages/dsplink/gpp/src/samples BASE_TOOLCHAIN=$(MVTOOL_DIR) BASE_BUILDOS=$(LINUXKERNEL_INSTALL_DIR) DSPLINK=$(LINK_INSTALL_DIR)/packages/dsplink $(XDC_INSTALL_DIR)/gmake -C $(LINK_INSTALL_DIR)/packages/dsplink/dsp/src/samples BASE_SABIOS=$(BIOS_INSTALL_DIR) XDCTOOLS_DIR=$(XDC_INSTALL_DIR) BASE_CGTOOLS=$(CODEGEN_INSTALL_DIR) dsplink_clean: DSPLINK=$(LINK_INSTALL_DIR)/packages/dsplink $(XDC_INSTALL_DIR)/gmake -C $(LINK_INSTALL_DIR)/packages/dsplink/gpp/src BASE_TOOLCHAIN=$(MVTOOL_DIR) BASE_BUILDOS=$(LINUXKERNEL_INSTALL_DIR) clean DSPLINK=$(LINK_INSTALL_DIR)/packages/dsplink $(XDC_INSTALL_DIR)/gmake -C $(LINK_INSTALL_DIR)/packages/dsplink/dsp/src BASE_SABIOS=$(BIOS_INSTALL_DIR) XDCTOOLS_DIR=$(XDC_INSTALL_DIR) BASE_CGTOOLS=$(CODEGEN_INSTALL_DIR) clean DSPLINK=$(LINK_INSTALL_DIR)/packages/dsplink $(XDC_INSTALL_DIR)/gmake -C $(LINK_INSTALL_DIR)/packages/dsplink/gpp/src/samples BASE_TOOLCHAIN=$(MVTOOL_DIR) BASE_BUILDOS=$(LINUXKERNEL_INSTALL_DIR) clean DSPLINK=$(LINK_INSTALL_DIR)/packages/dsplink $(XDC_INSTALL_DIR)/gmake -C $(LINK_INSTALL_DIR)/packages/dsplink/dsp/src/samples BASE_SABIOS=$(BIOS_INSTALL_DIR) XDCTOOLS_DIR=$(XDC_INSTALL_DIR) BASE_CGTOOLS=$(CODEGEN_INSTALL_DIR) clean #============================================================================== # Install the built binaries to the target file system. #============================================================================== install: @echo @echo Creating $(EXEC_DIR) @mkdir -p $(EXEC_DIR) @echo Copying kernel modules to target file system: $(EXEC_DIR)/ @install -m 666 $(DVSDK_INSTALL_DIR)/kernel_binaries/$(PLATFORM)/* $(EXEC_DIR)/ @echo Installing DVSDK demos.. $(MAKE) -C $(DEMO_INSTALL_DIR)/$(PLATFORM) install @echo Copying examples.. @cp -rp examples/$(PLATFORM)/web $(EXEC_DIR)/ @cp -p examples/$(PLATFORM)/dvevmdemo $(EXEC_DIR)/ @echo Installing clips.. $(MAKE) -C clips install ifeq ($(PLATFORM),dm6446) @echo Copying codec servers.. @install -m 666 $(CODEC_INSTALL_DIR)/packages/ti/sdo/servers/encode/encodeCombo.x64P $(EXEC_DIR)/ -@install -m 666 $(CODEC_INSTALL_DIR)/packages/ti/sdo/servers/encode/encodeCombo_e.x64P $(EXEC_DIR)/ @install -m 666 $(CODEC_INSTALL_DIR)/packages/ti/sdo/servers/decode/decodeCombo.x64P $(EXEC_DIR)/ -@install -m 666 $(CODEC_INSTALL_DIR)/packages/ti/sdo/servers/decode/decodeCombo_e.x64P $(EXEC_DIR)/ @install -m 666 $(CODEC_INSTALL_DIR)/packages/ti/sdo/servers/loopback/loopbackCombo.x64P $(EXEC_DIR)/ -@install -m 666 $(CODEC_INSTALL_DIR)/packages/ti/sdo/servers/loopback/loopbackCombo_e.x64P $(EXEC_DIR)/ @echo Copying dsplinkk.ko @install -m 666 $(LINK_INSTALL_DIR)/packages/dsplink/gpp/export/BIN/Linux/DAVINCI/RELEASE/dsplinkk.ko $(EXEC_DIR)/ endif ifeq ($(PLATFORM),dm6467) @echo Copying codec servers.. @install -m 666 $(CODEC_INSTALL_DIR)/packages/ti/sdo/servers/encode/encodeCombo.x64P $(EXEC_DIR)/ -@install -m 666 $(CODEC_INSTALL_DIR)/packages/ti/sdo/servers/encode/encodeCombo_e.x64P $(EXEC_DIR)/ @install -m 666 $(CODEC_INSTALL_DIR)/packages/ti/sdo/servers/decode/decodeCombo.x64P $(EXEC_DIR)/ -@install -m 666 $(CODEC_INSTALL_DIR)/packages/ti/sdo/servers/decode/decodeCombo_e.x64P $(EXEC_DIR)/ @install -m 666 $(CODEC_INSTALL_DIR)/packages/ti/sdo/servers/loopback/loopbackCombo.x64P $(EXEC_DIR)/ -@install -m 666 $(CODEC_INSTALL_DIR)/packages/ti/sdo/servers/loopback/loopbackCombo_e.x64P $(EXEC_DIR)/ @echo Copying dsplinkk.ko @install -m 666 $(LINK_INSTALL_DIR)/packages/dsplink/gpp/export/BIN/Linux/DAVINCIHD/RELEASE/dsplinkk.ko $(EXEC_DIR)/ @echo Copying mapdmaqhd.. @install -m 777 $(DVSDK_INSTALL_DIR)/mapdmaq-hd/mapdmaq-hd $(EXEC_DIR)/ endif ifeq ($(PLATFORM),dm355) @echo Copying mapdmaq.. @install -m 777 $(DVSDK_INSTALL_DIR)/mapdmaq/mapdmaq $(EXEC_DIR)/ endif