Makefile_armv7 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ARM_ABI = arm7
  2. export ARM_ABI
  3. include ../Makefile.def
  4. LITE_ROOT=../../../
  5. THIRD_PARTY_DIR=${LITE_ROOT}/third_party
  6. OPENCV_VERSION=opencv4.1.0
  7. OPENCV_LIBS = ${THIRD_PARTY_DIR}/${OPENCV_VERSION}/armeabi-v7a/libs/libopencv_imgcodecs.a \
  8. ${THIRD_PARTY_DIR}/${OPENCV_VERSION}/armeabi-v7a/libs/libopencv_imgproc.a \
  9. ${THIRD_PARTY_DIR}/${OPENCV_VERSION}/armeabi-v7a/libs/libopencv_core.a \
  10. ${THIRD_PARTY_DIR}/${OPENCV_VERSION}/armeabi-v7a/3rdparty/libs/libtegra_hal.a \
  11. ${THIRD_PARTY_DIR}/${OPENCV_VERSION}/armeabi-v7a/3rdparty/libs/liblibjpeg-turbo.a \
  12. ${THIRD_PARTY_DIR}/${OPENCV_VERSION}/armeabi-v7a/3rdparty/libs/liblibwebp.a \
  13. ${THIRD_PARTY_DIR}/${OPENCV_VERSION}/armeabi-v7a/3rdparty/libs/liblibpng.a \
  14. ${THIRD_PARTY_DIR}/${OPENCV_VERSION}/armeabi-v7a/3rdparty/libs/liblibjasper.a \
  15. ${THIRD_PARTY_DIR}/${OPENCV_VERSION}/armeabi-v7a/3rdparty/libs/liblibtiff.a \
  16. ${THIRD_PARTY_DIR}/${OPENCV_VERSION}/armeabi-v7a/3rdparty/libs/libIlmImf.a \
  17. ${THIRD_PARTY_DIR}/${OPENCV_VERSION}/armeabi-v7a/3rdparty/libs/libtbb.a \
  18. ${THIRD_PARTY_DIR}/${OPENCV_VERSION}/armeabi-v7a/3rdparty/libs/libcpufeatures.a
  19. OPENCV_INCLUDE = -I../../../third_party/${OPENCV_VERSION}/armeabi-v7a/include
  20. CXX_INCLUDES = $(INCLUDES) ${OPENCV_INCLUDE} -I$(LITE_ROOT)/cxx/include
  21. CXX_LIBS = ${OPENCV_LIBS} -L$(LITE_ROOT)/cxx/lib/ -lpaddle_light_api_shared $(SYSTEM_LIBS)
  22. ###############################################################
  23. # How to use one of static libaray: #
  24. # `libpaddle_api_full_bundled.a` #
  25. # `libpaddle_api_light_bundled.a` #
  26. ###############################################################
  27. # Note: default use lite's shared library. #
  28. ###############################################################
  29. # 1. Comment above line using `libpaddle_light_api_shared.so`
  30. # 2. Undo comment below line using `libpaddle_api_light_bundled.a`
  31. #CXX_LIBS = $(LITE_ROOT)/cxx/lib/libpaddle_api_light_bundled.a $(SYSTEM_LIBS)
  32. detect_system: fetch_opencv detect_system.o
  33. $(CC) $(SYSROOT_LINK) $(CXXFLAGS_LINK) detect_system.o -o detect_system $(CXX_LIBS) $(LDFLAGS)
  34. detect_system.o: run_detection.cc
  35. $(CC) $(SYSROOT_COMPLILE) $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o detect_system.o -c run_detection.cc
  36. fetch_opencv:
  37. @ test -d ${THIRD_PARTY_DIR} || mkdir ${THIRD_PARTY_DIR}
  38. @ test -e ${THIRD_PARTY_DIR}/${OPENCV_VERSION}.tar.gz || \
  39. (echo "fetch opencv libs" && \
  40. wget -P ${THIRD_PARTY_DIR} https://paddle-inference-dist.bj.bcebos.com/${OPENCV_VERSION}.tar.gz)
  41. @ test -d ${THIRD_PARTY_DIR}/${OPENCV_VERSION} || \
  42. tar -zxvf ${THIRD_PARTY_DIR}/${OPENCV_VERSION}.tar.gz -C ${THIRD_PARTY_DIR}
  43. .PHONY: clean
  44. clean:
  45. rm -f detect_system.o
  46. rm -f detect_system