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