blob: c39d8031da7c0593e9442a8bc22f25b23b0d58c1 [file] [log] [blame]
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +00001# 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
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +00005AUTOMAKE_OPTIONS = subdir-objects
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +00006ACLOCAL_AMFLAGS = -I m4
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +00007
8lib_LTLIBRARIES = libopus.la
9
10DIST_SUBDIRS = doc
11
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000012AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/celt -I$(top_srcdir)/silk \
13 -I$(top_srcdir)/silk/float -I$(top_srcdir)/silk/fixed
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000014
15include celt_sources.mk
16include silk_sources.mk
17include opus_sources.mk
18
19if FIXED_POINT
20SILK_SOURCES += $(SILK_SOURCES_FIXED)
21else
22SILK_SOURCES += $(SILK_SOURCES_FLOAT)
23endif
24
tlegrand@google.com3c3902f2013-12-09 08:35:25 +000025if DISABLE_FLOAT_API
26else
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000027OPUS_SOURCES += $(OPUS_SOURCES_FLOAT)
tlegrand@google.com3c3902f2013-12-09 08:35:25 +000028endif
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000029
30if CPU_ARM
31CELT_SOURCES += $(CELT_SOURCES_ARM)
tlegrand@google.com3c3902f2013-12-09 08:35:25 +000032SILK_SOURCES += $(SILK_SOURCES_ARM)
33if OPUS_ARM_EXTERNAL_ASM
34nodist_libopus_la_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S)
35BUILT_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
36 $(CELT_AM_SOURCES_ARM_ASM:.s.in=.s) \
37 $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000038endif
tlegrand@google.com3c3902f2013-12-09 08:35:25 +000039endif
40
41CLEANFILES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
42 $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000043
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000044include celt_headers.mk
45include silk_headers.mk
46include opus_headers.mk
47
48libopus_la_SOURCES = $(CELT_SOURCES) $(SILK_SOURCES) $(OPUS_SOURCES)
49libopus_la_LDFLAGS = -no-undefined -version-info @OPUS_LT_CURRENT@:@OPUS_LT_REVISION@:@OPUS_LT_AGE@
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000050libopus_la_LIBADD = $(LIBM)
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000051
52pkginclude_HEADERS = include/opus.h include/opus_multistream.h include/opus_types.h include/opus_defines.h
53
54noinst_HEADERS = $(OPUS_HEAD) $(SILK_HEAD) $(CELT_HEAD)
55
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000056if EXTRA_PROGRAMS
57noinst_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
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000058
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000059TESTS = 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
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000060
61opus_demo_SOURCES = src/opus_demo.c
62
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000063opus_demo_LDADD = libopus.la $(LIBM)
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000064
65repacketizer_demo_SOURCES = src/repacketizer_demo.c
66
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000067repacketizer_demo_LDADD = libopus.la $(LIBM)
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000068
69opus_compare_SOURCES = src/opus_compare.c
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000070opus_compare_LDADD = $(LIBM)
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000071
72tests_test_opus_api_SOURCES = tests/test_opus_api.c tests/test_opus_common.h
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000073tests_test_opus_api_LDADD = libopus.la $(LIBM)
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000074
75tests_test_opus_encode_SOURCES = tests/test_opus_encode.c tests/test_opus_common.h
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000076tests_test_opus_encode_LDADD = libopus.la $(LIBM)
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000077
78tests_test_opus_decode_SOURCES = tests/test_opus_decode.c tests/test_opus_common.h
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000079tests_test_opus_decode_LDADD = libopus.la $(LIBM)
80
81tests_test_opus_padding_SOURCES = tests/test_opus_padding.c tests/test_opus_common.h
82tests_test_opus_padding_LDADD = libopus.la $(LIBM)
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000083
84celt_tests_test_unit_cwrs32_SOURCES = celt/tests/test_unit_cwrs32.c
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000085celt_tests_test_unit_cwrs32_LDADD = $(LIBM)
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000086
87celt_tests_test_unit_dft_SOURCES = celt/tests/test_unit_dft.c
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000088celt_tests_test_unit_dft_LDADD = $(LIBM)
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000089
90celt_tests_test_unit_entropy_SOURCES = celt/tests/test_unit_entropy.c
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000091celt_tests_test_unit_entropy_LDADD = $(LIBM)
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000092
93celt_tests_test_unit_laplace_SOURCES = celt/tests/test_unit_laplace.c
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000094celt_tests_test_unit_laplace_LDADD = $(LIBM)
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000095
96celt_tests_test_unit_mathops_SOURCES = celt/tests/test_unit_mathops.c
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +000097celt_tests_test_unit_mathops_LDADD = $(LIBM)
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +000098
99celt_tests_test_unit_mdct_SOURCES = celt/tests/test_unit_mdct.c
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +0000100celt_tests_test_unit_mdct_LDADD = $(LIBM)
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +0000101
102celt_tests_test_unit_rotation_SOURCES = celt/tests/test_unit_rotation.c
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +0000103celt_tests_test_unit_rotation_LDADD = $(LIBM)
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +0000104
105celt_tests_test_unit_types_SOURCES = celt/tests/test_unit_types.c
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +0000106celt_tests_test_unit_types_LDADD = $(LIBM)
107endif
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +0000108
109if CUSTOM_MODES
110pkginclude_HEADERS += include/opus_custom.h
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +0000111if EXTRA_PROGRAMS
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +0000112noinst_PROGRAMS += opus_custom_demo
113opus_custom_demo_SOURCES = celt/opus_custom_demo.c
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +0000114opus_custom_demo_LDADD = libopus.la $(LIBM)
115endif
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +0000116endif
117
118EXTRA_DIST = version.mk \
tlegrand@google.com3c3902f2013-12-09 08:35:25 +0000119 opus.pc.in \
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +0000120 opus-uninstalled.pc.in \
121 opus.m4 \
122 Makefile.unix \
123 tests/run_vectors.sh \
tlegrand@google.com3c3902f2013-12-09 08:35:25 +0000124 celt/arm/arm2gnu.pl \
125 celt/arm/celt_pitch_xcorr_arm.s \
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +0000126 win32/VS2010/silk_float.vcxproj \
127 win32/VS2010/celt.vcxproj.filters \
128 win32/VS2010/opus.vcxproj \
129 win32/VS2010/silk_common.vcxproj.filters \
130 win32/VS2010/silk_float.vcxproj.filters \
131 win32/VS2010/test_opus_encode.vcxproj.filters \
132 win32/VS2010/silk_common.vcxproj \
133 win32/VS2010/test_opus_encode.vcxproj \
134 win32/VS2010/opus_demo.vcxproj \
135 win32/VS2010/test_opus_api.vcxproj.filters \
136 win32/VS2010/test_opus_api.vcxproj \
137 win32/VS2010/test_opus_decode.vcxproj.filters \
138 win32/VS2010/silk_fixed.vcxproj.filters \
139 win32/VS2010/opus_demo.vcxproj.filters \
140 win32/VS2010/silk_fixed.vcxproj \
141 win32/VS2010/opus.vcxproj.filters \
142 win32/VS2010/test_opus_decode.vcxproj \
143 win32/VS2010/celt.vcxproj \
144 win32/VS2010/opus.sln \
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +0000145 win32/genversion.bat \
146 win32/config.h
147
148pkgconfigdir = $(libdir)/pkgconfig
149pkgconfig_DATA = opus.pc
150
151m4datadir = $(datadir)/aclocal
152m4data_DATA = opus.m4
153
154# Targets to build and install just the library without the docs
155opus check-opus install-opus: export NO_DOXYGEN = 1
156
157opus: all
158check-opus: check
159install-opus: install
160
161
162# Or just the docs
163docs:
sergeyu@chromium.org6b6bee22013-02-28 21:17:26 +0000164 ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +0000165
166install-docs:
sergeyu@chromium.org6b6bee22013-02-28 21:17:26 +0000167 ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +0000168
169
170# Or everything (by default)
171all-local:
sergeyu@chromium.org6b6bee22013-02-28 21:17:26 +0000172 @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +0000173
174install-data-local:
sergeyu@chromium.org6b6bee22013-02-28 21:17:26 +0000175 @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +0000176
177clean-local:
sergeyu@chromium.org6b6bee22013-02-28 21:17:26 +0000178 -( cd doc && $(MAKE) $(AM_MAKEFLAGS) clean )
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +0000179
180uninstall-local:
sergeyu@chromium.org6b6bee22013-02-28 21:17:26 +0000181 ( cd doc && $(MAKE) $(AM_MAKEFLAGS) uninstall )
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +0000182
183
tlegrand@chromium.orge3ea0492013-10-23 09:13:50 +0000184# We check this every time make is run, with configure.ac being touched to
185# trigger an update of the build system files if update_version changes the
186# current PACKAGE_VERSION (or if package_version was modified manually by a
187# user with either AUTO_UPDATE=no or no update_version script present - the
188# latter being the normal case for tarball releases).
189#
190# We can't just add the package_version file to CONFIGURE_DEPENDENCIES since
191# simply running autoconf will not actually regenerate configure for us when
192# the content of that file changes (due to autoconf dependency checking not
193# knowing about that without us creating yet another file for it to include).
194#
195# The MAKECMDGOALS check is a gnu-make'ism, but will degrade 'gracefully' for
196# makes that don't support it. The only loss of functionality is not forcing
197# an update of package_version for `make dist` if AUTO_UPDATE=no, but that is
198# unlikely to be a real problem for any real user.
199$(top_srcdir)/configure.ac: force
200 @case "$(MAKECMDGOALS)" in \
201 dist-hook) exit 0 ;; \
202 dist-* | dist | distcheck | distclean) _arg=release ;; \
203 esac; \
204 if ! $(top_srcdir)/update_version $$_arg 2> /dev/null; then \
205 if [ ! -e $(top_srcdir)/package_version ]; then \
206 echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
207 fi; \
208 . $(top_srcdir)/package_version || exit 1; \
209 [ "$(PACKAGE_VERSION)" != "$$PACKAGE_VERSION" ] || exit 0; \
210 fi; \
211 touch $@
212
213force:
214
215# Create a minimal package_version file when make dist is run.
216dist-hook:
217 echo 'PACKAGE_VERSION="$(PACKAGE_VERSION)"' > $(top_distdir)/package_version
218
219
sergeyu@chromium.org885f2ff2012-10-17 22:31:52 +0000220.PHONY: opus check-opus install-opus docs install-docs
tlegrand@google.com3c3902f2013-12-09 08:35:25 +0000221
222# automake doesn't do dependency tracking for asm files, that I can tell
223$(CELT_SOURCES_ARM_ASM:%.s=%-gnu.S): celt/arm/armopts-gnu.S
224$(CELT_SOURCES_ARM_ASM:%.s=%-gnu.S): $(top_srcdir)/celt/arm/arm2gnu.pl
225
226# convert ARM asm to GNU as format
227%-gnu.S: $(top_srcdir)/%.s
228 $(top_srcdir)/celt/arm/arm2gnu.pl < $< > $@
229# For autoconf-modified sources (e.g., armopts.s)
230%-gnu.S: %.s
231 $(top_srcdir)/celt/arm/arm2gnu.pl < $< > $@