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