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