blob: 9c09decdf1d686929806f0ef1cbb3b5384c23dca [file] [log] [blame]
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -08001# Provide the full test output for failed tests when using the parallel
2# test suite (which is enabled by default with automake 1.13+).
3export VERBOSE = yes
4
5AUTOMAKE_OPTIONS = subdir-objects
6ACLOCAL_AMFLAGS = -I m4
7
8lib_LTLIBRARIES = libopus.la
9
10DIST_SUBDIRS = doc
11
12AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/celt -I$(top_srcdir)/silk \
flimc91ee5b2016-01-26 14:33:44 +010013 -I$(top_srcdir)/silk/float -I$(top_srcdir)/silk/fixed $(NE10_CFLAGS)
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -080014
15include celt_sources.mk
16include silk_sources.mk
17include opus_sources.mk
18
19if FIXED_POINT
20SILK_SOURCES += $(SILK_SOURCES_FIXED)
flimc91ee5b2016-01-26 14:33:44 +010021if HAVE_SSE4_1
22SILK_SOURCES += $(SILK_SOURCES_SSE4_1) $(SILK_SOURCES_FIXED_SSE4_1)
23endif
Felicia Lim0c2090c2017-07-05 17:36:56 -070024if HAVE_ARM_NEON_INTR
25SILK_SOURCES += $(SILK_SOURCES_FIXED_ARM_NEON_INTR)
26endif
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -080027else
28SILK_SOURCES += $(SILK_SOURCES_FLOAT)
flimc91ee5b2016-01-26 14:33:44 +010029if HAVE_SSE4_1
30SILK_SOURCES += $(SILK_SOURCES_SSE4_1)
31endif
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -080032endif
33
34if DISABLE_FLOAT_API
35else
36OPUS_SOURCES += $(OPUS_SOURCES_FLOAT)
37endif
38
flimc91ee5b2016-01-26 14:33:44 +010039if HAVE_SSE
40CELT_SOURCES += $(CELT_SOURCES_SSE)
41endif
42if HAVE_SSE2
43CELT_SOURCES += $(CELT_SOURCES_SSE2)
44endif
45if HAVE_SSE4_1
46CELT_SOURCES += $(CELT_SOURCES_SSE4_1)
47endif
48
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -080049if CPU_ARM
50CELT_SOURCES += $(CELT_SOURCES_ARM)
51SILK_SOURCES += $(SILK_SOURCES_ARM)
flimc91ee5b2016-01-26 14:33:44 +010052
Felicia Limd03c3732016-07-25 20:28:37 +020053if HAVE_ARM_NEON_INTR
flimc91ee5b2016-01-26 14:33:44 +010054CELT_SOURCES += $(CELT_SOURCES_ARM_NEON_INTR)
Felicia Limd03c3732016-07-25 20:28:37 +020055SILK_SOURCES += $(SILK_SOURCES_ARM_NEON_INTR)
flimc91ee5b2016-01-26 14:33:44 +010056endif
57
58if HAVE_ARM_NE10
59CELT_SOURCES += $(CELT_SOURCES_ARM_NE10)
60endif
61
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -080062if OPUS_ARM_EXTERNAL_ASM
flimc91ee5b2016-01-26 14:33:44 +010063noinst_LTLIBRARIES = libarmasm.la
64libarmasm_la_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S)
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -080065BUILT_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
66 $(CELT_AM_SOURCES_ARM_ASM:.s.in=.s) \
67 $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
68endif
69endif
70
71CLEANFILES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
72 $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
73
74include celt_headers.mk
75include silk_headers.mk
76include opus_headers.mk
77
78libopus_la_SOURCES = $(CELT_SOURCES) $(SILK_SOURCES) $(OPUS_SOURCES)
79libopus_la_LDFLAGS = -no-undefined -version-info @OPUS_LT_CURRENT@:@OPUS_LT_REVISION@:@OPUS_LT_AGE@
flimc91ee5b2016-01-26 14:33:44 +010080libopus_la_LIBADD = $(NE10_LIBS) $(LIBM)
81if OPUS_ARM_EXTERNAL_ASM
82libopus_la_LIBADD += libarmasm.la
83endif
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -080084
Felicia Lim0efcc2b2018-11-06 12:35:39 -080085pkginclude_HEADERS = include/opus.h include/opus_multistream.h include/opus_types.h include/opus_defines.h include/opus_projection.h
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -080086
87noinst_HEADERS = $(OPUS_HEAD) $(SILK_HEAD) $(CELT_HEAD)
88
89if EXTRA_PROGRAMS
Felicia Lim0c2090c2017-07-05 17:36:56 -070090noinst_PROGRAMS = celt/tests/test_unit_cwrs32 \
91 celt/tests/test_unit_dft \
92 celt/tests/test_unit_entropy \
93 celt/tests/test_unit_laplace \
94 celt/tests/test_unit_mathops \
95 celt/tests/test_unit_mdct \
96 celt/tests/test_unit_rotation \
97 celt/tests/test_unit_types \
98 opus_compare \
99 opus_demo \
100 repacketizer_demo \
101 silk/tests/test_unit_LPC_inv_pred_gain \
102 tests/test_opus_api \
103 tests/test_opus_decode \
104 tests/test_opus_encode \
Felicia Lim0efcc2b2018-11-06 12:35:39 -0800105 tests/test_opus_padding \
106 tests/test_opus_projection
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800107
Felicia Lim0c2090c2017-07-05 17:36:56 -0700108TESTS = celt/tests/test_unit_cwrs32 \
109 celt/tests/test_unit_dft \
110 celt/tests/test_unit_entropy \
111 celt/tests/test_unit_laplace \
112 celt/tests/test_unit_mathops \
113 celt/tests/test_unit_mdct \
114 celt/tests/test_unit_rotation \
115 celt/tests/test_unit_types \
116 silk/tests/test_unit_LPC_inv_pred_gain \
117 tests/test_opus_api \
118 tests/test_opus_decode \
119 tests/test_opus_encode \
Felicia Lim0efcc2b2018-11-06 12:35:39 -0800120 tests/test_opus_padding \
121 tests/test_opus_projection
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800122
123opus_demo_SOURCES = src/opus_demo.c
124
flimc91ee5b2016-01-26 14:33:44 +0100125opus_demo_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800126
127repacketizer_demo_SOURCES = src/repacketizer_demo.c
128
flimc91ee5b2016-01-26 14:33:44 +0100129repacketizer_demo_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800130
131opus_compare_SOURCES = src/opus_compare.c
132opus_compare_LDADD = $(LIBM)
133
134tests_test_opus_api_SOURCES = tests/test_opus_api.c tests/test_opus_common.h
flimc91ee5b2016-01-26 14:33:44 +0100135tests_test_opus_api_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800136
Felicia Lim0c2090c2017-07-05 17:36:56 -0700137tests_test_opus_encode_SOURCES = tests/test_opus_encode.c tests/opus_encode_regressions.c tests/test_opus_common.h
flimc91ee5b2016-01-26 14:33:44 +0100138tests_test_opus_encode_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800139
140tests_test_opus_decode_SOURCES = tests/test_opus_decode.c tests/test_opus_common.h
flimc91ee5b2016-01-26 14:33:44 +0100141tests_test_opus_decode_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800142
143tests_test_opus_padding_SOURCES = tests/test_opus_padding.c tests/test_opus_common.h
flimc91ee5b2016-01-26 14:33:44 +0100144tests_test_opus_padding_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800145
Felicia Lim0c2090c2017-07-05 17:36:56 -0700146CELT_OBJ = $(CELT_SOURCES:.c=.lo)
147SILK_OBJ = $(SILK_SOURCES:.c=.lo)
Felicia Lim0efcc2b2018-11-06 12:35:39 -0800148OPUS_OBJ = $(OPUS_SOURCES:.c=.lo)
149
150tests_test_opus_projection_SOURCES = tests/test_opus_projection.c tests/test_opus_common.h
151tests_test_opus_projection_LDADD = $(OPUS_OBJ) $(SILK_OBJ) $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
152if OPUS_ARM_EXTERNAL_ASM
153tests_test_opus_projection_LDADD += libarmasm.la
154endif
Felicia Lim0c2090c2017-07-05 17:36:56 -0700155
156silk_tests_test_unit_LPC_inv_pred_gain_SOURCES = silk/tests/test_unit_LPC_inv_pred_gain.c
157silk_tests_test_unit_LPC_inv_pred_gain_LDADD = $(SILK_OBJ) $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
158if OPUS_ARM_EXTERNAL_ASM
159silk_tests_test_unit_LPC_inv_pred_gain_LDADD += libarmasm.la
160endif
161
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800162celt_tests_test_unit_cwrs32_SOURCES = celt/tests/test_unit_cwrs32.c
163celt_tests_test_unit_cwrs32_LDADD = $(LIBM)
164
165celt_tests_test_unit_dft_SOURCES = celt/tests/test_unit_dft.c
Felicia Lim0c2090c2017-07-05 17:36:56 -0700166celt_tests_test_unit_dft_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
flimc91ee5b2016-01-26 14:33:44 +0100167if OPUS_ARM_EXTERNAL_ASM
168celt_tests_test_unit_dft_LDADD += libarmasm.la
169endif
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800170
171celt_tests_test_unit_entropy_SOURCES = celt/tests/test_unit_entropy.c
172celt_tests_test_unit_entropy_LDADD = $(LIBM)
173
174celt_tests_test_unit_laplace_SOURCES = celt/tests/test_unit_laplace.c
175celt_tests_test_unit_laplace_LDADD = $(LIBM)
176
177celt_tests_test_unit_mathops_SOURCES = celt/tests/test_unit_mathops.c
Felicia Lim0c2090c2017-07-05 17:36:56 -0700178celt_tests_test_unit_mathops_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
flimc91ee5b2016-01-26 14:33:44 +0100179if OPUS_ARM_EXTERNAL_ASM
180celt_tests_test_unit_mathops_LDADD += libarmasm.la
181endif
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800182
183celt_tests_test_unit_mdct_SOURCES = celt/tests/test_unit_mdct.c
Felicia Lim0c2090c2017-07-05 17:36:56 -0700184celt_tests_test_unit_mdct_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
flimc91ee5b2016-01-26 14:33:44 +0100185if OPUS_ARM_EXTERNAL_ASM
186celt_tests_test_unit_mdct_LDADD += libarmasm.la
187endif
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800188
189celt_tests_test_unit_rotation_SOURCES = celt/tests/test_unit_rotation.c
Felicia Lim0c2090c2017-07-05 17:36:56 -0700190celt_tests_test_unit_rotation_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
flimc91ee5b2016-01-26 14:33:44 +0100191if OPUS_ARM_EXTERNAL_ASM
192celt_tests_test_unit_rotation_LDADD += libarmasm.la
193endif
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800194
195celt_tests_test_unit_types_SOURCES = celt/tests/test_unit_types.c
196celt_tests_test_unit_types_LDADD = $(LIBM)
197endif
198
199if CUSTOM_MODES
200pkginclude_HEADERS += include/opus_custom.h
201if EXTRA_PROGRAMS
202noinst_PROGRAMS += opus_custom_demo
203opus_custom_demo_SOURCES = celt/opus_custom_demo.c
204opus_custom_demo_LDADD = libopus.la $(LIBM)
205endif
206endif
207
Felicia Lim0c2090c2017-07-05 17:36:56 -0700208EXTRA_DIST = opus.pc.in \
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800209 opus-uninstalled.pc.in \
210 opus.m4 \
flimc91ee5b2016-01-26 14:33:44 +0100211 Makefile.mips \
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800212 Makefile.unix \
213 tests/run_vectors.sh \
214 celt/arm/arm2gnu.pl \
215 celt/arm/celt_pitch_xcorr_arm.s \
Felicia Limd03c3732016-07-25 20:28:37 +0200216 win32/VS2015/opus.vcxproj \
Felicia Limd03c3732016-07-25 20:28:37 +0200217 win32/VS2015/test_opus_encode.vcxproj.filters \
Felicia Limd03c3732016-07-25 20:28:37 +0200218 win32/VS2015/test_opus_encode.vcxproj \
219 win32/VS2015/opus_demo.vcxproj \
220 win32/VS2015/test_opus_api.vcxproj.filters \
221 win32/VS2015/test_opus_api.vcxproj \
222 win32/VS2015/test_opus_decode.vcxproj.filters \
Felicia Limd03c3732016-07-25 20:28:37 +0200223 win32/VS2015/opus_demo.vcxproj.filters \
Felicia Limd03c3732016-07-25 20:28:37 +0200224 win32/VS2015/opus.vcxproj.filters \
225 win32/VS2015/test_opus_decode.vcxproj \
Felicia Limd03c3732016-07-25 20:28:37 +0200226 win32/VS2015/opus.sln \
Felicia Lim0c2090c2017-07-05 17:36:56 -0700227 win32/VS2015/common.props \
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800228 win32/genversion.bat \
229 win32/config.h
230
231pkgconfigdir = $(libdir)/pkgconfig
232pkgconfig_DATA = opus.pc
233
234m4datadir = $(datadir)/aclocal
235m4data_DATA = opus.m4
236
237# Targets to build and install just the library without the docs
238opus check-opus install-opus: export NO_DOXYGEN = 1
239
240opus: all
241check-opus: check
242install-opus: install
243
244
245# Or just the docs
246docs:
247 ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
248
249install-docs:
250 ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
251
252
253# Or everything (by default)
254all-local:
255 @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
256
257install-data-local:
258 @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
259
260clean-local:
261 -( cd doc && $(MAKE) $(AM_MAKEFLAGS) clean )
262
263uninstall-local:
264 ( cd doc && $(MAKE) $(AM_MAKEFLAGS) uninstall )
265
266
267# We check this every time make is run, with configure.ac being touched to
268# trigger an update of the build system files if update_version changes the
269# current PACKAGE_VERSION (or if package_version was modified manually by a
270# user with either AUTO_UPDATE=no or no update_version script present - the
271# latter being the normal case for tarball releases).
272#
273# We can't just add the package_version file to CONFIGURE_DEPENDENCIES since
274# simply running autoconf will not actually regenerate configure for us when
275# the content of that file changes (due to autoconf dependency checking not
276# knowing about that without us creating yet another file for it to include).
277#
278# The MAKECMDGOALS check is a gnu-make'ism, but will degrade 'gracefully' for
279# makes that don't support it. The only loss of functionality is not forcing
280# an update of package_version for `make dist` if AUTO_UPDATE=no, but that is
281# unlikely to be a real problem for any real user.
282$(top_srcdir)/configure.ac: force
283 @case "$(MAKECMDGOALS)" in \
284 dist-hook) exit 0 ;; \
285 dist-* | dist | distcheck | distclean) _arg=release ;; \
286 esac; \
287 if ! $(top_srcdir)/update_version $$_arg 2> /dev/null; then \
288 if [ ! -e $(top_srcdir)/package_version ]; then \
289 echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
290 fi; \
291 . $(top_srcdir)/package_version || exit 1; \
292 [ "$(PACKAGE_VERSION)" != "$$PACKAGE_VERSION" ] || exit 0; \
293 fi; \
294 touch $@
295
296force:
297
298# Create a minimal package_version file when make dist is run.
299dist-hook:
300 echo 'PACKAGE_VERSION="$(PACKAGE_VERSION)"' > $(top_distdir)/package_version
301
302
303.PHONY: opus check-opus install-opus docs install-docs
304
305# automake doesn't do dependency tracking for asm files, that I can tell
306$(CELT_SOURCES_ARM_ASM:%.s=%-gnu.S): celt/arm/armopts-gnu.S
307$(CELT_SOURCES_ARM_ASM:%.s=%-gnu.S): $(top_srcdir)/celt/arm/arm2gnu.pl
308
309# convert ARM asm to GNU as format
310%-gnu.S: $(top_srcdir)/%.s
flimc91ee5b2016-01-26 14:33:44 +0100311 $(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
Vignesh Venkatasubramanian2bd8b542014-02-20 10:50:35 -0800312# For autoconf-modified sources (e.g., armopts.s)
313%-gnu.S: %.s
flimc91ee5b2016-01-26 14:33:44 +0100314 $(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
315
316OPT_UNIT_TEST_OBJ = $(celt_tests_test_unit_mathops_SOURCES:.c=.o) \
317 $(celt_tests_test_unit_rotation_SOURCES:.c=.o) \
318 $(celt_tests_test_unit_mdct_SOURCES:.c=.o) \
Felicia Lim0c2090c2017-07-05 17:36:56 -0700319 $(celt_tests_test_unit_dft_SOURCES:.c=.o) \
320 $(silk_tests_test_unit_LPC_inv_pred_gain_SOURCES:.c=.o)
flimc91ee5b2016-01-26 14:33:44 +0100321
322if HAVE_SSE
323SSE_OBJ = $(CELT_SOURCES_SSE:.c=.lo)
Felicia Lim0c2090c2017-07-05 17:36:56 -0700324$(SSE_OBJ): CFLAGS += $(OPUS_X86_SSE_CFLAGS)
flimc91ee5b2016-01-26 14:33:44 +0100325endif
326
327if HAVE_SSE2
328SSE2_OBJ = $(CELT_SOURCES_SSE2:.c=.lo)
Felicia Lim0c2090c2017-07-05 17:36:56 -0700329$(SSE2_OBJ): CFLAGS += $(OPUS_X86_SSE2_CFLAGS)
flimc91ee5b2016-01-26 14:33:44 +0100330endif
331
332if HAVE_SSE4_1
333SSE4_1_OBJ = $(CELT_SOURCES_SSE4_1:.c=.lo) \
334 $(SILK_SOURCES_SSE4_1:.c=.lo) \
335 $(SILK_SOURCES_FIXED_SSE4_1:.c=.lo)
Felicia Lim0c2090c2017-07-05 17:36:56 -0700336$(SSE4_1_OBJ): CFLAGS += $(OPUS_X86_SSE4_1_CFLAGS)
flimc91ee5b2016-01-26 14:33:44 +0100337endif
338
Felicia Limd03c3732016-07-25 20:28:37 +0200339if HAVE_ARM_NEON_INTR
Felicia Lim0c2090c2017-07-05 17:36:56 -0700340ARM_NEON_INTR_OBJ = $(CELT_SOURCES_ARM_NEON_INTR:.c=.lo) \
341 $(SILK_SOURCES_ARM_NEON_INTR:.c=.lo) \
342 $(SILK_SOURCES_FIXED_ARM_NEON_INTR:.c=.lo)
343$(ARM_NEON_INTR_OBJ): CFLAGS += \
flimc91ee5b2016-01-26 14:33:44 +0100344 $(OPUS_ARM_NEON_INTR_CFLAGS) $(NE10_CFLAGS)
345endif