Enable intrinsics by default.
[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/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 = version.mk \
161              opus.pc.in \
162              opus-uninstalled.pc.in \
163              opus.m4 \
164              Makefile.mips \
165              Makefile.unix \
166              tests/run_vectors.sh \
167              celt/arm/arm2gnu.pl \
168              celt/arm/celt_pitch_xcorr_arm.s \
169              win32/VS2015/silk_float.vcxproj \
170              win32/VS2015/celt.vcxproj.filters \
171              win32/VS2015/opus.vcxproj \
172              win32/VS2015/silk_common.vcxproj.filters \
173              win32/VS2015/silk_float.vcxproj.filters \
174              win32/VS2015/test_opus_encode.vcxproj.filters \
175              win32/VS2015/silk_common.vcxproj \
176              win32/VS2015/test_opus_encode.vcxproj \
177              win32/VS2015/opus_demo.vcxproj \
178              win32/VS2015/test_opus_api.vcxproj.filters \
179              win32/VS2015/test_opus_api.vcxproj \
180              win32/VS2015/test_opus_decode.vcxproj.filters \
181              win32/VS2015/silk_fixed.vcxproj.filters \
182              win32/VS2015/opus_demo.vcxproj.filters \
183              win32/VS2015/silk_fixed.vcxproj \
184              win32/VS2015/opus.vcxproj.filters \
185              win32/VS2015/test_opus_decode.vcxproj \
186              win32/VS2015/celt.vcxproj \
187              win32/VS2015/opus.sln \
188              win32/genversion.bat \
189              win32/config.h
190
191 pkgconfigdir = $(libdir)/pkgconfig
192 pkgconfig_DATA = opus.pc
193
194 m4datadir = $(datadir)/aclocal
195 m4data_DATA = opus.m4
196
197 # Targets to build and install just the library without the docs
198 opus check-opus install-opus: export NO_DOXYGEN = 1
199
200 opus: all
201 check-opus: check
202 install-opus: install
203
204
205 # Or just the docs
206 docs:
207         ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
208
209 install-docs:
210         ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
211
212
213 # Or everything (by default)
214 all-local:
215         @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
216
217 install-data-local:
218         @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
219
220 clean-local:
221         -( cd doc && $(MAKE) $(AM_MAKEFLAGS) clean )
222
223 uninstall-local:
224         ( cd doc && $(MAKE) $(AM_MAKEFLAGS) uninstall )
225
226
227 # We check this every time make is run, with configure.ac being touched to
228 # trigger an update of the build system files if update_version changes the
229 # current PACKAGE_VERSION (or if package_version was modified manually by a
230 # user with either AUTO_UPDATE=no or no update_version script present - the
231 # latter being the normal case for tarball releases).
232 #
233 # We can't just add the package_version file to CONFIGURE_DEPENDENCIES since
234 # simply running autoconf will not actually regenerate configure for us when
235 # the content of that file changes (due to autoconf dependency checking not
236 # knowing about that without us creating yet another file for it to include).
237 #
238 # The MAKECMDGOALS check is a gnu-make'ism, but will degrade 'gracefully' for
239 # makes that don't support it.  The only loss of functionality is not forcing
240 # an update of package_version for `make dist` if AUTO_UPDATE=no, but that is
241 # unlikely to be a real problem for any real user.
242 $(top_srcdir)/configure.ac: force
243         @case "$(MAKECMDGOALS)" in \
244             dist-hook)                             exit 0       ;; \
245             dist-* | dist | distcheck | distclean) _arg=release ;; \
246         esac; \
247         if ! $(top_srcdir)/update_version $$_arg 2> /dev/null; then \
248             if [ ! -e $(top_srcdir)/package_version ]; then \
249                 echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
250             fi; \
251             . $(top_srcdir)/package_version || exit 1; \
252             [ "$(PACKAGE_VERSION)" != "$$PACKAGE_VERSION" ] || exit 0; \
253         fi; \
254         touch $@
255
256 force:
257
258 # Create a minimal package_version file when make dist is run.
259 dist-hook:
260         echo 'PACKAGE_VERSION="$(PACKAGE_VERSION)"' > $(top_distdir)/package_version
261
262
263 .PHONY: opus check-opus install-opus docs install-docs
264
265 # automake doesn't do dependency tracking for asm files, that I can tell
266 $(CELT_SOURCES_ARM_ASM:%.s=%-gnu.S): celt/arm/armopts-gnu.S
267 $(CELT_SOURCES_ARM_ASM:%.s=%-gnu.S): $(top_srcdir)/celt/arm/arm2gnu.pl
268
269 # convert ARM asm to GNU as format
270 %-gnu.S: $(top_srcdir)/%.s
271         $(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
272 # For autoconf-modified sources (e.g., armopts.s)
273 %-gnu.S: %.s
274         $(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
275
276 OPT_UNIT_TEST_OBJ = $(celt_tests_test_unit_mathops_SOURCES:.c=.o) \
277                     $(celt_tests_test_unit_rotation_SOURCES:.c=.o) \
278                     $(celt_tests_test_unit_mdct_SOURCES:.c=.o) \
279                     $(celt_tests_test_unit_dft_SOURCES:.c=.o)
280
281 if HAVE_SSE
282 SSE_OBJ = $(CELT_SOURCES_SSE:.c=.lo)
283 $(SSE_OBJ) $(OPT_UNIT_TEST_OBJ): CFLAGS += $(OPUS_X86_SSE_CFLAGS)
284 endif
285
286 if HAVE_SSE2
287 SSE2_OBJ = $(CELT_SOURCES_SSE2:.c=.lo)
288 $(SSE2_OBJ) $(OPT_UNIT_TEST_OBJ): CFLAGS += $(OPUS_X86_SSE2_CFLAGS)
289 endif
290
291 if HAVE_SSE4_1
292 SSE4_1_OBJ = $(CELT_SOURCES_SSE4_1:.c=.lo) \
293              $(SILK_SOURCES_SSE4_1:.c=.lo) \
294              $(SILK_SOURCES_FIXED_SSE4_1:.c=.lo)
295 $(SSE4_1_OBJ) $(OPT_UNIT_TEST_OBJ): CFLAGS += $(OPUS_X86_SSE4_1_CFLAGS)
296 endif
297
298 if HAVE_ARM_NEON_INTR
299 ARM_NEON_INTR_OBJ = $(CELT_SOURCES_ARM_NEON_INTR:.c=.lo) $(SILK_SOURCES_ARM_NEON_INTR:.c=.lo)
300 $(ARM_NEON_INTR_OBJ) $(OPT_UNIT_TEST_OBJ): CFLAGS += \
301  $(OPUS_ARM_NEON_INTR_CFLAGS)  $(NE10_CFLAGS)
302 endif