blob: fac7651fecef5b5e7add3f1934e089d851edf917 [file] [log] [blame]
Ron90a39032013-06-29 16:36:24 +09301# 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
Gregory Maxwell135e5d32012-04-29 20:24:36 -04005AUTOMAKE_OPTIONS = subdir-objects
Ron50b395b2013-05-20 12:31:48 +09306ACLOCAL_AMFLAGS = -I m4
Ralph Giles2852cb12011-08-02 11:43:43 -07007
Jean-Marc Valine05aaf22011-04-29 19:48:42 -04008lib_LTLIBRARIES = libopus.la
Jean-Marc Valina0cbeca2010-07-08 11:27:20 -04009
Ron9a89d562012-06-12 04:40:42 +093010DIST_SUBDIRS = doc
11
Ron64b39852013-06-29 15:40:27 +093012AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/celt -I$(top_srcdir)/silk \
13 -I$(top_srcdir)/silk/float -I$(top_srcdir)/silk/fixed
Jean-Marc Valina0cbeca2010-07-08 11:27:20 -040014
Jean-Marc Valin8e4f5a82011-04-30 00:35:55 -040015include celt_sources.mk
16include silk_sources.mk
17include opus_sources.mk
Jean-Marc Valine7a2a032011-02-14 21:18:08 -050018
Jean-Marc Valinb2c00d22011-08-02 08:13:42 -040019if FIXED_POINT
20SILK_SOURCES += $(SILK_SOURCES_FIXED)
21else
22SILK_SOURCES += $(SILK_SOURCES_FLOAT)
23endif
24
Jean-Marc Valind814c5d2013-11-04 12:26:50 -050025if DISABLE_FLOAT_API
26else
Jean-Marc Valin3ab03e02013-09-06 16:00:39 -040027OPUS_SOURCES += $(OPUS_SOURCES_FLOAT)
Jean-Marc Valind814c5d2013-11-04 12:26:50 -050028endif
Jean-Marc Valin3ab03e02013-09-06 16:00:39 -040029
Aurélien Zanellicd4c8242013-05-31 15:07:00 +020030if CPU_ARM
31CELT_SOURCES += $(CELT_SOURCES_ARM)
Timothy B. Terriberry39386e02013-11-18 13:30:13 -050032SILK_SOURCES += $(SILK_SOURCES_ARM)
33if OPUS_ARM_EXTERNAL_ASM
Ron135d1c92013-11-19 17:34:12 +103034nodist_libopus_la_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S)
Timothy B. Terriberry39386e02013-11-18 13:30:13 -050035BUILT_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
36 $(CELT_AM_SOURCES_ARM_ASM:.s.in=.s) \
Timothy B. Terriberry7a0b6822013-11-18 14:10:57 -050037 $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
Timothy B. Terriberry39386e02013-11-18 13:30:13 -050038endif
Aurélien Zanellicd4c8242013-05-31 15:07:00 +020039endif
40
Ralph Gilesd5cb0632013-11-19 17:50:05 +130041CLEANFILES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
42 $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
43
Ralph Gilescd539df2012-04-05 09:23:47 -070044include celt_headers.mk
45include silk_headers.mk
46include opus_headers.mk
Jean-Marc Valin3596fed2011-07-09 09:20:51 -040047
Jean-Marc Valin8e4f5a82011-04-30 00:35:55 -040048libopus_la_SOURCES = $(CELT_SOURCES) $(SILK_SOURCES) $(OPUS_SOURCES)
Gregory Maxwell8d2e9ad2012-08-10 17:21:28 -040049libopus_la_LDFLAGS = -no-undefined -version-info @OPUS_LT_CURRENT@:@OPUS_LT_REVISION@:@OPUS_LT_AGE@
Ron45106b72013-07-02 17:01:23 +093050libopus_la_LIBADD = $(LIBM)
Jean-Marc Valine05aaf22011-04-29 19:48:42 -040051
Jean-Marc Valin4923f3f2011-10-26 21:36:57 -040052pkginclude_HEADERS = include/opus.h include/opus_multistream.h include/opus_types.h include/opus_defines.h
Jean-Marc Valine05aaf22011-04-29 19:48:42 -040053
Jean-Marc Valin3596fed2011-07-09 09:20:51 -040054noinst_HEADERS = $(OPUS_HEAD) $(SILK_HEAD) $(CELT_HEAD)
55
Aurélien Zanellifaec6732013-05-26 22:08:02 +020056if EXTRA_PROGRAMS
Ralph Gilese7ec9332012-11-30 18:00:38 -080057noinst_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
Jean-Marc Valine05aaf22011-04-29 19:48:42 -040058
Ralph Gilese7ec9332012-11-30 18:00:38 -080059TESTS = 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
Jean-Marc Valine05aaf22011-04-29 19:48:42 -040060
Gregory Maxwella5ff49e2011-10-26 19:56:00 -040061opus_demo_SOURCES = src/opus_demo.c
62
Ron5bac4f22013-06-29 02:06:53 +093063opus_demo_LDADD = libopus.la $(LIBM)
Jean-Marc Valine8dbcb82011-08-10 09:47:30 -040064
Gregory Maxwell38805f32011-10-26 20:05:56 -040065repacketizer_demo_SOURCES = src/repacketizer_demo.c
Jean-Marc Valine8dbcb82011-08-10 09:47:30 -040066
Ron5bac4f22013-06-29 02:06:53 +093067repacketizer_demo_LDADD = libopus.la $(LIBM)
Ralph Giles9f713092011-08-28 22:32:13 +120068
Jean-Marc Valinc4ca21f2011-09-15 10:10:40 -070069opus_compare_SOURCES = src/opus_compare.c
Ron5bac4f22013-06-29 02:06:53 +093070opus_compare_LDADD = $(LIBM)
Jean-Marc Valinc4ca21f2011-09-15 10:10:40 -070071
Gregory Maxwell9652f812011-10-26 23:55:33 -040072tests_test_opus_api_SOURCES = tests/test_opus_api.c tests/test_opus_common.h
Ron5bac4f22013-06-29 02:06:53 +093073tests_test_opus_api_LDADD = libopus.la $(LIBM)
Gregory Maxwella5ff49e2011-10-26 19:56:00 -040074
Gregory Maxwell9652f812011-10-26 23:55:33 -040075tests_test_opus_encode_SOURCES = tests/test_opus_encode.c tests/test_opus_common.h
Ron5bac4f22013-06-29 02:06:53 +093076tests_test_opus_encode_LDADD = libopus.la $(LIBM)
Gregory Maxwella5ff49e2011-10-26 19:56:00 -040077
Gregory Maxwell9652f812011-10-26 23:55:33 -040078tests_test_opus_decode_SOURCES = tests/test_opus_decode.c tests/test_opus_common.h
Ron5bac4f22013-06-29 02:06:53 +093079tests_test_opus_decode_LDADD = libopus.la $(LIBM)
Gregory Maxwell9652f812011-10-26 23:55:33 -040080
Ralph Gilese7ec9332012-11-30 18:00:38 -080081tests_test_opus_padding_SOURCES = tests/test_opus_padding.c tests/test_opus_common.h
Ron5bac4f22013-06-29 02:06:53 +093082tests_test_opus_padding_LDADD = libopus.la $(LIBM)
Ralph Gilese7ec9332012-11-30 18:00:38 -080083
Gregory Maxwell9652f812011-10-26 23:55:33 -040084celt_tests_test_unit_cwrs32_SOURCES = celt/tests/test_unit_cwrs32.c
Ron5bac4f22013-06-29 02:06:53 +093085celt_tests_test_unit_cwrs32_LDADD = $(LIBM)
Gregory Maxwell9652f812011-10-26 23:55:33 -040086
87celt_tests_test_unit_dft_SOURCES = celt/tests/test_unit_dft.c
Ron5bac4f22013-06-29 02:06:53 +093088celt_tests_test_unit_dft_LDADD = $(LIBM)
Gregory Maxwell9652f812011-10-26 23:55:33 -040089
90celt_tests_test_unit_entropy_SOURCES = celt/tests/test_unit_entropy.c
Ron5bac4f22013-06-29 02:06:53 +093091celt_tests_test_unit_entropy_LDADD = $(LIBM)
Gregory Maxwell9652f812011-10-26 23:55:33 -040092
93celt_tests_test_unit_laplace_SOURCES = celt/tests/test_unit_laplace.c
Ron5bac4f22013-06-29 02:06:53 +093094celt_tests_test_unit_laplace_LDADD = $(LIBM)
Gregory Maxwell9652f812011-10-26 23:55:33 -040095
96celt_tests_test_unit_mathops_SOURCES = celt/tests/test_unit_mathops.c
Ron5bac4f22013-06-29 02:06:53 +093097celt_tests_test_unit_mathops_LDADD = $(LIBM)
Gregory Maxwell9652f812011-10-26 23:55:33 -040098
99celt_tests_test_unit_mdct_SOURCES = celt/tests/test_unit_mdct.c
Ron5bac4f22013-06-29 02:06:53 +0930100celt_tests_test_unit_mdct_LDADD = $(LIBM)
Gregory Maxwell9652f812011-10-26 23:55:33 -0400101
102celt_tests_test_unit_rotation_SOURCES = celt/tests/test_unit_rotation.c
Ron5bac4f22013-06-29 02:06:53 +0930103celt_tests_test_unit_rotation_LDADD = $(LIBM)
Gregory Maxwell9652f812011-10-26 23:55:33 -0400104
105celt_tests_test_unit_types_SOURCES = celt/tests/test_unit_types.c
Ron5bac4f22013-06-29 02:06:53 +0930106celt_tests_test_unit_types_LDADD = $(LIBM)
Aurélien Zanellifaec6732013-05-26 22:08:02 +0200107endif
Gregory Maxwella5ff49e2011-10-26 19:56:00 -0400108
Jean-Marc Valin06237d72011-09-01 13:20:40 -0400109if CUSTOM_MODES
Jean-Marc Valin4923f3f2011-10-26 21:36:57 -0400110pkginclude_HEADERS += include/opus_custom.h
Aurélien Zanellifaec6732013-05-26 22:08:02 +0200111if EXTRA_PROGRAMS
Gregory Maxwella5ff49e2011-10-26 19:56:00 -0400112noinst_PROGRAMS += opus_custom_demo
113opus_custom_demo_SOURCES = celt/opus_custom_demo.c
Ron5bac4f22013-06-29 02:06:53 +0930114opus_custom_demo_LDADD = libopus.la $(LIBM)
Jean-Marc Valin06237d72011-09-01 13:20:40 -0400115endif
Aurélien Zanellifaec6732013-05-26 22:08:02 +0200116endif
Jean-Marc Valin06237d72011-09-01 13:20:40 -0400117
Ralph Giles59c5a822012-08-16 11:39:56 -0700118EXTRA_DIST = version.mk \
Timothy B. Terriberry39386e02013-11-18 13:30:13 -0500119 opus.pc.in \
Gregory Maxwelle852c342012-08-09 07:29:58 -0400120 opus-uninstalled.pc.in \
Gregory Maxwell6e2dd162012-08-30 12:26:34 -0400121 opus.m4 \
Jean-Marc Valine91dfa02012-08-31 23:10:12 -0400122 Makefile.unix \
Gregory Maxwell1b58bc72012-08-19 16:45:20 -0400123 tests/run_vectors.sh \
Timothy B. Terriberry39386e02013-11-18 13:30:13 -0500124 celt/arm/arm2gnu.pl \
Ron135d1c92013-11-19 17:34:12 +1030125 celt/arm/celt_pitch_xcorr_arm.s \
Jean-Marc Valinaecebff2013-06-27 04:04:48 -0400126 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 \
Gregory Maxwelle852c342012-08-09 07:29:58 -0400145 win32/genversion.bat \
146 win32/config.h
Ralph Giles9f713092011-08-28 22:32:13 +1200147
148pkgconfigdir = $(libdir)/pkgconfig
149pkgconfig_DATA = opus.pc
Ronb6512b42012-05-21 23:16:39 +0930150
Gregory Maxwell6e2dd162012-08-30 12:26:34 -0400151m4datadir = $(datadir)/aclocal
152m4data_DATA = opus.m4
Ronb6512b42012-05-21 23:16:39 +0930153
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:
Ronb371cf82012-10-18 14:05:55 +1030164 ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
Ronb6512b42012-05-21 23:16:39 +0930165
166install-docs:
Ronb371cf82012-10-18 14:05:55 +1030167 ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
Ronb6512b42012-05-21 23:16:39 +0930168
169
170# Or everything (by default)
171all-local:
Ronb371cf82012-10-18 14:05:55 +1030172 @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
Ronb6512b42012-05-21 23:16:39 +0930173
174install-data-local:
Ronb371cf82012-10-18 14:05:55 +1030175 @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
Ronb6512b42012-05-21 23:16:39 +0930176
177clean-local:
Ronb371cf82012-10-18 14:05:55 +1030178 -( cd doc && $(MAKE) $(AM_MAKEFLAGS) clean )
Ronb6512b42012-05-21 23:16:39 +0930179
180uninstall-local:
Ronb371cf82012-10-18 14:05:55 +1030181 ( cd doc && $(MAKE) $(AM_MAKEFLAGS) uninstall )
Ronb6512b42012-05-21 23:16:39 +0930182
183
Ron2f2f9d62013-05-11 02:05:24 +0930184# 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 \
Ron8d925ec2013-05-11 07:33:03 +0930205 if [ ! -e $(top_srcdir)/package_version ]; then \
206 echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
207 fi; \
Ron2f2f9d62013-05-11 02:05:24 +0930208 . $(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
Ronb6512b42012-05-21 23:16:39 +0930220.PHONY: opus check-opus install-opus docs install-docs
Timothy B. Terriberry39386e02013-11-18 13:30:13 -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
Martin Storsjo76e831d2014-03-19 21:36:39 +0200228 $(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
Timothy B. Terriberry39386e02013-11-18 13:30:13 -0500229# For autoconf-modified sources (e.g., armopts.s)
230%-gnu.S: %.s
Timothy B. Terriberry4ae4bc62014-03-26 12:58:04 -0700231 $(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@