Advertisement
Guest User

Untitled

a guest
Nov 18th, 2011
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.90 KB | None | 0 0
  1. # Includes your Rules.make from the DVSDK directory
  2. include Rules.make
  3.  
  4. # Location of TI Code Generation Tools if not provided in Rules.make
  5. ifndef CODEGEN_INSTALL_DIR
  6. CODEGEN_INSTALL_DIR = /media/8cb6c643-3377-4bb9-99bc-810069de5757/home/parana/setup-scripts/build/tmp-angstrom_2008_1/sysroots/beagleboard-angstrom-linux-gnueabi/usr/share/ti/ti-cgt6x-tree
  7. endif
  8.  
  9.  
  10.  
  11. ifndef CROSS_COMPILE
  12. CROSS_COMPILE = /media/8cb6c643-3377-4bb9-99bc-810069de5757/home/parana/setup-scripts/build/tmp-angstrom_2008_1/sysroots/i686-linux/usr/bin/arm-angstrom-linux-gnueabi-
  13. endif
  14.  
  15. ifeq ($(PLATFORM),omap3530)
  16. XDC_PLATFORM = ti.platforms.evm3530
  17. XDC_TARGETS = "gnu.targets.arm.GCArmv5T ti.targets.C64P"
  18. endif
  19.  
  20. # Location of IUNIVERSAL Examples
  21. PACKAGE_DIR = $(shell pwd)
  22. SERVER_DIR = $(PACKAGE_DIR)/beagle/c6accel_1_00_00_04_async/soc/packages
  23.  
  24. export SERVER_DIR
  25.  
  26.  
  27. XDCPATH = ^;$(CURDIR);$(PACKAGE_DIR);$(SERVER_DIR);$(CE_INSTALL_DIR)/packages;$(BIOS_INSTALL_DIR)/packages;$(CODEC_INSTALL_DIR);$(FC_INSTALL_DIR)/packages;$(LINK_INSTALL_DIR);$(XDAIS_INSTALL_DIR)/packages;$(CMEM_INSTALL_DIR)/packages;$(BIOSUTILS_INSTALL_DIR)/packages;$(LPM_INSTALL_DIR)/packages
  28.  
  29.  
  30. # Set the number of concurrent build threads (i.e. jobs)
  31. JOBS = 1
  32.  
  33. # Conditionally set the XDCOPTIONS
  34. XDCOPTIONS=v
  35.  
  36. ########################################################
  37. ## Shouldn't have to modify anything be low this line ##
  38. ########################################################
  39.  
  40. # Currently only Linux apps are supported thus the app extension is always the same
  41. APP_EXT = v5T
  42.  
  43. # Parse XDC_TARGETS to find the ARM and DSP targets
  44. XDC_ARM_TARGET = $(shell echo $(XDC_TARGETS) | cut -d' ' -f1)
  45. XDC_DSP_TARGET = $(shell echo $(XDC_TARGETS) | cut -d' ' -f2)
  46.  
  47. # Export environment variables needed by config.bld and Makefile.app
  48. export CODEGEN_INSTALL_DIR
  49. export XDC_INSTALL_DIR
  50. export XDC_PLATFORM
  51. export XDC_TARGETS
  52. export XDCPATH
  53. export XDCOPTIONS
  54. export XDCARGS
  55. export PACKAGE_DIR
  56. export PLATFORM_SHORT
  57. export CROSS_COMPILE
  58. export XDC_ARM_TARGET
  59. export XDC_DSP_TARGET
  60. export APP_EXT
  61.  
  62.  
  63. # Set the location of the xdc executable
  64. XDC = $(XDC_INSTALL_DIR)/xdc XDCOPTIONS=$(XDCOPTIONS) XDCTARGETS=$(XDC_TARGETS)
  65.  
  66. # Get the suffix of the XDC_PLATFORM to identify appropriate paths
  67. PLATFORM_SHORT = $(patsubst .%,%,$(suffix $(XDC_PLATFORM)))
  68.  
  69. ifeq ($(PLATFORM_SHORT),"")
  70. $(error Failed to get short platform name from $(XDC_PLATFORM) $(PLATFORM_SHORT))
  71. endif
  72.  
  73. # Search for the server path with all lower case letters
  74. PLATFORM_SHORT_LC = $(shell echo $(PLATFORM_SHORT) | tr [:upper:] [:lower:])
  75. SERVER_PATH = $(wildcard beagle/server/*$(PLATFORM_SHORT_LC))
  76. SERVER_PATH_SHORT = $(shell echo $(SERVER_PATH) | cut -d' ' -f1)
  77.  
  78. C6ACCEL_PATH = beagle/c6accel_1_00_00_04_async
  79.  
  80. ifeq ($(SERVER_PATH),"")
  81. $(error No servers found with $(SERVER_EXTENSION) extension)
  82. endif
  83.  
  84. # Vars needed to build ARM Linux library
  85. HEADERS = $(wildcard beagle/library/opencv/*.h)
  86. SOURCES = $(wildcard beagle/library/opencv/*.c)
  87. OBJFILES = $(SOURCES:%.c=%.ov5T)
  88. TARGET = beagle/library/opencv/lib/libopencvdsp.so
  89. GNU_C_FLAGS = $(C_FLAGS) $(CFLAGS) -Wall -Dxdc_target_name__=MVArm9 -I$(XDC_INSTALL_DIR)/packages -I$(CE_INSTALL_DIR)/packages -I$(XDAIS_INSTALL_DIR)/packages -I$(BIOS_INSTALL_DIR)/packages -I$(FC_INSTALL_DIR)/packages -I$(LINK_INSTALL_DIR)/packages -I$(FC_INSTALL_DIR)/packages -I$(BIOSUTILS_INSTALL_DIR)/packages -I$(LPM_INSTAL_DIR)/packages -I$(LINUXKERNEL_INSTALL_DIR)/include -I$(BIOS_INSTALL_DIR)/packages/ti/bios/include -I$(DMAI_INSTALL_DIR)/packages -I$(CURDIR) -I$(SERVER_DIR) -Dxdc_target_types__=gnu/targets/std.h -D_$(PLATFORM)
  90. GNU_AR_FLAGS = $(AR_FLAGS)
  91. GNU_LD_FLAGS = $(LD_FLAGS) $(LDFLAGS)
  92. COMPILE = $(PRE) $(CROSS_COMPILE)g++ $(GNU_C_FLAGS) $(GNU_CPP_FLAGS) -c
  93. AR = $(PRE) $(CROSS_COMPILE)ar rc $(GNU_AR_FLAGS)
  94. LD = $(PRE) $(CROSS_COMPILE)g++ $(GNU_LD_FLAGS)
  95.  
  96. .PHONY: clean clean_app clean_lib clean_c6accel library c6accel app install all
  97.  
  98. help:
  99. @echo
  100. @echo "You must specify a build target. Available targets are: "
  101. @echo " all, c6accel, library, app, install, clean"
  102.  
  103. all: c6accel library app install
  104.  
  105. c6accel:
  106. @echo "$(C6ACCEL_PATH)"
  107. make -C $(C6ACCEL_PATH) all
  108.  
  109. $(OBJFILES): %.ov5T: %.c $(HEADERS)
  110. @echo $(shell pwd)
  111. @echo Compiling $@ from $<
  112. @mkdir -p $(dir $@)
  113. $(COMPILE) $(CPP_FLAGS) -o $@ $<
  114.  
  115. $(TARGET): $(OBJFILES)
  116. @echo
  117. @echo Building Shared Library $@ from $^..
  118. @mkdir -p $(dir $@)
  119. $(LD) -shared -o $@ $^
  120.  
  121. package/package.defs.h:beagle/library/opencv/package.xdc beagle/library/opencv/package.xs beagle/library/opencv/package.bld
  122. @echo
  123. @echo Building package interface for $(TARGET)
  124. $(XDC) XDCBUILDCFG=$(PACKAGE_DIR)/config.bld -PR beagle/library
  125.  
  126. library: $(TARGET) package/package.defs.h
  127.  
  128. app: opencv
  129.  
  130. opencv: $(if $(wildcard beagle/apps/opencv/linux/remote_ti_platforms_$(PLATFORM_SHORT).cfg), opencv_remote)
  131.  
  132. opencv_remote:
  133. make -C beagle/apps/opencv -f $(PACKAGE_DIR)/Makefile.app TARGET=linux/remote_ti_platforms_$(PLATFORM_SHORT) APP_NAME=opencv PLATFORM=$(PLATFORM) PACKAGE_DIR=$(PACKAGE_DIR) SERVER_PATH=$(SERVER_PATH)
  134.  
  135. install:
  136. @echo "Installing at $(EXEC_DIR)"
  137. @install -d $(EXEC_DIR)
  138. @install -m 777 $(SERVER_DIR)/ti/c6accel_unitservers/omap3530/c6accel_omap3530.x64P $(EXEC_DIR)
  139. @install -m 777 beagle/apps/opencv/linux/remote_ti_platforms_$(PLATFORM_SHORT)_opencv.x$(APP_EXT) $(EXEC_DIR)
  140. @install -d $(EXEC_DIR)/lib
  141. @install -m 777 beagle/library/opencv/lib/* $(EXEC_DIR)/lib
  142. @install -d $(EXEC_DIR)/test_Data
  143. @install -m 777 beagle/apps/opencv/test_data/* $(EXEC_DIR)
  144. @chmod -x $(EXEC_DIR)/*.x64P
  145. @echo done
  146. @echo
  147.  
  148. clean_app:
  149. make -C beagle/apps/opencv APP_NAME=opencv -f $(PACKAGE_DIR)/Makefile.app TARGET=linux/remote_ti_platforms_$(PLATFORM_SHORT) clean
  150.  
  151. clean_c6accel:
  152. make -C $(C6ACCEL_PATH) clean
  153.  
  154. clean_lib:
  155. rm -rf beagle/library/opencv/*.ov5T
  156. rm -rf beagle/library/opencv/lib/*
  157. rm -rf beagle/apps/opencv/lib/*
  158.  
  159. clean: clean_c6accel clean_app clean_lib
  160.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement