Makefile.am 10 KB

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