Makefile.am 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. # Provide the full test output for failed tests when using the parallel
  2. # test suite (which is enabled by default with automake 1.13+).
  3. export VERBOSE = yes
  4. AUTOMAKE_OPTIONS = subdir-objects
  5. ACLOCAL_AMFLAGS = -I m4
  6. lib_LTLIBRARIES = libopus.la
  7. DIST_SUBDIRS = doc
  8. AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/celt -I$(top_srcdir)/silk \
  9. -I$(top_srcdir)/silk/float -I$(top_srcdir)/silk/fixed $(NE10_CFLAGS)
  10. include celt_sources.mk
  11. include silk_sources.mk
  12. include opus_sources.mk
  13. if FIXED_POINT
  14. SILK_SOURCES += $(SILK_SOURCES_FIXED)
  15. if HAVE_SSE4_1
  16. SILK_SOURCES += $(SILK_SOURCES_SSE4_1) $(SILK_SOURCES_FIXED_SSE4_1)
  17. endif
  18. if HAVE_ARM_NEON_INTR
  19. SILK_SOURCES += $(SILK_SOURCES_FIXED_ARM_NEON_INTR)
  20. endif
  21. else
  22. SILK_SOURCES += $(SILK_SOURCES_FLOAT)
  23. if HAVE_SSE4_1
  24. SILK_SOURCES += $(SILK_SOURCES_SSE4_1)
  25. endif
  26. endif
  27. if DISABLE_FLOAT_API
  28. else
  29. OPUS_SOURCES += $(OPUS_SOURCES_FLOAT)
  30. endif
  31. if HAVE_SSE
  32. CELT_SOURCES += $(CELT_SOURCES_SSE)
  33. endif
  34. if HAVE_SSE2
  35. CELT_SOURCES += $(CELT_SOURCES_SSE2)
  36. endif
  37. if HAVE_SSE4_1
  38. CELT_SOURCES += $(CELT_SOURCES_SSE4_1)
  39. endif
  40. if CPU_ARM
  41. CELT_SOURCES += $(CELT_SOURCES_ARM)
  42. SILK_SOURCES += $(SILK_SOURCES_ARM)
  43. if HAVE_ARM_NEON_INTR
  44. CELT_SOURCES += $(CELT_SOURCES_ARM_NEON_INTR)
  45. SILK_SOURCES += $(SILK_SOURCES_ARM_NEON_INTR)
  46. endif
  47. if HAVE_ARM_NE10
  48. CELT_SOURCES += $(CELT_SOURCES_ARM_NE10)
  49. endif
  50. if OPUS_ARM_EXTERNAL_ASM
  51. noinst_LTLIBRARIES = libarmasm.la
  52. libarmasm_la_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S)
  53. BUILT_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
  54. $(CELT_AM_SOURCES_ARM_ASM:.s.in=.s) \
  55. $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
  56. endif
  57. endif
  58. CLEANFILES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
  59. $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
  60. include celt_headers.mk
  61. include silk_headers.mk
  62. include opus_headers.mk
  63. libopus_la_SOURCES = $(CELT_SOURCES) $(SILK_SOURCES) $(OPUS_SOURCES)
  64. libopus_la_LDFLAGS = -no-undefined -version-info @OPUS_LT_CURRENT@:@OPUS_LT_REVISION@:@OPUS_LT_AGE@
  65. libopus_la_LIBADD = $(NE10_LIBS) $(LIBM)
  66. if OPUS_ARM_EXTERNAL_ASM
  67. libopus_la_LIBADD += libarmasm.la
  68. endif
  69. pkginclude_HEADERS = include/opus.h include/opus_multistream.h include/opus_types.h include/opus_defines.h include/opus_projection.h
  70. noinst_HEADERS = $(OPUS_HEAD) $(SILK_HEAD) $(CELT_HEAD)
  71. if EXTRA_PROGRAMS
  72. noinst_PROGRAMS = celt/tests/test_unit_cwrs32 \
  73. celt/tests/test_unit_dft \
  74. celt/tests/test_unit_entropy \
  75. celt/tests/test_unit_laplace \
  76. celt/tests/test_unit_mathops \
  77. celt/tests/test_unit_mdct \
  78. celt/tests/test_unit_rotation \
  79. celt/tests/test_unit_types \
  80. opus_compare \
  81. opus_demo \
  82. repacketizer_demo \
  83. silk/tests/test_unit_LPC_inv_pred_gain \
  84. tests/test_opus_api \
  85. tests/test_opus_decode \
  86. tests/test_opus_encode \
  87. tests/test_opus_padding \
  88. tests/test_opus_projection
  89. TESTS = celt/tests/test_unit_cwrs32 \
  90. celt/tests/test_unit_dft \
  91. celt/tests/test_unit_entropy \
  92. celt/tests/test_unit_laplace \
  93. celt/tests/test_unit_mathops \
  94. celt/tests/test_unit_mdct \
  95. celt/tests/test_unit_rotation \
  96. celt/tests/test_unit_types \
  97. silk/tests/test_unit_LPC_inv_pred_gain \
  98. tests/test_opus_api \
  99. tests/test_opus_decode \
  100. tests/test_opus_encode \
  101. tests/test_opus_padding \
  102. tests/test_opus_projection
  103. opus_demo_SOURCES = src/opus_demo.c
  104. opus_demo_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
  105. repacketizer_demo_SOURCES = src/repacketizer_demo.c
  106. repacketizer_demo_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
  107. opus_compare_SOURCES = src/opus_compare.c
  108. opus_compare_LDADD = $(LIBM)
  109. tests_test_opus_api_SOURCES = tests/test_opus_api.c tests/test_opus_common.h
  110. tests_test_opus_api_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
  111. tests_test_opus_encode_SOURCES = tests/test_opus_encode.c tests/opus_encode_regressions.c tests/test_opus_common.h
  112. tests_test_opus_encode_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
  113. tests_test_opus_decode_SOURCES = tests/test_opus_decode.c tests/test_opus_common.h
  114. tests_test_opus_decode_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
  115. tests_test_opus_padding_SOURCES = tests/test_opus_padding.c tests/test_opus_common.h
  116. tests_test_opus_padding_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
  117. CELT_OBJ = $(CELT_SOURCES:.c=.lo)
  118. SILK_OBJ = $(SILK_SOURCES:.c=.lo)
  119. OPUS_OBJ = $(OPUS_SOURCES:.c=.lo)
  120. tests_test_opus_projection_SOURCES = tests/test_opus_projection.c tests/test_opus_common.h
  121. tests_test_opus_projection_LDADD = $(OPUS_OBJ) $(SILK_OBJ) $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
  122. if OPUS_ARM_EXTERNAL_ASM
  123. tests_test_opus_projection_LDADD += libarmasm.la
  124. endif
  125. silk_tests_test_unit_LPC_inv_pred_gain_SOURCES = silk/tests/test_unit_LPC_inv_pred_gain.c
  126. silk_tests_test_unit_LPC_inv_pred_gain_LDADD = $(SILK_OBJ) $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
  127. if OPUS_ARM_EXTERNAL_ASM
  128. silk_tests_test_unit_LPC_inv_pred_gain_LDADD += libarmasm.la
  129. endif
  130. celt_tests_test_unit_cwrs32_SOURCES = celt/tests/test_unit_cwrs32.c
  131. celt_tests_test_unit_cwrs32_LDADD = $(LIBM)
  132. celt_tests_test_unit_dft_SOURCES = celt/tests/test_unit_dft.c
  133. celt_tests_test_unit_dft_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
  134. if OPUS_ARM_EXTERNAL_ASM
  135. celt_tests_test_unit_dft_LDADD += libarmasm.la
  136. endif
  137. celt_tests_test_unit_entropy_SOURCES = celt/tests/test_unit_entropy.c
  138. celt_tests_test_unit_entropy_LDADD = $(LIBM)
  139. celt_tests_test_unit_laplace_SOURCES = celt/tests/test_unit_laplace.c
  140. celt_tests_test_unit_laplace_LDADD = $(LIBM)
  141. celt_tests_test_unit_mathops_SOURCES = celt/tests/test_unit_mathops.c
  142. celt_tests_test_unit_mathops_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
  143. if OPUS_ARM_EXTERNAL_ASM
  144. celt_tests_test_unit_mathops_LDADD += libarmasm.la
  145. endif
  146. celt_tests_test_unit_mdct_SOURCES = celt/tests/test_unit_mdct.c
  147. celt_tests_test_unit_mdct_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
  148. if OPUS_ARM_EXTERNAL_ASM
  149. celt_tests_test_unit_mdct_LDADD += libarmasm.la
  150. endif
  151. celt_tests_test_unit_rotation_SOURCES = celt/tests/test_unit_rotation.c
  152. celt_tests_test_unit_rotation_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
  153. if OPUS_ARM_EXTERNAL_ASM
  154. celt_tests_test_unit_rotation_LDADD += libarmasm.la
  155. endif
  156. celt_tests_test_unit_types_SOURCES = celt/tests/test_unit_types.c
  157. celt_tests_test_unit_types_LDADD = $(LIBM)
  158. endif
  159. if CUSTOM_MODES
  160. pkginclude_HEADERS += include/opus_custom.h
  161. if EXTRA_PROGRAMS
  162. noinst_PROGRAMS += opus_custom_demo
  163. opus_custom_demo_SOURCES = celt/opus_custom_demo.c
  164. opus_custom_demo_LDADD = libopus.la $(LIBM)
  165. endif
  166. endif
  167. EXTRA_DIST = opus.pc.in \
  168. opus-uninstalled.pc.in \
  169. opus.m4 \
  170. Makefile.mips \
  171. Makefile.unix \
  172. CMakeLists.txt \
  173. config.h.cmake.in \
  174. opus_buildtype.cmake \
  175. opus_config.cmake \
  176. opus_functions.cmake \
  177. opus_sources.cmake \
  178. OpusConfig.cmake.in \
  179. cmake/CFeatureCheck.cmake \
  180. cmake/vla.c \
  181. tests/run_vectors.sh \
  182. celt/arm/arm2gnu.pl \
  183. celt/arm/celt_pitch_xcorr_arm.s \
  184. win32/VS2015/opus.vcxproj \
  185. win32/VS2015/test_opus_encode.vcxproj.filters \
  186. win32/VS2015/test_opus_encode.vcxproj \
  187. win32/VS2015/opus_demo.vcxproj \
  188. win32/VS2015/test_opus_api.vcxproj.filters \
  189. win32/VS2015/test_opus_api.vcxproj \
  190. win32/VS2015/test_opus_decode.vcxproj.filters \
  191. win32/VS2015/opus_demo.vcxproj.filters \
  192. win32/VS2015/opus.vcxproj.filters \
  193. win32/VS2015/test_opus_decode.vcxproj \
  194. win32/VS2015/opus.sln \
  195. win32/VS2015/common.props \
  196. win32/genversion.bat \
  197. win32/config.h
  198. pkgconfigdir = $(libdir)/pkgconfig
  199. pkgconfig_DATA = opus.pc
  200. m4datadir = $(datadir)/aclocal
  201. m4data_DATA = opus.m4
  202. # Targets to build and install just the library without the docs
  203. opus check-opus install-opus: export NO_DOXYGEN = 1
  204. opus: all
  205. check-opus: check
  206. install-opus: install
  207. # Or just the docs
  208. docs:
  209. ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
  210. install-docs:
  211. ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
  212. # Or everything (by default)
  213. all-local:
  214. @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
  215. install-data-local:
  216. @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
  217. clean-local:
  218. -( cd doc && $(MAKE) $(AM_MAKEFLAGS) clean )
  219. uninstall-local:
  220. ( cd doc && $(MAKE) $(AM_MAKEFLAGS) uninstall )
  221. # We check this every time make is run, with configure.ac being touched to
  222. # trigger an update of the build system files if update_version changes the
  223. # current PACKAGE_VERSION (or if package_version was modified manually by a
  224. # user with either AUTO_UPDATE=no or no update_version script present - the
  225. # latter being the normal case for tarball releases).
  226. #
  227. # We can't just add the package_version file to CONFIGURE_DEPENDENCIES since
  228. # simply running autoconf will not actually regenerate configure for us when
  229. # the content of that file changes (due to autoconf dependency checking not
  230. # knowing about that without us creating yet another file for it to include).
  231. #
  232. # The MAKECMDGOALS check is a gnu-make'ism, but will degrade 'gracefully' for
  233. # makes that don't support it. The only loss of functionality is not forcing
  234. # an update of package_version for `make dist` if AUTO_UPDATE=no, but that is
  235. # unlikely to be a real problem for any real user.
  236. $(top_srcdir)/configure.ac: force
  237. @case "$(MAKECMDGOALS)" in \
  238. dist-hook) exit 0 ;; \
  239. dist-* | dist | distcheck | distclean) _arg=release ;; \
  240. esac; \
  241. if ! $(top_srcdir)/update_version $$_arg 2> /dev/null; then \
  242. if [ ! -e $(top_srcdir)/package_version ]; then \
  243. echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
  244. fi; \
  245. . $(top_srcdir)/package_version || exit 1; \
  246. [ "$(PACKAGE_VERSION)" != "$$PACKAGE_VERSION" ] || exit 0; \
  247. fi; \
  248. touch $@
  249. force:
  250. # Create a minimal package_version file when make dist is run.
  251. dist-hook:
  252. echo 'PACKAGE_VERSION="$(PACKAGE_VERSION)"' > $(top_distdir)/package_version
  253. .PHONY: opus check-opus install-opus docs install-docs
  254. # automake doesn't do dependency tracking for asm files, that I can tell
  255. $(CELT_SOURCES_ARM_ASM:%.s=%-gnu.S): celt/arm/armopts-gnu.S
  256. $(CELT_SOURCES_ARM_ASM:%.s=%-gnu.S): $(top_srcdir)/celt/arm/arm2gnu.pl
  257. # convert ARM asm to GNU as format
  258. %-gnu.S: $(top_srcdir)/%.s
  259. $(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
  260. # For autoconf-modified sources (e.g., armopts.s)
  261. %-gnu.S: %.s
  262. $(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
  263. OPT_UNIT_TEST_OBJ = $(celt_tests_test_unit_mathops_SOURCES:.c=.o) \
  264. $(celt_tests_test_unit_rotation_SOURCES:.c=.o) \
  265. $(celt_tests_test_unit_mdct_SOURCES:.c=.o) \
  266. $(celt_tests_test_unit_dft_SOURCES:.c=.o) \
  267. $(silk_tests_test_unit_LPC_inv_pred_gain_SOURCES:.c=.o)
  268. if HAVE_SSE
  269. SSE_OBJ = $(CELT_SOURCES_SSE:.c=.lo)
  270. $(SSE_OBJ): CFLAGS += $(OPUS_X86_SSE_CFLAGS)
  271. endif
  272. if HAVE_SSE2
  273. SSE2_OBJ = $(CELT_SOURCES_SSE2:.c=.lo)
  274. $(SSE2_OBJ): CFLAGS += $(OPUS_X86_SSE2_CFLAGS)
  275. endif
  276. if HAVE_SSE4_1
  277. SSE4_1_OBJ = $(CELT_SOURCES_SSE4_1:.c=.lo) \
  278. $(SILK_SOURCES_SSE4_1:.c=.lo) \
  279. $(SILK_SOURCES_FIXED_SSE4_1:.c=.lo)
  280. $(SSE4_1_OBJ): CFLAGS += $(OPUS_X86_SSE4_1_CFLAGS)
  281. endif
  282. if HAVE_ARM_NEON_INTR
  283. ARM_NEON_INTR_OBJ = $(CELT_SOURCES_ARM_NEON_INTR:.c=.lo) \
  284. $(SILK_SOURCES_ARM_NEON_INTR:.c=.lo) \
  285. $(SILK_SOURCES_FIXED_ARM_NEON_INTR:.c=.lo)
  286. $(ARM_NEON_INTR_OBJ): CFLAGS += \
  287. $(OPUS_ARM_NEON_INTR_CFLAGS) $(NE10_CFLAGS)
  288. endif