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