blob: c39d8031da7c0593e9442a8bc22f25b23b0d58c1 [file] [log] [blame]
Alexandre Lision85382382014-01-27 15:54:16 -05001# 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
Alexandre Lision744f7422013-09-25 11:39:37 -04005AUTOMAKE_OPTIONS = subdir-objects
Alexandre Lision85382382014-01-27 15:54:16 -05006ACLOCAL_AMFLAGS = -I m4
Alexandre Lision744f7422013-09-25 11:39:37 -04007
8lib_LTLIBRARIES = libopus.la
9
10DIST_SUBDIRS = doc
11
Alexandre Lision85382382014-01-27 15:54:16 -050012AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/celt -I$(top_srcdir)/silk \
13 -I$(top_srcdir)/silk/float -I$(top_srcdir)/silk/fixed
Alexandre Lision744f7422013-09-25 11:39:37 -040014
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
Alexandre Lision85382382014-01-27 15:54:16 -050025if DISABLE_FLOAT_API
26else
27OPUS_SOURCES += $(OPUS_SOURCES_FLOAT)
28endif
29
30if CPU_ARM
31CELT_SOURCES += $(CELT_SOURCES_ARM)
32SILK_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)
38endif
39endif
40
41CLEANFILES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
42 $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
43
Alexandre Lision744f7422013-09-25 11:39:37 -040044include 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@
Alexandre Lision85382382014-01-27 15:54:16 -050050libopus_la_LIBADD = $(LIBM)
Alexandre Lision744f7422013-09-25 11:39:37 -040051
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
Alexandre Lision85382382014-01-27 15:54:16 -050056if 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
Alexandre Lision744f7422013-09-25 11:39:37 -040058
Alexandre Lision85382382014-01-27 15:54:16 -050059TESTS = 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
Alexandre Lision744f7422013-09-25 11:39:37 -040060
61opus_demo_SOURCES = src/opus_demo.c
62
Alexandre Lision85382382014-01-27 15:54:16 -050063opus_demo_LDADD = libopus.la $(LIBM)
Alexandre Lision744f7422013-09-25 11:39:37 -040064
65repacketizer_demo_SOURCES = src/repacketizer_demo.c
66
Alexandre Lision85382382014-01-27 15:54:16 -050067repacketizer_demo_LDADD = libopus.la $(LIBM)
Alexandre Lision744f7422013-09-25 11:39:37 -040068
69opus_compare_SOURCES = src/opus_compare.c
Alexandre Lision85382382014-01-27 15:54:16 -050070opus_compare_LDADD = $(LIBM)
Alexandre Lision744f7422013-09-25 11:39:37 -040071
72tests_test_opus_api_SOURCES = tests/test_opus_api.c tests/test_opus_common.h
Alexandre Lision85382382014-01-27 15:54:16 -050073tests_test_opus_api_LDADD = libopus.la $(LIBM)
Alexandre Lision744f7422013-09-25 11:39:37 -040074
75tests_test_opus_encode_SOURCES = tests/test_opus_encode.c tests/test_opus_common.h
Alexandre Lision85382382014-01-27 15:54:16 -050076tests_test_opus_encode_LDADD = libopus.la $(LIBM)
Alexandre Lision744f7422013-09-25 11:39:37 -040077
78tests_test_opus_decode_SOURCES = tests/test_opus_decode.c tests/test_opus_common.h
Alexandre Lision85382382014-01-27 15:54:16 -050079tests_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)
Alexandre Lision744f7422013-09-25 11:39:37 -040083
84celt_tests_test_unit_cwrs32_SOURCES = celt/tests/test_unit_cwrs32.c
Alexandre Lision85382382014-01-27 15:54:16 -050085celt_tests_test_unit_cwrs32_LDADD = $(LIBM)
Alexandre Lision744f7422013-09-25 11:39:37 -040086
87celt_tests_test_unit_dft_SOURCES = celt/tests/test_unit_dft.c
Alexandre Lision85382382014-01-27 15:54:16 -050088celt_tests_test_unit_dft_LDADD = $(LIBM)
Alexandre Lision744f7422013-09-25 11:39:37 -040089
90celt_tests_test_unit_entropy_SOURCES = celt/tests/test_unit_entropy.c
Alexandre Lision85382382014-01-27 15:54:16 -050091celt_tests_test_unit_entropy_LDADD = $(LIBM)
Alexandre Lision744f7422013-09-25 11:39:37 -040092
93celt_tests_test_unit_laplace_SOURCES = celt/tests/test_unit_laplace.c
Alexandre Lision85382382014-01-27 15:54:16 -050094celt_tests_test_unit_laplace_LDADD = $(LIBM)
Alexandre Lision744f7422013-09-25 11:39:37 -040095
96celt_tests_test_unit_mathops_SOURCES = celt/tests/test_unit_mathops.c
Alexandre Lision85382382014-01-27 15:54:16 -050097celt_tests_test_unit_mathops_LDADD = $(LIBM)
Alexandre Lision744f7422013-09-25 11:39:37 -040098
99celt_tests_test_unit_mdct_SOURCES = celt/tests/test_unit_mdct.c
Alexandre Lision85382382014-01-27 15:54:16 -0500100celt_tests_test_unit_mdct_LDADD = $(LIBM)
Alexandre Lision744f7422013-09-25 11:39:37 -0400101
102celt_tests_test_unit_rotation_SOURCES = celt/tests/test_unit_rotation.c
Alexandre Lision85382382014-01-27 15:54:16 -0500103celt_tests_test_unit_rotation_LDADD = $(LIBM)
Alexandre Lision744f7422013-09-25 11:39:37 -0400104
105celt_tests_test_unit_types_SOURCES = celt/tests/test_unit_types.c
Alexandre Lision85382382014-01-27 15:54:16 -0500106celt_tests_test_unit_types_LDADD = $(LIBM)
107endif
Alexandre Lision744f7422013-09-25 11:39:37 -0400108
109if CUSTOM_MODES
110pkginclude_HEADERS += include/opus_custom.h
Alexandre Lision85382382014-01-27 15:54:16 -0500111if EXTRA_PROGRAMS
Alexandre Lision744f7422013-09-25 11:39:37 -0400112noinst_PROGRAMS += opus_custom_demo
113opus_custom_demo_SOURCES = celt/opus_custom_demo.c
Alexandre Lision85382382014-01-27 15:54:16 -0500114opus_custom_demo_LDADD = libopus.la $(LIBM)
115endif
Alexandre Lision744f7422013-09-25 11:39:37 -0400116endif
117
118EXTRA_DIST = version.mk \
Alexandre Lision85382382014-01-27 15:54:16 -0500119 opus.pc.in \
Alexandre Lision744f7422013-09-25 11:39:37 -0400120 opus-uninstalled.pc.in \
121 opus.m4 \
122 Makefile.unix \
123 tests/run_vectors.sh \
Alexandre Lision85382382014-01-27 15:54:16 -0500124 celt/arm/arm2gnu.pl \
125 celt/arm/celt_pitch_xcorr_arm.s \
126 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 \
Alexandre Lision744f7422013-09-25 11:39:37 -0400145 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:
164 ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
165
166install-docs:
167 ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
168
169
170# Or everything (by default)
171all-local:
172 @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
173
174install-data-local:
175 @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
176
177clean-local:
178 -( cd doc && $(MAKE) $(AM_MAKEFLAGS) clean )
179
180uninstall-local:
181 ( cd doc && $(MAKE) $(AM_MAKEFLAGS) uninstall )
182
183
184# 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
220.PHONY: opus check-opus install-opus docs install-docs
Alexandre Lision85382382014-01-27 15:54:16 -0500221
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 < $< > $@