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