• 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
24else
25SILK_SOURCES += $(SILK_SOURCES_FLOAT)
26if HAVE_SSE4_1
27SILK_SOURCES += $(SILK_SOURCES_SSE4_1)
28endif
29endif
30
31if DISABLE_FLOAT_API
32else
33OPUS_SOURCES += $(OPUS_SOURCES_FLOAT)
34endif
35
36if HAVE_SSE
37CELT_SOURCES += $(CELT_SOURCES_SSE)
38endif
39if HAVE_SSE2
40CELT_SOURCES += $(CELT_SOURCES_SSE2)
41endif
42if HAVE_SSE4_1
43CELT_SOURCES += $(CELT_SOURCES_SSE4_1)
44endif
45
46if CPU_ARM
47CELT_SOURCES += $(CELT_SOURCES_ARM)
48SILK_SOURCES += $(SILK_SOURCES_ARM)
49
50if HAVE_ARM_NEON_INTR
51CELT_SOURCES += $(CELT_SOURCES_ARM_NEON_INTR)
52SILK_SOURCES += $(SILK_SOURCES_ARM_NEON_INTR)
53endif
54
55if HAVE_ARM_NE10
56CELT_SOURCES += $(CELT_SOURCES_ARM_NE10)
57endif
58
59if OPUS_ARM_EXTERNAL_ASM
60noinst_LTLIBRARIES = libarmasm.la
61libarmasm_la_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S)
62BUILT_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)
65endif
66endif
67
68CLEANFILES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
69 $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
70
71include celt_headers.mk
72include silk_headers.mk
73include opus_headers.mk
74
75libopus_la_SOURCES = $(CELT_SOURCES) $(SILK_SOURCES) $(OPUS_SOURCES)
76libopus_la_LDFLAGS = -no-undefined -version-info @OPUS_LT_CURRENT@:@OPUS_LT_REVISION@:@OPUS_LT_AGE@
77libopus_la_LIBADD = $(NE10_LIBS) $(LIBM)
78if OPUS_ARM_EXTERNAL_ASM
79libopus_la_LIBADD += libarmasm.la
80endif
81
82pkginclude_HEADERS = include/opus.h include/opus_multistream.h include/opus_types.h include/opus_defines.h
83
84noinst_HEADERS = $(OPUS_HEAD) $(SILK_HEAD) $(CELT_HEAD)
85
86if EXTRA_PROGRAMS
87noinst_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
89TESTS = 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
91opus_demo_SOURCES = src/opus_demo.c
92
93opus_demo_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
94
95repacketizer_demo_SOURCES = src/repacketizer_demo.c
96
97repacketizer_demo_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
98
99opus_compare_SOURCES = src/opus_compare.c
100opus_compare_LDADD = $(LIBM)
101
102tests_test_opus_api_SOURCES = tests/test_opus_api.c tests/test_opus_common.h
103tests_test_opus_api_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
104
105tests_test_opus_encode_SOURCES = tests/test_opus_encode.c tests/test_opus_common.h
106tests_test_opus_encode_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
107
108tests_test_opus_decode_SOURCES = tests/test_opus_decode.c tests/test_opus_common.h
109tests_test_opus_decode_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
110
111tests_test_opus_padding_SOURCES = tests/test_opus_padding.c tests/test_opus_common.h
112tests_test_opus_padding_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
113
114celt_tests_test_unit_cwrs32_SOURCES = celt/tests/test_unit_cwrs32.c
115celt_tests_test_unit_cwrs32_LDADD = $(LIBM)
116
117celt_tests_test_unit_dft_SOURCES = celt/tests/test_unit_dft.c
118celt_tests_test_unit_dft_LDADD = $(NE10_LIBS) $(LIBM)
119if OPUS_ARM_EXTERNAL_ASM
120celt_tests_test_unit_dft_LDADD += libarmasm.la
121endif
122
123celt_tests_test_unit_entropy_SOURCES = celt/tests/test_unit_entropy.c
124celt_tests_test_unit_entropy_LDADD = $(LIBM)
125
126celt_tests_test_unit_laplace_SOURCES = celt/tests/test_unit_laplace.c
127celt_tests_test_unit_laplace_LDADD = $(LIBM)
128
129celt_tests_test_unit_mathops_SOURCES = celt/tests/test_unit_mathops.c
130celt_tests_test_unit_mathops_LDADD = $(NE10_LIBS) $(LIBM)
131if OPUS_ARM_EXTERNAL_ASM
132celt_tests_test_unit_mathops_LDADD += libarmasm.la
133endif
134
135celt_tests_test_unit_mdct_SOURCES = celt/tests/test_unit_mdct.c
136celt_tests_test_unit_mdct_LDADD = $(NE10_LIBS) $(LIBM)
137if OPUS_ARM_EXTERNAL_ASM
138celt_tests_test_unit_mdct_LDADD += libarmasm.la
139endif
140
141celt_tests_test_unit_rotation_SOURCES = celt/tests/test_unit_rotation.c
142celt_tests_test_unit_rotation_LDADD = $(NE10_LIBS) $(LIBM)
143if OPUS_ARM_EXTERNAL_ASM
144celt_tests_test_unit_rotation_LDADD += libarmasm.la
145endif
146
147celt_tests_test_unit_types_SOURCES = celt/tests/test_unit_types.c
148celt_tests_test_unit_types_LDADD = $(LIBM)
149endif
150
151if CUSTOM_MODES
152pkginclude_HEADERS += include/opus_custom.h
153if EXTRA_PROGRAMS
154noinst_PROGRAMS += opus_custom_demo
155opus_custom_demo_SOURCES = celt/opus_custom_demo.c
156opus_custom_demo_LDADD = libopus.la $(LIBM)
157endif
158endif
159
160EXTRA_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
191pkgconfigdir = $(libdir)/pkgconfig
192pkgconfig_DATA = opus.pc
193
194m4datadir = $(datadir)/aclocal
195m4data_DATA = opus.m4
196
197# Targets to build and install just the library without the docs
198opus check-opus install-opus: export NO_DOXYGEN = 1
199
200opus: all
201check-opus: check
202install-opus: install
203
204
205# Or just the docs
206docs:
207	( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
208
209install-docs:
210	( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
211
212
213# Or everything (by default)
214all-local:
215	@[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
216
217install-data-local:
218	@[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
219
220clean-local:
221	-( cd doc && $(MAKE) $(AM_MAKEFLAGS) clean )
222
223uninstall-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
256force:
257
258# Create a minimal package_version file when make dist is run.
259dist-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
276OPT_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
281if HAVE_SSE
282SSE_OBJ = $(CELT_SOURCES_SSE:.c=.lo)
283$(SSE_OBJ) $(OPT_UNIT_TEST_OBJ): CFLAGS += $(OPUS_X86_SSE_CFLAGS)
284endif
285
286if HAVE_SSE2
287SSE2_OBJ = $(CELT_SOURCES_SSE2:.c=.lo)
288$(SSE2_OBJ) $(OPT_UNIT_TEST_OBJ): CFLAGS += $(OPUS_X86_SSE2_CFLAGS)
289endif
290
291if HAVE_SSE4_1
292SSE4_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)
296endif
297
298if HAVE_ARM_NEON_INTR
299ARM_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)
302endif
303