Makefile.am 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764
  1. ## run autogen.sh to create Makefile.in from this file
  2. ACLOCAL_AMFLAGS = -I m4
  3. if ENABLE_TRAINING
  4. TRAINING_SUBDIR = src/training
  5. training: all
  6. @$(MAKE) -C src/training
  7. training-install: training
  8. @$(MAKE) -C src/training install
  9. training-uninstall:
  10. @$(MAKE) -C src/training uninstall
  11. clean-local:
  12. @$(MAKE) -C src/training clean
  13. # Some unit tests use code from training.
  14. check: training
  15. else
  16. training:
  17. @echo "Need to reconfigure project, so there are no errors"
  18. endif
  19. .PHONY: doc install-langs ScrollView.jar install-jars training
  20. SUBDIRS = . tessdata doc unittest
  21. EXTRA_DIST = README.md LICENSE
  22. EXTRA_DIST += aclocal.m4 config configure.ac autogen.sh
  23. EXTRA_DIST += tesseract.pc.in $(TRAINING_SUBDIR) java doc
  24. EXTRA_DIST += CMakeLists.txt tesseract.pc.cmake cmake VERSION src/vs2010
  25. DIST_SUBDIRS = $(SUBDIRS) $(TRAINING_SUBDIR)
  26. uninstall-hook:
  27. rm -rf $(DESTDIR)$(pkgincludedir)
  28. dist-hook:
  29. # Need to remove .svn directories from directories
  30. # added using EXTRA_DIST. $(distdir)/tessdata would in
  31. # theory suffice.
  32. rm -rf `find $(distdir) -name .deps -type d`
  33. -rm -f $(distdir)/*/Makefile $(distdir)/*/*/Makefile
  34. rm -f `find $(distdir) -name '*~'`
  35. rm -rf $(find $(distdir)/src/training -executable -type f)
  36. rm -rf $(distdir)/doc/html/* $(distdir)/doc/*.log
  37. ScrollView.jar:
  38. @cd "$(top_builddir)/java" && $(MAKE) $@
  39. install-jars:
  40. @cd "$(top_builddir)/java" && $(MAKE) $@
  41. doc:
  42. -srcdir="$(top_srcdir)" builddir="$(top_builddir)" \
  43. version="@PACKAGE_VERSION@" name="@PACKAGE_NAME@" \
  44. doxygen $(top_srcdir)/doc/Doxyfile
  45. doc-pack: doc
  46. -chmod a+r $(top_builddir)/doc/html/*
  47. @tar --create --directory=$(top_builddir)/doc/html --verbose --file=- . | gzip -c -9 > $(top_builddir)/@PACKAGE_NAME@-@PACKAGE_VERSION@-doc-html.tar.gz;
  48. doc-clean:
  49. rm -rf $(top_builddir)/doc/html/*
  50. pkgconfigdir = $(libdir)/pkgconfig
  51. pkgconfig_DATA = tesseract.pc
  52. pkginclude_HEADERS = $(top_builddir)/include/tesseract/version.h
  53. pkginclude_HEADERS += include/tesseract/apitypes.h
  54. pkginclude_HEADERS += include/tesseract/baseapi.h
  55. pkginclude_HEADERS += include/tesseract/capi.h
  56. pkginclude_HEADERS += include/tesseract/genericvector.h
  57. pkginclude_HEADERS += include/tesseract/helpers.h
  58. pkginclude_HEADERS += include/tesseract/ltrresultiterator.h
  59. pkginclude_HEADERS += include/tesseract/ocrclass.h
  60. pkginclude_HEADERS += include/tesseract/osdetect.h
  61. pkginclude_HEADERS += include/tesseract/pageiterator.h
  62. pkginclude_HEADERS += include/tesseract/platform.h
  63. pkginclude_HEADERS += include/tesseract/publictypes.h
  64. pkginclude_HEADERS += include/tesseract/renderer.h
  65. pkginclude_HEADERS += include/tesseract/resultiterator.h
  66. pkginclude_HEADERS += include/tesseract/serialis.h
  67. pkginclude_HEADERS += include/tesseract/strngs.h
  68. pkginclude_HEADERS += include/tesseract/thresholder.h
  69. pkginclude_HEADERS += include/tesseract/unichar.h
  70. # Rules for all subdirectories.
  71. noinst_HEADERS =
  72. noinst_LTLIBRARIES =
  73. AM_CPPFLAGS += -I$(top_srcdir)/include
  74. AM_CPPFLAGS += -I$(top_builddir)/include
  75. if VISIBILITY
  76. AM_CPPFLAGS += -DTESS_EXPORTS
  77. AM_CPPFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
  78. endif
  79. AM_CPPFLAGS += $(OPENCL_CPPFLAGS)
  80. AM_CXXFLAGS = $(OPENMP_CXXFLAGS)
  81. # Rules for src/api.
  82. libtesseract_la_CPPFLAGS = $(AM_CPPFLAGS)
  83. libtesseract_la_CPPFLAGS += -I$(top_srcdir)/src/arch
  84. libtesseract_la_CPPFLAGS += -I$(top_srcdir)/src/ccmain
  85. libtesseract_la_CPPFLAGS += -I$(top_srcdir)/src/ccstruct
  86. libtesseract_la_CPPFLAGS += -I$(top_srcdir)/src/ccutil
  87. libtesseract_la_CPPFLAGS += -I$(top_srcdir)/src/classify
  88. libtesseract_la_CPPFLAGS += -I$(top_srcdir)/src/cutil
  89. libtesseract_la_CPPFLAGS += -I$(top_srcdir)/src/dict
  90. libtesseract_la_CPPFLAGS += -I$(top_srcdir)/src/lstm
  91. libtesseract_la_CPPFLAGS += -I$(top_srcdir)/src/opencl
  92. libtesseract_la_CPPFLAGS += -I$(top_srcdir)/src/textord
  93. libtesseract_la_CPPFLAGS += -I$(top_srcdir)/src/training
  94. libtesseract_la_CPPFLAGS += -I$(top_srcdir)/src/viewer
  95. libtesseract_la_CPPFLAGS += -I$(top_srcdir)/src/wordrec
  96. libtesseract_la_CPPFLAGS += $(libcurl_CFLAGS)
  97. lib_LTLIBRARIES = libtesseract.la
  98. libtesseract_la_LDFLAGS = $(LEPTONICA_LIBS) $(OPENCL_LDFLAGS)
  99. libtesseract_la_LDFLAGS += $(libarchive_LIBS)
  100. libtesseract_la_LDFLAGS += $(libcurl_LIBS)
  101. libtesseract_la_LDFLAGS += $(TENSORFLOW_LIBS)
  102. if T_WIN
  103. libtesseract_la_LDFLAGS += -no-undefined -Wl,--as-needed -lws2_32
  104. else
  105. libtesseract_la_LDFLAGS += $(NOUNDEFINED)
  106. endif
  107. libtesseract_la_LDFLAGS += -version-info $(GENERIC_LIBRARY_VERSION)
  108. libtesseract_la_SOURCES = src/api/baseapi.cpp
  109. libtesseract_la_SOURCES += src/api/altorenderer.cpp
  110. libtesseract_la_SOURCES += src/api/capi.cpp
  111. libtesseract_la_SOURCES += src/api/hocrrenderer.cpp
  112. libtesseract_la_SOURCES += src/api/lstmboxrenderer.cpp
  113. libtesseract_la_SOURCES += src/api/pdfrenderer.cpp
  114. libtesseract_la_SOURCES += src/api/renderer.cpp
  115. libtesseract_la_SOURCES += src/api/wordstrboxrenderer.cpp
  116. libtesseract_la_LIBADD = libtesseract_ccutil.la
  117. libtesseract_la_LIBADD += libtesseract_lstm.la
  118. libtesseract_la_LIBADD += libtesseract_native.la
  119. libtesseract_la_LIBADD += libtesseract_opencl.la
  120. # Rules for src/arch.
  121. noinst_HEADERS += src/arch/dotproduct.h
  122. noinst_HEADERS += src/arch/intsimdmatrix.h
  123. noinst_HEADERS += src/arch/simddetect.h
  124. noinst_LTLIBRARIES += libtesseract_native.la
  125. libtesseract_native_la_CXXFLAGS = -O3 -ffast-math
  126. if MARCH_NATIVE_OPT
  127. libtesseract_native_la_CXXFLAGS += -march=native -mtune=native
  128. endif
  129. libtesseract_native_la_SOURCES = src/arch/dotproduct.cpp
  130. if HAVE_AVX
  131. libtesseract_avx_la_CXXFLAGS = -mavx
  132. libtesseract_avx_la_SOURCES = src/arch/dotproductavx.cpp
  133. libtesseract_la_LIBADD += libtesseract_avx.la
  134. noinst_LTLIBRARIES += libtesseract_avx.la
  135. endif
  136. if HAVE_AVX2
  137. libtesseract_avx2_la_CXXFLAGS = -mavx2
  138. libtesseract_avx2_la_SOURCES = src/arch/intsimdmatrixavx2.cpp
  139. libtesseract_la_LIBADD += libtesseract_avx2.la
  140. noinst_LTLIBRARIES += libtesseract_avx2.la
  141. endif
  142. if HAVE_FMA
  143. libtesseract_fma_la_CXXFLAGS = -mfma
  144. libtesseract_fma_la_SOURCES = src/arch/dotproductfma.cpp
  145. libtesseract_la_LIBADD += libtesseract_fma.la
  146. noinst_LTLIBRARIES += libtesseract_fma.la
  147. endif
  148. if HAVE_SSE4_1
  149. libtesseract_sse_la_CXXFLAGS = -msse4.1
  150. libtesseract_sse_la_SOURCES = src/arch/dotproductsse.cpp src/arch/intsimdmatrixsse.cpp
  151. libtesseract_la_LIBADD += libtesseract_sse.la
  152. noinst_LTLIBRARIES += libtesseract_sse.la
  153. endif
  154. libtesseract_la_SOURCES += src/arch/intsimdmatrix.cpp
  155. libtesseract_la_SOURCES += src/arch/simddetect.cpp
  156. # Rules for src/ccmain.
  157. noinst_HEADERS += src/ccmain/control.h
  158. noinst_HEADERS += src/ccmain/equationdetect.h
  159. noinst_HEADERS += src/ccmain/mutableiterator.h
  160. noinst_HEADERS += src/ccmain/output.h
  161. noinst_HEADERS += src/ccmain/paragraphs.h
  162. noinst_HEADERS += src/ccmain/paragraphs_internal.h
  163. noinst_HEADERS += src/ccmain/paramsd.h
  164. noinst_HEADERS += src/ccmain/pgedit.h
  165. noinst_HEADERS += src/ccmain/tesseractclass.h
  166. noinst_HEADERS += src/ccmain/tessvars.h
  167. noinst_HEADERS += src/ccmain/werdit.h
  168. if !DISABLED_LEGACY_ENGINE
  169. noinst_HEADERS += src/ccmain/docqual.h
  170. noinst_HEADERS += src/ccmain/fixspace.h
  171. noinst_HEADERS += src/ccmain/reject.h
  172. endif
  173. libtesseract_la_SOURCES += src/ccmain/applybox.cpp
  174. libtesseract_la_SOURCES += src/ccmain/control.cpp
  175. libtesseract_la_SOURCES += src/ccmain/linerec.cpp
  176. libtesseract_la_SOURCES += src/ccmain/ltrresultiterator.cpp
  177. libtesseract_la_SOURCES += src/ccmain/mutableiterator.cpp
  178. libtesseract_la_SOURCES += src/ccmain/output.cpp
  179. libtesseract_la_SOURCES += src/ccmain/pageiterator.cpp
  180. libtesseract_la_SOURCES += src/ccmain/pagesegmain.cpp
  181. libtesseract_la_SOURCES += src/ccmain/pagewalk.cpp
  182. libtesseract_la_SOURCES += src/ccmain/paragraphs.cpp
  183. libtesseract_la_SOURCES += src/ccmain/paramsd.cpp
  184. libtesseract_la_SOURCES += src/ccmain/pgedit.cpp
  185. libtesseract_la_SOURCES += src/ccmain/reject.cpp
  186. libtesseract_la_SOURCES += src/ccmain/resultiterator.cpp
  187. libtesseract_la_SOURCES += src/ccmain/tessedit.cpp
  188. libtesseract_la_SOURCES += src/ccmain/tesseractclass.cpp
  189. libtesseract_la_SOURCES += src/ccmain/tessvars.cpp
  190. libtesseract_la_SOURCES += src/ccmain/thresholder.cpp
  191. libtesseract_la_SOURCES += src/ccmain/werdit.cpp
  192. if !DISABLED_LEGACY_ENGINE
  193. libtesseract_la_SOURCES += src/ccmain/adaptions.cpp
  194. libtesseract_la_SOURCES += src/ccmain/docqual.cpp
  195. libtesseract_la_SOURCES += src/ccmain/equationdetect.cpp
  196. libtesseract_la_SOURCES += src/ccmain/fixspace.cpp
  197. libtesseract_la_SOURCES += src/ccmain/fixxht.cpp
  198. libtesseract_la_SOURCES += src/ccmain/osdetect.cpp
  199. libtesseract_la_SOURCES += src/ccmain/par_control.cpp
  200. libtesseract_la_SOURCES += src/ccmain/recogtraining.cpp
  201. libtesseract_la_SOURCES += src/ccmain/superscript.cpp
  202. libtesseract_la_SOURCES += src/ccmain/tessbox.cpp
  203. libtesseract_la_SOURCES += src/ccmain/tfacepp.cpp
  204. endif
  205. # Rules for src/ccstruct.
  206. noinst_HEADERS += src/ccstruct/blamer.h
  207. noinst_HEADERS += src/ccstruct/blobbox.h
  208. noinst_HEADERS += src/ccstruct/blobs.h
  209. noinst_HEADERS += src/ccstruct/blread.h
  210. noinst_HEADERS += src/ccstruct/boxread.h
  211. noinst_HEADERS += src/ccstruct/boxword.h
  212. noinst_HEADERS += src/ccstruct/ccstruct.h
  213. noinst_HEADERS += src/ccstruct/coutln.h
  214. noinst_HEADERS += src/ccstruct/crakedge.h
  215. noinst_HEADERS += src/ccstruct/debugpixa.h
  216. noinst_HEADERS += src/ccstruct/detlinefit.h
  217. noinst_HEADERS += src/ccstruct/dppoint.h
  218. noinst_HEADERS += src/ccstruct/imagedata.h
  219. noinst_HEADERS += src/ccstruct/linlsq.h
  220. noinst_HEADERS += src/ccstruct/matrix.h
  221. noinst_HEADERS += src/ccstruct/mod128.h
  222. noinst_HEADERS += src/ccstruct/normalis.h
  223. noinst_HEADERS += src/ccstruct/ocrblock.h
  224. noinst_HEADERS += src/ccstruct/ocrpara.h
  225. noinst_HEADERS += src/ccstruct/ocrrow.h
  226. noinst_HEADERS += src/ccstruct/otsuthr.h
  227. noinst_HEADERS += src/ccstruct/pageres.h
  228. noinst_HEADERS += src/ccstruct/pdblock.h
  229. noinst_HEADERS += src/ccstruct/points.h
  230. noinst_HEADERS += src/ccstruct/polyaprx.h
  231. noinst_HEADERS += src/ccstruct/polyblk.h
  232. noinst_HEADERS += src/ccstruct/quadlsq.h
  233. noinst_HEADERS += src/ccstruct/quadratc.h
  234. noinst_HEADERS += src/ccstruct/quspline.h
  235. noinst_HEADERS += src/ccstruct/ratngs.h
  236. noinst_HEADERS += src/ccstruct/rect.h
  237. noinst_HEADERS += src/ccstruct/rejctmap.h
  238. noinst_HEADERS += src/ccstruct/seam.h
  239. noinst_HEADERS += src/ccstruct/split.h
  240. noinst_HEADERS += src/ccstruct/statistc.h
  241. noinst_HEADERS += src/ccstruct/stepblob.h
  242. noinst_HEADERS += src/ccstruct/werd.h
  243. if !DISABLED_LEGACY_ENGINE
  244. noinst_HEADERS += src/ccstruct/fontinfo.h
  245. noinst_HEADERS += src/ccstruct/params_training_featdef.h
  246. endif
  247. libtesseract_la_SOURCES += src/ccstruct/blamer.cpp
  248. libtesseract_la_SOURCES += src/ccstruct/blobbox.cpp
  249. libtesseract_la_SOURCES += src/ccstruct/blobs.cpp
  250. libtesseract_la_SOURCES += src/ccstruct/blread.cpp
  251. libtesseract_la_SOURCES += src/ccstruct/boxread.cpp
  252. libtesseract_la_SOURCES += src/ccstruct/boxword.cpp
  253. libtesseract_la_SOURCES += src/ccstruct/ccstruct.cpp
  254. libtesseract_la_SOURCES += src/ccstruct/coutln.cpp
  255. libtesseract_la_SOURCES += src/ccstruct/detlinefit.cpp
  256. libtesseract_la_SOURCES += src/ccstruct/dppoint.cpp
  257. libtesseract_la_SOURCES += src/ccstruct/imagedata.cpp
  258. libtesseract_la_SOURCES += src/ccstruct/linlsq.cpp
  259. libtesseract_la_SOURCES += src/ccstruct/matrix.cpp
  260. libtesseract_la_SOURCES += src/ccstruct/mod128.cpp
  261. libtesseract_la_SOURCES += src/ccstruct/normalis.cpp
  262. libtesseract_la_SOURCES += src/ccstruct/ocrblock.cpp
  263. libtesseract_la_SOURCES += src/ccstruct/ocrpara.cpp
  264. libtesseract_la_SOURCES += src/ccstruct/ocrrow.cpp
  265. libtesseract_la_SOURCES += src/ccstruct/otsuthr.cpp
  266. libtesseract_la_SOURCES += src/ccstruct/pageres.cpp
  267. libtesseract_la_SOURCES += src/ccstruct/pdblock.cpp
  268. libtesseract_la_SOURCES += src/ccstruct/points.cpp
  269. libtesseract_la_SOURCES += src/ccstruct/polyaprx.cpp
  270. libtesseract_la_SOURCES += src/ccstruct/polyblk.cpp
  271. libtesseract_la_SOURCES += src/ccstruct/quadlsq.cpp
  272. libtesseract_la_SOURCES += src/ccstruct/quspline.cpp
  273. libtesseract_la_SOURCES += src/ccstruct/ratngs.cpp
  274. libtesseract_la_SOURCES += src/ccstruct/rect.cpp
  275. libtesseract_la_SOURCES += src/ccstruct/rejctmap.cpp
  276. libtesseract_la_SOURCES += src/ccstruct/seam.cpp
  277. libtesseract_la_SOURCES += src/ccstruct/split.cpp
  278. libtesseract_la_SOURCES += src/ccstruct/statistc.cpp
  279. libtesseract_la_SOURCES += src/ccstruct/stepblob.cpp
  280. libtesseract_la_SOURCES += src/ccstruct/werd.cpp
  281. if !DISABLED_LEGACY_ENGINE
  282. libtesseract_la_SOURCES += src/ccstruct/fontinfo.cpp
  283. libtesseract_la_SOURCES += src/ccstruct/params_training_featdef.cpp
  284. endif
  285. # Rules for src/ccutil
  286. libtesseract_ccutil_la_CPPFLAGS = $(AM_CPPFLAGS)
  287. libtesseract_ccutil_la_CPPFLAGS += $(libarchive_CFLAGS)
  288. if !NO_TESSDATA_PREFIX
  289. libtesseract_ccutil_la_CPPFLAGS += -DTESSDATA_PREFIX=@datadir@
  290. endif
  291. noinst_HEADERS += src/ccutil/bits16.h
  292. noinst_HEADERS += src/ccutil/ccutil.h
  293. noinst_HEADERS += src/ccutil/clst.h
  294. noinst_HEADERS += src/ccutil/doubleptr.h
  295. noinst_HEADERS += src/ccutil/elst2.h
  296. noinst_HEADERS += src/ccutil/elst.h
  297. noinst_HEADERS += src/ccutil/errcode.h
  298. noinst_HEADERS += src/ccutil/fileerr.h
  299. noinst_HEADERS += src/ccutil/genericheap.h
  300. noinst_HEADERS += src/ccutil/globaloc.h
  301. noinst_HEADERS += src/ccutil/host.h
  302. noinst_HEADERS += src/ccutil/kdpair.h
  303. noinst_HEADERS += src/ccutil/lsterr.h
  304. noinst_HEADERS += src/ccutil/object_cache.h
  305. noinst_HEADERS += src/ccutil/params.h
  306. noinst_HEADERS += src/ccutil/qrsequence.h
  307. noinst_HEADERS += src/ccutil/sorthelper.h
  308. noinst_HEADERS += src/ccutil/scanutils.h
  309. noinst_HEADERS += src/ccutil/tessdatamanager.h
  310. noinst_HEADERS += src/ccutil/tprintf.h
  311. noinst_HEADERS += src/ccutil/unicharcompress.h
  312. noinst_HEADERS += src/ccutil/unicharmap.h
  313. noinst_HEADERS += src/ccutil/unicharset.h
  314. noinst_HEADERS += src/ccutil/unicity_table.h
  315. noinst_HEADERS += src/ccutil/unicodes.h
  316. if !DISABLED_LEGACY_ENGINE
  317. noinst_HEADERS += src/ccutil/ambigs.h
  318. noinst_HEADERS += src/ccutil/bitvector.h
  319. noinst_HEADERS += src/ccutil/indexmapbidi.h
  320. noinst_HEADERS += src/ccutil/universalambigs.h
  321. endif
  322. noinst_LTLIBRARIES += libtesseract_ccutil.la
  323. libtesseract_ccutil_la_SOURCES = src/ccutil/ccutil.cpp
  324. libtesseract_ccutil_la_SOURCES += src/ccutil/clst.cpp
  325. libtesseract_ccutil_la_SOURCES += src/ccutil/elst2.cpp
  326. libtesseract_ccutil_la_SOURCES += src/ccutil/elst.cpp
  327. libtesseract_ccutil_la_SOURCES += src/ccutil/errcode.cpp
  328. libtesseract_ccutil_la_SOURCES += src/ccutil/globaloc.cpp
  329. libtesseract_ccutil_la_SOURCES += src/ccutil/mainblk.cpp
  330. libtesseract_ccutil_la_SOURCES += src/ccutil/serialis.cpp
  331. libtesseract_ccutil_la_SOURCES += src/ccutil/strngs.cpp
  332. libtesseract_ccutil_la_SOURCES += src/ccutil/scanutils.cpp
  333. libtesseract_ccutil_la_SOURCES += src/ccutil/tessdatamanager.cpp
  334. libtesseract_ccutil_la_SOURCES += src/ccutil/tprintf.cpp
  335. libtesseract_ccutil_la_SOURCES += src/ccutil/unichar.cpp
  336. libtesseract_ccutil_la_SOURCES += src/ccutil/unicharcompress.cpp
  337. libtesseract_ccutil_la_SOURCES += src/ccutil/unicharmap.cpp
  338. libtesseract_ccutil_la_SOURCES += src/ccutil/unicharset.cpp
  339. libtesseract_ccutil_la_SOURCES += src/ccutil/unicodes.cpp
  340. libtesseract_ccutil_la_SOURCES += src/ccutil/params.cpp
  341. if !DISABLED_LEGACY_ENGINE
  342. libtesseract_ccutil_la_SOURCES += src/ccutil/ambigs.cpp
  343. libtesseract_ccutil_la_SOURCES += src/ccutil/bitvector.cpp
  344. libtesseract_ccutil_la_SOURCES += src/ccutil/indexmapbidi.cpp
  345. libtesseract_ccutil_la_SOURCES += src/ccutil/universalambigs.cpp
  346. endif
  347. # Rules for src/classify.
  348. noinst_HEADERS += src/classify/classify.h
  349. if !DISABLED_LEGACY_ENGINE
  350. noinst_HEADERS += src/classify/adaptive.h
  351. noinst_HEADERS += src/classify/blobclass.h
  352. noinst_HEADERS += src/classify/cluster.h
  353. noinst_HEADERS += src/classify/clusttool.h
  354. noinst_HEADERS += src/classify/featdefs.h
  355. noinst_HEADERS += src/classify/float2int.h
  356. noinst_HEADERS += src/classify/fpoint.h
  357. noinst_HEADERS += src/classify/intfeaturespace.h
  358. noinst_HEADERS += src/classify/intfx.h
  359. noinst_HEADERS += src/classify/intmatcher.h
  360. noinst_HEADERS += src/classify/intproto.h
  361. noinst_HEADERS += src/classify/kdtree.h
  362. noinst_HEADERS += src/classify/mf.h
  363. noinst_HEADERS += src/classify/mfdefs.h
  364. noinst_HEADERS += src/classify/mfoutline.h
  365. noinst_HEADERS += src/classify/mfx.h
  366. noinst_HEADERS += src/classify/normfeat.h
  367. noinst_HEADERS += src/classify/normmatch.h
  368. noinst_HEADERS += src/classify/ocrfeatures.h
  369. noinst_HEADERS += src/classify/outfeat.h
  370. noinst_HEADERS += src/classify/picofeat.h
  371. noinst_HEADERS += src/classify/protos.h
  372. noinst_HEADERS += src/classify/shapeclassifier.h
  373. noinst_HEADERS += src/classify/shapetable.h
  374. noinst_HEADERS += src/classify/tessclassifier.h
  375. noinst_HEADERS += src/classify/trainingsample.h
  376. endif
  377. libtesseract_la_SOURCES += src/classify/classify.cpp
  378. if !DISABLED_LEGACY_ENGINE
  379. libtesseract_la_SOURCES += src/classify/adaptive.cpp
  380. libtesseract_la_SOURCES += src/classify/adaptmatch.cpp
  381. libtesseract_la_SOURCES += src/classify/blobclass.cpp
  382. libtesseract_la_SOURCES += src/classify/cluster.cpp
  383. libtesseract_la_SOURCES += src/classify/clusttool.cpp
  384. libtesseract_la_SOURCES += src/classify/cutoffs.cpp
  385. libtesseract_la_SOURCES += src/classify/featdefs.cpp
  386. libtesseract_la_SOURCES += src/classify/float2int.cpp
  387. libtesseract_la_SOURCES += src/classify/fpoint.cpp
  388. libtesseract_la_SOURCES += src/classify/intfeaturespace.cpp
  389. libtesseract_la_SOURCES += src/classify/intfx.cpp
  390. libtesseract_la_SOURCES += src/classify/intmatcher.cpp
  391. libtesseract_la_SOURCES += src/classify/intproto.cpp
  392. libtesseract_la_SOURCES += src/classify/kdtree.cpp
  393. libtesseract_la_SOURCES += src/classify/mf.cpp
  394. libtesseract_la_SOURCES += src/classify/mfdefs.cpp
  395. libtesseract_la_SOURCES += src/classify/mfoutline.cpp
  396. libtesseract_la_SOURCES += src/classify/mfx.cpp
  397. libtesseract_la_SOURCES += src/classify/normfeat.cpp
  398. libtesseract_la_SOURCES += src/classify/normmatch.cpp
  399. libtesseract_la_SOURCES += src/classify/ocrfeatures.cpp
  400. libtesseract_la_SOURCES += src/classify/outfeat.cpp
  401. libtesseract_la_SOURCES += src/classify/picofeat.cpp
  402. libtesseract_la_SOURCES += src/classify/protos.cpp
  403. libtesseract_la_SOURCES += src/classify/shapeclassifier.cpp
  404. libtesseract_la_SOURCES += src/classify/shapetable.cpp
  405. libtesseract_la_SOURCES += src/classify/tessclassifier.cpp
  406. libtesseract_la_SOURCES += src/classify/trainingsample.cpp
  407. endif
  408. # Rules for src/cutil.
  409. noinst_HEADERS += src/cutil/callcpp.h
  410. if !DISABLED_LEGACY_ENGINE
  411. noinst_HEADERS += src/cutil/bitvec.h
  412. noinst_HEADERS += src/cutil/emalloc.h
  413. noinst_HEADERS += src/cutil/oldlist.h
  414. endif
  415. libtesseract_la_SOURCES += src/cutil/callcpp.cpp
  416. if !DISABLED_LEGACY_ENGINE
  417. libtesseract_la_SOURCES += src/cutil/emalloc.cpp
  418. libtesseract_la_SOURCES += src/cutil/oldlist.cpp
  419. endif
  420. # Rules for src/dict.
  421. noinst_HEADERS += src/dict/dawg.h
  422. noinst_HEADERS += src/dict/dawg_cache.h
  423. noinst_HEADERS += src/dict/dict.h
  424. noinst_HEADERS += src/dict/matchdefs.h
  425. noinst_HEADERS += src/dict/stopper.h
  426. noinst_HEADERS += src/dict/trie.h
  427. libtesseract_la_SOURCES += src/dict/context.cpp
  428. libtesseract_la_SOURCES += src/dict/dawg.cpp
  429. libtesseract_la_SOURCES += src/dict/dawg_cache.cpp
  430. libtesseract_la_SOURCES += src/dict/dict.cpp
  431. libtesseract_la_SOURCES += src/dict/permdawg.cpp
  432. libtesseract_la_SOURCES += src/dict/stopper.cpp
  433. libtesseract_la_SOURCES += src/dict/trie.cpp
  434. if !DISABLED_LEGACY_ENGINE
  435. libtesseract_la_SOURCES += src/dict/hyphen.cpp
  436. endif
  437. # Rules for src/lstm.
  438. libtesseract_lstm_la_CPPFLAGS = $(AM_CPPFLAGS)
  439. libtesseract_lstm_la_CPPFLAGS += -I$(top_srcdir)/src/arch
  440. libtesseract_lstm_la_CPPFLAGS += -I$(top_srcdir)/src/ccstruct
  441. libtesseract_lstm_la_CPPFLAGS += -I$(top_srcdir)/src/ccutil
  442. libtesseract_lstm_la_CPPFLAGS += -I$(top_srcdir)/src/classify
  443. libtesseract_lstm_la_CPPFLAGS += -I$(top_srcdir)/src/cutil
  444. libtesseract_lstm_la_CPPFLAGS += -I$(top_srcdir)/src/dict
  445. libtesseract_lstm_la_CPPFLAGS += -I$(top_srcdir)/src/lstm
  446. libtesseract_lstm_la_CPPFLAGS += -I$(top_srcdir)/src/viewer
  447. if TENSORFLOW
  448. libtesseract_lstm_la_CPPFLAGS += -DINCLUDE_TENSORFLOW
  449. libtesseract_lstm_la_CPPFLAGS += -I/usr/include/tensorflow
  450. endif
  451. if !NO_TESSDATA_PREFIX
  452. libtesseract_lstm_la_CPPFLAGS += -DTESSDATA_PREFIX=@datadir@
  453. endif
  454. noinst_HEADERS += src/lstm/convolve.h
  455. noinst_HEADERS += src/lstm/fullyconnected.h
  456. noinst_HEADERS += src/lstm/functions.h
  457. noinst_HEADERS += src/lstm/input.h
  458. noinst_HEADERS += src/lstm/lstm.h
  459. noinst_HEADERS += src/lstm/lstmrecognizer.h
  460. noinst_HEADERS += src/lstm/maxpool.h
  461. noinst_HEADERS += src/lstm/network.h
  462. noinst_HEADERS += src/lstm/networkio.h
  463. noinst_HEADERS += src/lstm/networkscratch.h
  464. noinst_HEADERS += src/lstm/parallel.h
  465. noinst_HEADERS += src/lstm/plumbing.h
  466. noinst_HEADERS += src/lstm/recodebeam.h
  467. noinst_HEADERS += src/lstm/reconfig.h
  468. noinst_HEADERS += src/lstm/reversed.h
  469. noinst_HEADERS += src/lstm/series.h
  470. noinst_HEADERS += src/lstm/static_shape.h
  471. noinst_HEADERS += src/lstm/stridemap.h
  472. noinst_HEADERS += src/lstm/tfnetwork.h
  473. noinst_HEADERS += src/lstm/weightmatrix.h
  474. noinst_LTLIBRARIES += libtesseract_lstm.la
  475. libtesseract_lstm_la_SOURCES = src/lstm/convolve.cpp
  476. libtesseract_lstm_la_SOURCES += src/lstm/fullyconnected.cpp
  477. libtesseract_lstm_la_SOURCES += src/lstm/functions.cpp
  478. libtesseract_lstm_la_SOURCES += src/lstm/input.cpp
  479. libtesseract_lstm_la_SOURCES += src/lstm/lstm.cpp
  480. libtesseract_lstm_la_SOURCES += src/lstm/lstmrecognizer.cpp
  481. libtesseract_lstm_la_SOURCES += src/lstm/maxpool.cpp
  482. libtesseract_lstm_la_SOURCES += src/lstm/network.cpp
  483. libtesseract_lstm_la_SOURCES += src/lstm/networkio.cpp
  484. libtesseract_lstm_la_SOURCES += src/lstm/parallel.cpp
  485. libtesseract_lstm_la_SOURCES += src/lstm/plumbing.cpp
  486. libtesseract_lstm_la_SOURCES += src/lstm/recodebeam.cpp
  487. libtesseract_lstm_la_SOURCES += src/lstm/reconfig.cpp
  488. libtesseract_lstm_la_SOURCES += src/lstm/reversed.cpp
  489. libtesseract_lstm_la_SOURCES += src/lstm/series.cpp
  490. libtesseract_lstm_la_SOURCES += src/lstm/stridemap.cpp
  491. libtesseract_lstm_la_SOURCES += src/lstm/tfnetwork.cpp
  492. libtesseract_lstm_la_SOURCES += src/lstm/weightmatrix.cpp
  493. if TENSORFLOW
  494. libtesseract_lstm_la_SOURCES += src/lstm/tfnetwork.pb.cc
  495. endif
  496. # Rules for src/opencl.
  497. libtesseract_opencl_la_CPPFLAGS = $(AM_CPPFLAGS)
  498. libtesseract_opencl_la_CPPFLAGS += $(OPENCL_CFLAGS)
  499. libtesseract_opencl_la_CPPFLAGS += -I$(top_srcdir)/src/ccutil
  500. libtesseract_opencl_la_CPPFLAGS += -I$(top_srcdir)/src/ccstruct
  501. libtesseract_opencl_la_CPPFLAGS += -I$(top_srcdir)/src/ccmain
  502. noinst_HEADERS += src/opencl/openclwrapper.h
  503. noinst_HEADERS += src/opencl/oclkernels.h
  504. noinst_LTLIBRARIES += libtesseract_opencl.la
  505. libtesseract_opencl_la_SOURCES = src/opencl/openclwrapper.cpp
  506. # Rules for src/textord.
  507. noinst_HEADERS += src/textord/alignedblob.h
  508. noinst_HEADERS += src/textord/baselinedetect.h
  509. noinst_HEADERS += src/textord/bbgrid.h
  510. noinst_HEADERS += src/textord/blkocc.h
  511. noinst_HEADERS += src/textord/blobgrid.h
  512. noinst_HEADERS += src/textord/ccnontextdetect.h
  513. noinst_HEADERS += src/textord/cjkpitch.h
  514. noinst_HEADERS += src/textord/colfind.h
  515. noinst_HEADERS += src/textord/colpartition.h
  516. noinst_HEADERS += src/textord/colpartitionset.h
  517. noinst_HEADERS += src/textord/colpartitiongrid.h
  518. noinst_HEADERS += src/textord/devanagari_processing.h
  519. noinst_HEADERS += src/textord/drawtord.h
  520. noinst_HEADERS += src/textord/edgblob.h
  521. noinst_HEADERS += src/textord/edgloop.h
  522. noinst_HEADERS += src/textord/fpchop.h
  523. noinst_HEADERS += src/textord/gap_map.h
  524. noinst_HEADERS += src/textord/imagefind.h
  525. noinst_HEADERS += src/textord/linefind.h
  526. noinst_HEADERS += src/textord/makerow.h
  527. noinst_HEADERS += src/textord/oldbasel.h
  528. noinst_HEADERS += src/textord/pithsync.h
  529. noinst_HEADERS += src/textord/pitsync1.h
  530. noinst_HEADERS += src/textord/scanedg.h
  531. noinst_HEADERS += src/textord/sortflts.h
  532. noinst_HEADERS += src/textord/strokewidth.h
  533. noinst_HEADERS += src/textord/tabfind.h
  534. noinst_HEADERS += src/textord/tablefind.h
  535. noinst_HEADERS += src/textord/tabvector.h
  536. noinst_HEADERS += src/textord/tablerecog.h
  537. noinst_HEADERS += src/textord/textlineprojection.h
  538. noinst_HEADERS += src/textord/textord.h
  539. noinst_HEADERS += src/textord/topitch.h
  540. noinst_HEADERS += src/textord/tordmain.h
  541. noinst_HEADERS += src/textord/tovars.h
  542. noinst_HEADERS += src/textord/underlin.h
  543. noinst_HEADERS += src/textord/wordseg.h
  544. noinst_HEADERS += src/textord/workingpartset.h
  545. if !DISABLED_LEGACY_ENGINE
  546. noinst_HEADERS += src/textord/equationdetectbase.h
  547. endif
  548. libtesseract_la_SOURCES += src/textord/alignedblob.cpp
  549. libtesseract_la_SOURCES += src/textord/baselinedetect.cpp
  550. libtesseract_la_SOURCES += src/textord/bbgrid.cpp
  551. libtesseract_la_SOURCES += src/textord/blkocc.cpp
  552. libtesseract_la_SOURCES += src/textord/blobgrid.cpp
  553. libtesseract_la_SOURCES += src/textord/ccnontextdetect.cpp
  554. libtesseract_la_SOURCES += src/textord/cjkpitch.cpp
  555. libtesseract_la_SOURCES += src/textord/colfind.cpp
  556. libtesseract_la_SOURCES += src/textord/colpartition.cpp
  557. libtesseract_la_SOURCES += src/textord/colpartitionset.cpp
  558. libtesseract_la_SOURCES += src/textord/colpartitiongrid.cpp
  559. libtesseract_la_SOURCES += src/textord/devanagari_processing.cpp
  560. libtesseract_la_SOURCES += src/textord/drawtord.cpp
  561. libtesseract_la_SOURCES += src/textord/edgblob.cpp
  562. libtesseract_la_SOURCES += src/textord/edgloop.cpp
  563. libtesseract_la_SOURCES += src/textord/fpchop.cpp
  564. libtesseract_la_SOURCES += src/textord/gap_map.cpp
  565. libtesseract_la_SOURCES += src/textord/imagefind.cpp
  566. libtesseract_la_SOURCES += src/textord/linefind.cpp
  567. libtesseract_la_SOURCES += src/textord/makerow.cpp
  568. libtesseract_la_SOURCES += src/textord/oldbasel.cpp
  569. libtesseract_la_SOURCES += src/textord/pithsync.cpp
  570. libtesseract_la_SOURCES += src/textord/pitsync1.cpp
  571. libtesseract_la_SOURCES += src/textord/scanedg.cpp
  572. libtesseract_la_SOURCES += src/textord/sortflts.cpp
  573. libtesseract_la_SOURCES += src/textord/strokewidth.cpp
  574. libtesseract_la_SOURCES += src/textord/tabfind.cpp
  575. libtesseract_la_SOURCES += src/textord/tablefind.cpp
  576. libtesseract_la_SOURCES += src/textord/tabvector.cpp
  577. libtesseract_la_SOURCES += src/textord/tablerecog.cpp
  578. libtesseract_la_SOURCES += src/textord/textlineprojection.cpp
  579. libtesseract_la_SOURCES += src/textord/textord.cpp
  580. libtesseract_la_SOURCES += src/textord/topitch.cpp
  581. libtesseract_la_SOURCES += src/textord/tordmain.cpp
  582. libtesseract_la_SOURCES += src/textord/tospace.cpp
  583. libtesseract_la_SOURCES += src/textord/tovars.cpp
  584. libtesseract_la_SOURCES += src/textord/underlin.cpp
  585. libtesseract_la_SOURCES += src/textord/wordseg.cpp
  586. libtesseract_la_SOURCES += src/textord/workingpartset.cpp
  587. if !DISABLED_LEGACY_ENGINE
  588. libtesseract_la_SOURCES += src/textord/equationdetectbase.cpp
  589. endif
  590. # Rules for src/viewer.
  591. noinst_HEADERS += src/viewer/scrollview.h
  592. noinst_HEADERS += src/viewer/svmnode.h
  593. noinst_HEADERS += src/viewer/svutil.h
  594. libtesseract_la_SOURCES += src/viewer/scrollview.cpp
  595. libtesseract_la_SOURCES += src/viewer/svmnode.cpp
  596. libtesseract_la_SOURCES += src/viewer/svutil.cpp
  597. # TODO: Add rule to generate svpaint from svpaint.cpp.
  598. # Rules for src/wordrec.
  599. noinst_HEADERS += src/wordrec/wordrec.h
  600. if !DISABLED_LEGACY_ENGINE
  601. noinst_HEADERS += src/wordrec/associate.h
  602. noinst_HEADERS += src/wordrec/chop.h
  603. noinst_HEADERS += src/wordrec/drawfx.h
  604. noinst_HEADERS += src/wordrec/findseam.h
  605. noinst_HEADERS += src/wordrec/language_model.h
  606. noinst_HEADERS += src/wordrec/lm_consistency.h
  607. noinst_HEADERS += src/wordrec/lm_pain_points.h
  608. noinst_HEADERS += src/wordrec/lm_state.h
  609. noinst_HEADERS += src/wordrec/measure.h
  610. noinst_HEADERS += src/wordrec/outlines.h
  611. noinst_HEADERS += src/wordrec/params_model.h
  612. noinst_HEADERS += src/wordrec/plotedges.h
  613. noinst_HEADERS += src/wordrec/render.h
  614. endif
  615. libtesseract_la_SOURCES += src/wordrec/tface.cpp
  616. libtesseract_la_SOURCES += src/wordrec/wordrec.cpp
  617. if !DISABLED_LEGACY_ENGINE
  618. libtesseract_la_SOURCES += src/wordrec/associate.cpp
  619. libtesseract_la_SOURCES += src/wordrec/chop.cpp
  620. libtesseract_la_SOURCES += src/wordrec/chopper.cpp
  621. libtesseract_la_SOURCES += src/wordrec/drawfx.cpp
  622. libtesseract_la_SOURCES += src/wordrec/findseam.cpp
  623. libtesseract_la_SOURCES += src/wordrec/gradechop.cpp
  624. libtesseract_la_SOURCES += src/wordrec/language_model.cpp
  625. libtesseract_la_SOURCES += src/wordrec/lm_consistency.cpp
  626. libtesseract_la_SOURCES += src/wordrec/lm_pain_points.cpp
  627. libtesseract_la_SOURCES += src/wordrec/lm_state.cpp
  628. libtesseract_la_SOURCES += src/wordrec/outlines.cpp
  629. libtesseract_la_SOURCES += src/wordrec/params_model.cpp
  630. libtesseract_la_SOURCES += src/wordrec/pieces.cpp
  631. libtesseract_la_SOURCES += src/wordrec/plotedges.cpp
  632. libtesseract_la_SOURCES += src/wordrec/render.cpp
  633. libtesseract_la_SOURCES += src/wordrec/segsearch.cpp
  634. libtesseract_la_SOURCES += src/wordrec/wordclass.cpp
  635. endif
  636. # Rules for tesseract executable.
  637. bin_PROGRAMS = tesseract
  638. tesseract_SOURCES = src/api/tesseractmain.cpp
  639. tesseract_CPPFLAGS =
  640. tesseract_CPPFLAGS += -I$(top_srcdir)/src/arch
  641. tesseract_CPPFLAGS += -I$(top_srcdir)/src/ccstruct
  642. tesseract_CPPFLAGS += -I$(top_srcdir)/src/ccutil
  643. tesseract_CPPFLAGS += -I$(top_srcdir)/src/dict
  644. tesseract_CPPFLAGS += -I$(top_srcdir)/src/viewer
  645. tesseract_CPPFLAGS += $(AM_CPPFLAGS)
  646. if VISIBILITY
  647. tesseract_CPPFLAGS += -DTESS_IMPORTS
  648. endif
  649. tesseract_LDFLAGS = $(OPENCL_LDFLAGS)
  650. tesseract_LDFLAGS += $(OPENMP_CXXFLAGS)
  651. tesseract_LDADD = libtesseract.la
  652. tesseract_LDADD += $(LEPTONICA_LIBS)
  653. tesseract_LDADD += $(TENSORFLOW_LIBS)
  654. tesseract_LDADD += $(libarchive_LIBS)
  655. tesseract_LDADD += $(libcurl_LIBS)
  656. if T_WIN
  657. tesseract_LDADD += -ltiff
  658. tesseract_LDADD += -lws2_32
  659. endif
  660. if ADD_RT
  661. tesseract_LDADD += -lrt
  662. endif
  663. # fuzzer-api is used for fuzzing tests.
  664. # They are run by OSS-Fuzz https://oss-fuzz.com/, but can also be run locally.
  665. # Note: -fsanitize=fuzzer currently requires the clang++ compiler.
  666. # LIB_FUZZING_ENGINE can be overridden by the caller.
  667. # This is used by OSS-Fuzz.
  668. LIB_FUZZING_ENGINE ?= -fsanitize=fuzzer
  669. fuzzer-api: all
  670. fuzzer-api: $(top_srcdir)/unittest/fuzzers/fuzzer-api.cpp
  671. $(CXX) $(CXXFLAGS) -g $(LIB_FUZZING_ENGINE) \
  672. -I $(top_srcdir)/include \
  673. -I $(builddir)/include \
  674. -I $(top_srcdir)/src/ccmain \
  675. -I $(top_srcdir)/src/ccstruct \
  676. -I $(top_srcdir)/src/ccutil \
  677. $< \
  678. $(builddir)/.libs/libtesseract.a \
  679. $(LEPTONICA_LIBS) \
  680. $(TENSORFLOW_LIBS) \
  681. $(libarchive_LIBS) \
  682. $(libcurl_LIBS) \
  683. -o $@
Tip!

Press p or to see the previous file or, n or to see the next file