Makefile.am 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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
  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 = celt/tests/test_unit_cwrs32 \
  89. celt/tests/test_unit_dft \
  90. celt/tests/test_unit_entropy \
  91. celt/tests/test_unit_laplace \
  92. celt/tests/test_unit_mathops \
  93. celt/tests/test_unit_mdct \
  94. celt/tests/test_unit_rotation \
  95. celt/tests/test_unit_types \
  96. silk/tests/test_unit_LPC_inv_pred_gain \
  97. tests/test_opus_api \
  98. tests/test_opus_decode \
  99. tests/test_opus_encode \
  100. tests/test_opus_padding
  101. opus_demo_SOURCES = src/opus_demo.c
  102. opus_demo_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
  103. repacketizer_demo_SOURCES = src/repacketizer_demo.c
  104. repacketizer_demo_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
  105. opus_compare_SOURCES = src/opus_compare.c
  106. opus_compare_LDADD = $(LIBM)
  107. tests_test_opus_api_SOURCES = tests/test_opus_api.c tests/test_opus_common.h
  108. tests_test_opus_api_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
  109. tests_test_opus_encode_SOURCES = tests/test_opus_encode.c tests/opus_encode_regressions.c tests/test_opus_common.h
  110. tests_test_opus_encode_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
  111. tests_test_opus_decode_SOURCES = tests/test_opus_decode.c tests/test_opus_common.h
  112. tests_test_opus_decode_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
  113. tests_test_opus_padding_SOURCES = tests/test_opus_padding.c tests/test_opus_common.h
  114. tests_test_opus_padding_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
  115. CELT_OBJ = $(CELT_SOURCES:.c=.lo)
  116. SILK_OBJ = $(SILK_SOURCES:.c=.lo)
  117. silk_tests_test_unit_LPC_inv_pred_gain_SOURCES = silk/tests/test_unit_LPC_inv_pred_gain.c
  118. silk_tests_test_unit_LPC_inv_pred_gain_LDADD = $(SILK_OBJ) $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
  119. if OPUS_ARM_EXTERNAL_ASM
  120. silk_tests_test_unit_LPC_inv_pred_gain_LDADD += libarmasm.la
  121. endif
  122. celt_tests_test_unit_cwrs32_SOURCES = celt/tests/test_unit_cwrs32.c
  123. celt_tests_test_unit_cwrs32_LDADD = $(LIBM)
  124. celt_tests_test_unit_dft_SOURCES = celt/tests/test_unit_dft.c
  125. celt_tests_test_unit_dft_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
  126. if OPUS_ARM_EXTERNAL_ASM
  127. celt_tests_test_unit_dft_LDADD += libarmasm.la
  128. endif
  129. celt_tests_test_unit_entropy_SOURCES = celt/tests/test_unit_entropy.c
  130. celt_tests_test_unit_entropy_LDADD = $(LIBM)
  131. celt_tests_test_unit_laplace_SOURCES = celt/tests/test_unit_laplace.c
  132. celt_tests_test_unit_laplace_LDADD = $(LIBM)
  133. celt_tests_test_unit_mathops_SOURCES = celt/tests/test_unit_mathops.c
  134. celt_tests_test_unit_mathops_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
  135. if OPUS_ARM_EXTERNAL_ASM
  136. celt_tests_test_unit_mathops_LDADD += libarmasm.la
  137. endif
  138. celt_tests_test_unit_mdct_SOURCES = celt/tests/test_unit_mdct.c
  139. celt_tests_test_unit_mdct_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
  140. if OPUS_ARM_EXTERNAL_ASM
  141. celt_tests_test_unit_mdct_LDADD += libarmasm.la
  142. endif
  143. celt_tests_test_unit_rotation_SOURCES = celt/tests/test_unit_rotation.c
  144. celt_tests_test_unit_rotation_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
  145. if OPUS_ARM_EXTERNAL_ASM
  146. celt_tests_test_unit_rotation_LDADD += libarmasm.la
  147. endif
  148. celt_tests_test_unit_types_SOURCES = celt/tests/test_unit_types.c
  149. celt_tests_test_unit_types_LDADD = $(LIBM)
  150. endif
  151. if CUSTOM_MODES
  152. pkginclude_HEADERS += include/opus_custom.h
  153. if EXTRA_PROGRAMS
  154. noinst_PROGRAMS += opus_custom_demo
  155. opus_custom_demo_SOURCES = celt/opus_custom_demo.c
  156. opus_custom_demo_LDADD = libopus.la $(LIBM)
  157. endif
  158. endif
  159. EXTRA_DIST = opus.pc.in \
  160. opus-uninstalled.pc.in \
  161. opus.m4 \
  162. Makefile.mips \
  163. Makefile.unix \
  164. tests/run_vectors.sh \
  165. celt/arm/arm2gnu.pl \
  166. celt/arm/celt_pitch_xcorr_arm.s \
  167. win32/VS2015/opus.vcxproj \
  168. win32/VS2015/test_opus_encode.vcxproj.filters \
  169. win32/VS2015/test_opus_encode.vcxproj \
  170. win32/VS2015/opus_demo.vcxproj \
  171. win32/VS2015/test_opus_api.vcxproj.filters \
  172. win32/VS2015/test_opus_api.vcxproj \
  173. win32/VS2015/test_opus_decode.vcxproj.filters \
  174. win32/VS2015/opus_demo.vcxproj.filters \
  175. win32/VS2015/opus.vcxproj.filters \
  176. win32/VS2015/test_opus_decode.vcxproj \
  177. win32/VS2015/opus.sln \
  178. win32/VS2015/common.props \
  179. win32/genversion.bat \
  180. win32/config.h
  181. pkgconfigdir = $(libdir)/pkgconfig
  182. pkgconfig_DATA = opus.pc
  183. m4datadir = $(datadir)/aclocal
  184. m4data_DATA = opus.m4
  185. # Targets to build and install just the library without the docs
  186. opus check-opus install-opus: export NO_DOXYGEN = 1
  187. opus: all
  188. check-opus: check
  189. install-opus: install
  190. # Or just the docs
  191. docs:
  192. ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
  193. install-docs:
  194. ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
  195. # Or everything (by default)
  196. all-local:
  197. @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
  198. install-data-local:
  199. @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
  200. clean-local:
  201. -( cd doc && $(MAKE) $(AM_MAKEFLAGS) clean )
  202. uninstall-local:
  203. ( cd doc && $(MAKE) $(AM_MAKEFLAGS) uninstall )
  204. # We check this every time make is run, with configure.ac being touched to
  205. # trigger an update of the build system files if update_version changes the
  206. # current PACKAGE_VERSION (or if package_version was modified manually by a
  207. # user with either AUTO_UPDATE=no or no update_version script present - the
  208. # latter being the normal case for tarball releases).
  209. #
  210. # We can't just add the package_version file to CONFIGURE_DEPENDENCIES since
  211. # simply running autoconf will not actually regenerate configure for us when
  212. # the content of that file changes (due to autoconf dependency checking not
  213. # knowing about that without us creating yet another file for it to include).
  214. #
  215. # The MAKECMDGOALS check is a gnu-make'ism, but will degrade 'gracefully' for
  216. # makes that don't support it. The only loss of functionality is not forcing
  217. # an update of package_version for `make dist` if AUTO_UPDATE=no, but that is
  218. # unlikely to be a real problem for any real user.
  219. $(top_srcdir)/configure.ac: force
  220. @case "$(MAKECMDGOALS)" in \
  221. dist-hook) exit 0 ;; \
  222. dist-* | dist | distcheck | distclean) _arg=release ;; \
  223. esac; \
  224. if ! $(top_srcdir)/update_version $$_arg 2> /dev/null; then \
  225. if [ ! -e $(top_srcdir)/package_version ]; then \
  226. echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
  227. fi; \
  228. . $(top_srcdir)/package_version || exit 1; \
  229. [ "$(PACKAGE_VERSION)" != "$$PACKAGE_VERSION" ] || exit 0; \
  230. fi; \
  231. touch $@
  232. force:
  233. # Create a minimal package_version file when make dist is run.
  234. dist-hook:
  235. echo 'PACKAGE_VERSION="$(PACKAGE_VERSION)"' > $(top_distdir)/package_version
  236. .PHONY: opus check-opus install-opus docs install-docs
  237. # automake doesn't do dependency tracking for asm files, that I can tell
  238. $(CELT_SOURCES_ARM_ASM:%.s=%-gnu.S): celt/arm/armopts-gnu.S
  239. $(CELT_SOURCES_ARM_ASM:%.s=%-gnu.S): $(top_srcdir)/celt/arm/arm2gnu.pl
  240. # convert ARM asm to GNU as format
  241. %-gnu.S: $(top_srcdir)/%.s
  242. $(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
  243. # For autoconf-modified sources (e.g., armopts.s)
  244. %-gnu.S: %.s
  245. $(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
  246. OPT_UNIT_TEST_OBJ = $(celt_tests_test_unit_mathops_SOURCES:.c=.o) \
  247. $(celt_tests_test_unit_rotation_SOURCES:.c=.o) \
  248. $(celt_tests_test_unit_mdct_SOURCES:.c=.o) \
  249. $(celt_tests_test_unit_dft_SOURCES:.c=.o) \
  250. $(silk_tests_test_unit_LPC_inv_pred_gain_SOURCES:.c=.o)
  251. if HAVE_SSE
  252. SSE_OBJ = $(CELT_SOURCES_SSE:.c=.lo)
  253. $(SSE_OBJ): CFLAGS += $(OPUS_X86_SSE_CFLAGS)
  254. endif
  255. if HAVE_SSE2
  256. SSE2_OBJ = $(CELT_SOURCES_SSE2:.c=.lo)
  257. $(SSE2_OBJ): CFLAGS += $(OPUS_X86_SSE2_CFLAGS)
  258. endif
  259. if HAVE_SSE4_1
  260. SSE4_1_OBJ = $(CELT_SOURCES_SSE4_1:.c=.lo) \
  261. $(SILK_SOURCES_SSE4_1:.c=.lo) \
  262. $(SILK_SOURCES_FIXED_SSE4_1:.c=.lo)
  263. $(SSE4_1_OBJ): CFLAGS += $(OPUS_X86_SSE4_1_CFLAGS)
  264. endif
  265. if HAVE_ARM_NEON_INTR
  266. ARM_NEON_INTR_OBJ = $(CELT_SOURCES_ARM_NEON_INTR:.c=.lo) \
  267. $(SILK_SOURCES_ARM_NEON_INTR:.c=.lo) \
  268. $(SILK_SOURCES_FIXED_ARM_NEON_INTR:.c=.lo)
  269. $(ARM_NEON_INTR_OBJ): CFLAGS += \
  270. $(OPUS_ARM_NEON_INTR_CFLAGS) $(NE10_CFLAGS)
  271. endif