Android.mk 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. LOCAL_PATH := $(call my-dir)
  2. include $(CLEAR_VARS)
  3. LOCAL_MODULE := libtess
  4. # tesseract (minus executable)
  5. BLACKLIST_SRC_FILES := \
  6. %api/tesseractmain.cpp \
  7. %ccstruct/imagedata.cpp \
  8. %viewer/svpaint.cpp
  9. TESSERACT_SRC_FILES := \
  10. $(wildcard $(TESSERACT_PATH)/api/*.cpp) \
  11. $(wildcard $(TESSERACT_PATH)/ccmain/*.cpp) \
  12. $(wildcard $(TESSERACT_PATH)/ccstruct/*.cpp) \
  13. $(wildcard $(TESSERACT_PATH)/ccutil/*.cpp) \
  14. $(wildcard $(TESSERACT_PATH)/classify/*.cpp) \
  15. $(wildcard $(TESSERACT_PATH)/cube/*.cpp) \
  16. $(wildcard $(TESSERACT_PATH)/cutil/*.cpp) \
  17. $(wildcard $(TESSERACT_PATH)/dict/*.cpp) \
  18. $(wildcard $(TESSERACT_PATH)/opencl/*.cpp) \
  19. $(wildcard $(TESSERACT_PATH)/neural_networks/runtime/*.cpp) \
  20. $(wildcard $(TESSERACT_PATH)/textord/*.cpp) \
  21. $(wildcard $(TESSERACT_PATH)/viewer/*.cpp) \
  22. $(wildcard $(TESSERACT_PATH)/wordrec/*.cpp)
  23. LOCAL_SRC_FILES := \
  24. $(filter-out $(BLACKLIST_SRC_FILES),$(subst $(LOCAL_PATH)/,,$(TESSERACT_SRC_FILES)))
  25. LOCAL_C_INCLUDES := \
  26. $(TESSERACT_PATH)/api \
  27. $(TESSERACT_PATH)/ccmain \
  28. $(TESSERACT_PATH)/ccstruct \
  29. $(TESSERACT_PATH)/ccutil \
  30. $(TESSERACT_PATH)/classify \
  31. $(TESSERACT_PATH)/cube \
  32. $(TESSERACT_PATH)/cutil \
  33. $(TESSERACT_PATH)/dict \
  34. $(TESSERACT_PATH)/opencl \
  35. $(TESSERACT_PATH)/neural_networks/runtime \
  36. $(TESSERACT_PATH)/textord \
  37. $(TESSERACT_PATH)/viewer \
  38. $(TESSERACT_PATH)/wordrec \
  39. $(LEPTONICA_PATH)/src
  40. LOCAL_CFLAGS := \
  41. -DGRAPHICS_DISABLED \
  42. --std=c++11 \
  43. -DUSE_STD_NAMESPACE \
  44. -D'VERSION="Android"' \
  45. -include ctype.h \
  46. -include unistd.h \
  47. -fpermissive \
  48. -Wno-deprecated \
  49. -Wno-shift-negative-value \
  50. -D_GLIBCXX_PERMIT_BACKWARD_HASH # fix for android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/include/ext/hash_map:61:30: fatal error: backward_warning.h: No such file or directory
  51. # jni
  52. LOCAL_SRC_FILES += \
  53. pageiterator.cpp \
  54. resultiterator.cpp \
  55. tessbaseapi.cpp
  56. LOCAL_C_INCLUDES += \
  57. $(LOCAL_PATH)
  58. LOCAL_LDLIBS += \
  59. -latomic \
  60. -ljnigraphics \
  61. -llog
  62. # common
  63. LOCAL_PRELINK_MODULE := false
  64. LOCAL_SHARED_LIBRARIES := liblept
  65. LOCAL_DISABLE_FORMAT_STRING_CHECKS := true
  66. include $(BUILD_SHARED_LIBRARY)