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
14
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
25if 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
44include 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@
50libopus_la_LIBADD = $(LIBM)
51
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
56if 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
58
59TESTS = 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
60
61opus_demo_SOURCES = src/opus_demo.c
62
63opus_demo_LDADD = libopus.la $(LIBM)
64
65repacketizer_demo_SOURCES = src/repacketizer_demo.c
66
67repacketizer_demo_LDADD = libopus.la $(LIBM)
68
69opus_compare_SOURCES = src/opus_compare.c
70opus_compare_LDADD = $(LIBM)
71
72tests_test_opus_api_SOURCES = tests/test_opus_api.c tests/test_opus_common.h
73tests_test_opus_api_LDADD = libopus.la $(LIBM)
74
75tests_test_opus_encode_SOURCES = tests/test_opus_encode.c tests/test_opus_common.h
76tests_test_opus_encode_LDADD = libopus.la $(LIBM)
77
78tests_test_opus_decode_SOURCES = tests/test_opus_decode.c tests/test_opus_common.h
79tests_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)
83
84celt_tests_test_unit_cwrs32_SOURCES = celt/tests/test_unit_cwrs32.c
85celt_tests_test_unit_cwrs32_LDADD = $(LIBM)
86
87celt_tests_test_unit_dft_SOURCES = celt/tests/test_unit_dft.c
88celt_tests_test_unit_dft_LDADD = $(LIBM)
89
90celt_tests_test_unit_entropy_SOURCES = celt/tests/test_unit_entropy.c
91celt_tests_test_unit_entropy_LDADD = $(LIBM)
92
93celt_tests_test_unit_laplace_SOURCES = celt/tests/test_unit_laplace.c
94celt_tests_test_unit_laplace_LDADD = $(LIBM)
95
96celt_tests_test_unit_mathops_SOURCES = celt/tests/test_unit_mathops.c
97celt_tests_test_unit_mathops_LDADD = $(LIBM)
98
99celt_tests_test_unit_mdct_SOURCES = celt/tests/test_unit_mdct.c
100celt_tests_test_unit_mdct_LDADD = $(LIBM)
101
102celt_tests_test_unit_rotation_SOURCES = celt/tests/test_unit_rotation.c
103celt_tests_test_unit_rotation_LDADD = $(LIBM)
104
105celt_tests_test_unit_types_SOURCES = celt/tests/test_unit_types.c
106celt_tests_test_unit_types_LDADD = $(LIBM)
107endif
108
109if CUSTOM_MODES
110pkginclude_HEADERS += include/opus_custom.h
111if EXTRA_PROGRAMS
112noinst_PROGRAMS += opus_custom_demo
113opus_custom_demo_SOURCES = celt/opus_custom_demo.c
114opus_custom_demo_LDADD = libopus.la $(LIBM)
115endif
116endif
117
118EXTRA_DIST = version.mk \
119             opus.pc.in \
120             opus-uninstalled.pc.in \
121             opus.m4 \
122             Makefile.unix \
123             tests/run_vectors.sh \
124             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 \
145             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
221
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 < $< > $@
232