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