b128541f7da9f7d50c983a033ec893de64c8ade5
[opus.git] / Makefile.am
1 AUTOMAKE_OPTIONS = subdir-objects
2
3 lib_LTLIBRARIES = libopus.la
4
5 DIST_SUBDIRS = doc
6
7 INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/celt -I$(top_srcdir)/silk -I$(top_srcdir)/silk/float -I$(top_srcdir)/silk/fixed
8
9 include celt_sources.mk
10 include silk_sources.mk
11 include opus_sources.mk
12
13 if FIXED_POINT
14 SILK_SOURCES += $(SILK_SOURCES_FIXED)
15 else
16 SILK_SOURCES += $(SILK_SOURCES_FLOAT)
17 OPUS_SOURCES += $(OPUS_SOURCES_FLOAT)
18 endif
19
20 include celt_headers.mk
21 include silk_headers.mk
22 include opus_headers.mk
23
24 libopus_la_SOURCES = $(CELT_SOURCES) $(SILK_SOURCES) $(OPUS_SOURCES)
25 libopus_la_LDFLAGS = -no-undefined -version-info @OPUS_LT_CURRENT@:@OPUS_LT_REVISION@:@OPUS_LT_AGE@
26
27 pkginclude_HEADERS = include/opus.h include/opus_multistream.h include/opus_types.h include/opus_defines.h
28
29 noinst_HEADERS = $(OPUS_HEAD) $(SILK_HEAD) $(CELT_HEAD)
30
31 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
32
33 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
34
35 opus_demo_SOURCES = src/opus_demo.c
36
37 opus_demo_LDADD = libopus.la -lm
38
39 repacketizer_demo_SOURCES = src/repacketizer_demo.c
40
41 repacketizer_demo_LDADD = libopus.la -lm
42
43 opus_compare_SOURCES = src/opus_compare.c
44 opus_compare_LDADD = -lm
45
46 tests_test_opus_api_SOURCES = tests/test_opus_api.c tests/test_opus_common.h
47 tests_test_opus_api_LDADD = libopus.la -lm
48
49 tests_test_opus_encode_SOURCES = tests/test_opus_encode.c tests/test_opus_common.h
50 tests_test_opus_encode_LDADD = libopus.la -lm
51
52 tests_test_opus_decode_SOURCES = tests/test_opus_decode.c tests/test_opus_common.h
53 tests_test_opus_decode_LDADD = libopus.la -lm
54
55 tests_test_opus_padding_SOURCES = tests/test_opus_padding.c tests/test_opus_common.h
56 tests_test_opus_padding_LDADD = libopus.la -lm
57
58 celt_tests_test_unit_cwrs32_SOURCES = celt/tests/test_unit_cwrs32.c
59 celt_tests_test_unit_cwrs32_LDADD = -lm
60
61 celt_tests_test_unit_dft_SOURCES = celt/tests/test_unit_dft.c
62 celt_tests_test_unit_dft_LDADD = -lm
63
64 celt_tests_test_unit_entropy_SOURCES = celt/tests/test_unit_entropy.c
65 celt_tests_test_unit_entropy_LDADD = -lm
66
67 celt_tests_test_unit_laplace_SOURCES = celt/tests/test_unit_laplace.c
68 celt_tests_test_unit_laplace_LDADD = -lm
69
70 celt_tests_test_unit_mathops_SOURCES = celt/tests/test_unit_mathops.c
71 celt_tests_test_unit_mathops_LDADD = -lm
72
73 celt_tests_test_unit_mdct_SOURCES = celt/tests/test_unit_mdct.c
74 celt_tests_test_unit_mdct_LDADD = -lm
75
76 celt_tests_test_unit_rotation_SOURCES = celt/tests/test_unit_rotation.c
77 celt_tests_test_unit_rotation_LDADD = -lm
78
79 celt_tests_test_unit_types_SOURCES = celt/tests/test_unit_types.c
80 celt_tests_test_unit_types_LDADD = -lm
81
82 if CUSTOM_MODES
83 pkginclude_HEADERS += include/opus_custom.h
84 noinst_PROGRAMS += opus_custom_demo
85 opus_custom_demo_SOURCES = celt/opus_custom_demo.c
86 opus_custom_demo_LDADD = libopus.la -lm
87 endif
88
89 EXTRA_DIST = version.mk \
90              opus.pc.in \
91              opus-uninstalled.pc.in \
92              opus.m4 \
93              Makefile.unix \
94              tests/run_vectors.sh \
95              opus.sln \
96              celt/celt.vcxproj \
97              celt/celt.vcxproj.filters \
98              src/opus_demo.vcxproj \
99              src/opus.vcxproj \
100              src/opus.vcxproj.filters \
101              src/opus_demo.vcxproj.filters \
102              tests/test_opus_decode.vcxproj.filters \
103              tests/test_opus_decode.vcxproj \
104              tests/test_opus_encode.vcxproj.filters \
105              tests/test_opus_encode.vcxproj \
106              tests/test_opus_api.vcxproj.filters \
107              tests/test_opus_api.vcxproj \
108              silk/float/silk_float.vcxproj.filters \
109              silk/float/silk_float.vcxproj \
110              silk/fixed/silk_fixed.vcxproj.filters \
111              silk/fixed/silk_fixed.vcxproj \
112              silk/silk_common.vcxproj \
113              silk/silk_common.vcxproj.filters \
114              win32/genversion.bat \
115              win32/config.h
116
117 pkgconfigdir = $(libdir)/pkgconfig
118 pkgconfig_DATA = opus.pc
119
120 m4datadir = $(datadir)/aclocal
121 m4data_DATA = opus.m4
122
123 # Targets to build and install just the library without the docs
124 opus check-opus install-opus: export NO_DOXYGEN = 1
125
126 opus: all
127 check-opus: check
128 install-opus: install
129
130
131 # Or just the docs
132 docs:
133         ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
134
135 install-docs:
136         ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
137
138
139 # Or everything (by default)
140 all-local:
141         @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
142
143 install-data-local:
144         @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
145
146 clean-local:
147         -( cd doc && $(MAKE) $(AM_MAKEFLAGS) clean )
148
149 uninstall-local:
150         ( cd doc && $(MAKE) $(AM_MAKEFLAGS) uninstall )
151
152
153 # We check this every time make is run, with configure.ac being touched to
154 # trigger an update of the build system files if update_version changes the
155 # current PACKAGE_VERSION (or if package_version was modified manually by a
156 # user with either AUTO_UPDATE=no or no update_version script present - the
157 # latter being the normal case for tarball releases).
158 #
159 # We can't just add the package_version file to CONFIGURE_DEPENDENCIES since
160 # simply running autoconf will not actually regenerate configure for us when
161 # the content of that file changes (due to autoconf dependency checking not
162 # knowing about that without us creating yet another file for it to include).
163 #
164 # The MAKECMDGOALS check is a gnu-make'ism, but will degrade 'gracefully' for
165 # makes that don't support it.  The only loss of functionality is not forcing
166 # an update of package_version for `make dist` if AUTO_UPDATE=no, but that is
167 # unlikely to be a real problem for any real user.
168 $(top_srcdir)/configure.ac: force
169         @case "$(MAKECMDGOALS)" in \
170             dist-hook)                             exit 0       ;; \
171             dist-* | dist | distcheck | distclean) _arg=release ;; \
172         esac; \
173         if ! $(top_srcdir)/update_version $$_arg 2> /dev/null; then \
174             if [ ! -e $(top_srcdir)/package_version ]; then \
175                 echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
176             fi; \
177             . $(top_srcdir)/package_version || exit 1; \
178             [ "$(PACKAGE_VERSION)" != "$$PACKAGE_VERSION" ] || exit 0; \
179         fi; \
180         touch $@
181
182 force:
183
184 # Create a minimal package_version file when make dist is run.
185 dist-hook:
186         echo 'PACKAGE_VERSION="$(PACKAGE_VERSION)"' > $(top_distdir)/package_version
187
188
189 .PHONY: opus check-opus install-opus docs install-docs