oggopus: bump draft date and version for 06 publication.
[opus.git] / Makefile.am
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+).
3 export VERBOSE = yes
4
5 AUTOMAKE_OPTIONS = subdir-objects
6 ACLOCAL_AMFLAGS = -I m4
7
8 lib_LTLIBRARIES = libopus.la
9
10 DIST_SUBDIRS = doc
11
12 AM_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
15 include celt_sources.mk
16 include silk_sources.mk
17 include opus_sources.mk
18
19 if FIXED_POINT
20 SILK_SOURCES += $(SILK_SOURCES_FIXED)
21 if HAVE_SSE4_1
22 SILK_SOURCES += $(SILK_SOURCES_SSE4_1) $(SILK_SOURCES_FIXED_SSE4_1)
23 endif
24 else
25 SILK_SOURCES += $(SILK_SOURCES_FLOAT)
26 endif
27
28 if DISABLE_FLOAT_API
29 else
30 OPUS_SOURCES += $(OPUS_SOURCES_FLOAT)
31 endif
32
33 if HAVE_SSE4_1
34 CELT_SOURCES += $(CELT_SOURCES_SSE) $(CELT_SOURCES_SSE4_1)
35 else
36 if HAVE_SSE2
37 CELT_SOURCES += $(CELT_SOURCES_SSE)
38 endif
39 endif
40
41 if CPU_ARM
42 CELT_SOURCES += $(CELT_SOURCES_ARM)
43 SILK_SOURCES += $(SILK_SOURCES_ARM)
44 if OPUS_ARM_EXTERNAL_ASM
45 nodist_libopus_la_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S)
46 BUILT_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
47  $(CELT_AM_SOURCES_ARM_ASM:.s.in=.s) \
48  $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
49 endif
50 endif
51
52 CLEANFILES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
53  $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
54
55 include celt_headers.mk
56 include silk_headers.mk
57 include opus_headers.mk
58
59 libopus_la_SOURCES = $(CELT_SOURCES) $(SILK_SOURCES) $(OPUS_SOURCES)
60 libopus_la_LDFLAGS = -no-undefined -version-info @OPUS_LT_CURRENT@:@OPUS_LT_REVISION@:@OPUS_LT_AGE@
61 libopus_la_LIBADD = $(LIBM)
62
63 pkginclude_HEADERS = include/opus.h include/opus_multistream.h include/opus_types.h include/opus_defines.h
64
65 noinst_HEADERS = $(OPUS_HEAD) $(SILK_HEAD) $(CELT_HEAD)
66
67 if EXTRA_PROGRAMS
68 noinst_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
69
70 TESTS = 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
71
72 opus_demo_SOURCES = src/opus_demo.c
73
74 opus_demo_LDADD = libopus.la $(LIBM)
75
76 repacketizer_demo_SOURCES = src/repacketizer_demo.c
77
78 repacketizer_demo_LDADD = libopus.la $(LIBM)
79
80 opus_compare_SOURCES = src/opus_compare.c
81 opus_compare_LDADD = $(LIBM)
82
83 tests_test_opus_api_SOURCES = tests/test_opus_api.c tests/test_opus_common.h
84 tests_test_opus_api_LDADD = libopus.la $(LIBM)
85
86 tests_test_opus_encode_SOURCES = tests/test_opus_encode.c tests/test_opus_common.h
87 tests_test_opus_encode_LDADD = libopus.la $(LIBM)
88
89 tests_test_opus_decode_SOURCES = tests/test_opus_decode.c tests/test_opus_common.h
90 tests_test_opus_decode_LDADD = libopus.la $(LIBM)
91
92 tests_test_opus_padding_SOURCES = tests/test_opus_padding.c tests/test_opus_common.h
93 tests_test_opus_padding_LDADD = libopus.la $(LIBM)
94
95 celt_tests_test_unit_cwrs32_SOURCES = celt/tests/test_unit_cwrs32.c
96 celt_tests_test_unit_cwrs32_LDADD = $(LIBM)
97
98 celt_tests_test_unit_dft_SOURCES = celt/tests/test_unit_dft.c
99 celt_tests_test_unit_dft_LDADD = $(LIBM)
100
101 celt_tests_test_unit_entropy_SOURCES = celt/tests/test_unit_entropy.c
102 celt_tests_test_unit_entropy_LDADD = $(LIBM)
103
104 celt_tests_test_unit_laplace_SOURCES = celt/tests/test_unit_laplace.c
105 celt_tests_test_unit_laplace_LDADD = $(LIBM)
106
107 celt_tests_test_unit_mathops_SOURCES = celt/tests/test_unit_mathops.c
108 celt_tests_test_unit_mathops_LDADD = $(LIBM)
109 if CPU_ARM
110 if OPUS_ARM_EXTERNAL_ASM
111 celt_tests_test_unit_mathops_LDADD += libopus.la
112 endif
113 endif
114
115 celt_tests_test_unit_mdct_SOURCES = celt/tests/test_unit_mdct.c
116 celt_tests_test_unit_mdct_LDADD = $(LIBM)
117
118 celt_tests_test_unit_rotation_SOURCES = celt/tests/test_unit_rotation.c
119 celt_tests_test_unit_rotation_LDADD = $(LIBM)
120 if CPU_ARM
121 if OPUS_ARM_EXTERNAL_ASM
122 celt_tests_test_unit_rotation_LDADD += libopus.la
123 endif
124 endif
125
126 celt_tests_test_unit_types_SOURCES = celt/tests/test_unit_types.c
127 celt_tests_test_unit_types_LDADD = $(LIBM)
128 endif
129
130 if CUSTOM_MODES
131 pkginclude_HEADERS += include/opus_custom.h
132 if EXTRA_PROGRAMS
133 noinst_PROGRAMS += opus_custom_demo
134 opus_custom_demo_SOURCES = celt/opus_custom_demo.c
135 opus_custom_demo_LDADD = libopus.la $(LIBM)
136 endif
137 endif
138
139 EXTRA_DIST = version.mk \
140              opus.pc.in \
141              opus-uninstalled.pc.in \
142              opus.m4 \
143              Makefile.unix \
144              tests/run_vectors.sh \
145              celt/arm/arm2gnu.pl \
146              celt/arm/celt_pitch_xcorr_arm.s \
147              win32/VS2010/silk_float.vcxproj \
148              win32/VS2010/celt.vcxproj.filters \
149              win32/VS2010/opus.vcxproj \
150              win32/VS2010/silk_common.vcxproj.filters \
151              win32/VS2010/silk_float.vcxproj.filters \
152              win32/VS2010/test_opus_encode.vcxproj.filters \
153              win32/VS2010/silk_common.vcxproj \
154              win32/VS2010/test_opus_encode.vcxproj \
155              win32/VS2010/opus_demo.vcxproj \
156              win32/VS2010/test_opus_api.vcxproj.filters \
157              win32/VS2010/test_opus_api.vcxproj \
158              win32/VS2010/test_opus_decode.vcxproj.filters \
159              win32/VS2010/silk_fixed.vcxproj.filters \
160              win32/VS2010/opus_demo.vcxproj.filters \
161              win32/VS2010/silk_fixed.vcxproj \
162              win32/VS2010/opus.vcxproj.filters \
163              win32/VS2010/test_opus_decode.vcxproj \
164              win32/VS2010/celt.vcxproj \
165              win32/VS2010/opus.sln \
166              win32/genversion.bat \
167              win32/config.h
168
169 pkgconfigdir = $(libdir)/pkgconfig
170 pkgconfig_DATA = opus.pc
171
172 m4datadir = $(datadir)/aclocal
173 m4data_DATA = opus.m4
174
175 # Targets to build and install just the library without the docs
176 opus check-opus install-opus: export NO_DOXYGEN = 1
177
178 opus: all
179 check-opus: check
180 install-opus: install
181
182
183 # Or just the docs
184 docs:
185         ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
186
187 install-docs:
188         ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
189
190
191 # Or everything (by default)
192 all-local:
193         @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
194
195 install-data-local:
196         @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
197
198 clean-local:
199         -( cd doc && $(MAKE) $(AM_MAKEFLAGS) clean )
200
201 uninstall-local:
202         ( cd doc && $(MAKE) $(AM_MAKEFLAGS) uninstall )
203
204
205 # We check this every time make is run, with configure.ac being touched to
206 # trigger an update of the build system files if update_version changes the
207 # current PACKAGE_VERSION (or if package_version was modified manually by a
208 # user with either AUTO_UPDATE=no or no update_version script present - the
209 # latter being the normal case for tarball releases).
210 #
211 # We can't just add the package_version file to CONFIGURE_DEPENDENCIES since
212 # simply running autoconf will not actually regenerate configure for us when
213 # the content of that file changes (due to autoconf dependency checking not
214 # knowing about that without us creating yet another file for it to include).
215 #
216 # The MAKECMDGOALS check is a gnu-make'ism, but will degrade 'gracefully' for
217 # makes that don't support it.  The only loss of functionality is not forcing
218 # an update of package_version for `make dist` if AUTO_UPDATE=no, but that is
219 # unlikely to be a real problem for any real user.
220 $(top_srcdir)/configure.ac: force
221         @case "$(MAKECMDGOALS)" in \
222             dist-hook)                             exit 0       ;; \
223             dist-* | dist | distcheck | distclean) _arg=release ;; \
224         esac; \
225         if ! $(top_srcdir)/update_version $$_arg 2> /dev/null; then \
226             if [ ! -e $(top_srcdir)/package_version ]; then \
227                 echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
228             fi; \
229             . $(top_srcdir)/package_version || exit 1; \
230             [ "$(PACKAGE_VERSION)" != "$$PACKAGE_VERSION" ] || exit 0; \
231         fi; \
232         touch $@
233
234 force:
235
236 # Create a minimal package_version file when make dist is run.
237 dist-hook:
238         echo 'PACKAGE_VERSION="$(PACKAGE_VERSION)"' > $(top_distdir)/package_version
239
240
241 .PHONY: opus check-opus install-opus docs install-docs
242
243 # automake doesn't do dependency tracking for asm files, that I can tell
244 $(CELT_SOURCES_ARM_ASM:%.s=%-gnu.S): celt/arm/armopts-gnu.S
245 $(CELT_SOURCES_ARM_ASM:%.s=%-gnu.S): $(top_srcdir)/celt/arm/arm2gnu.pl
246
247 # convert ARM asm to GNU as format
248 %-gnu.S: $(top_srcdir)/%.s
249         $(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
250 # For autoconf-modified sources (e.g., armopts.s)
251 %-gnu.S: %.s
252         $(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
253
254 SSE_OBJ = %_sse.o %_sse.lo %test_unit_mathops.o %test_unit_rotation.o
255
256 if HAVE_SSE4_1
257 $(SSE_OBJ): CFLAGS += -msse4.1
258 else
259 if HAVE_SSE2
260 $(SSE_OBJ): CFLAGS += -msse2
261 endif
262 endif