Makefile.am 11.7 KB
Newer Older
1 2 3 4
# Provide the full test output for failed tests when using the parallel
# test suite (which is enabled by default with automake 1.13+).
export VERBOSE = yes

5
AUTOMAKE_OPTIONS = subdir-objects
Ron's avatar
Ron committed
6
ACLOCAL_AMFLAGS = -I m4
7

8
lib_LTLIBRARIES = libopus.la
Jean-Marc Valin's avatar
Jean-Marc Valin committed
9

10 11
DIST_SUBDIRS = doc

Ron's avatar
Ron committed
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 $(NE10_CFLAGS)
Jean-Marc Valin's avatar
Jean-Marc Valin committed
14

15 16 17
include celt_sources.mk
include silk_sources.mk
include opus_sources.mk
Jean-Marc Valin's avatar
Jean-Marc Valin committed
18

Jean-Marc Valin's avatar
Jean-Marc Valin committed
19 20
if FIXED_POINT
SILK_SOURCES += $(SILK_SOURCES_FIXED)
21 22 23
if HAVE_SSE4_1
SILK_SOURCES += $(SILK_SOURCES_SSE4_1) $(SILK_SOURCES_FIXED_SSE4_1)
endif
24 25 26
if HAVE_ARM_NEON_INTR
SILK_SOURCES += $(SILK_SOURCES_FIXED_ARM_NEON_INTR)
endif
Jean-Marc Valin's avatar
Jean-Marc Valin committed
27 28
else
SILK_SOURCES += $(SILK_SOURCES_FLOAT)
29 30 31
if HAVE_SSE4_1
SILK_SOURCES += $(SILK_SOURCES_SSE4_1)
endif
Jean-Marc Valin's avatar
Jean-Marc Valin committed
32 33
endif

34 35
if DISABLE_FLOAT_API
else
36
OPUS_SOURCES += $(OPUS_SOURCES_FLOAT)
37
endif
38

39
if HAVE_SSE
40 41
CELT_SOURCES += $(CELT_SOURCES_SSE)
endif
42 43 44 45 46
if HAVE_SSE2
CELT_SOURCES += $(CELT_SOURCES_SSE2)
endif
if HAVE_SSE4_1
CELT_SOURCES += $(CELT_SOURCES_SSE4_1)
47 48
endif

49 50
if CPU_ARM
CELT_SOURCES += $(CELT_SOURCES_ARM)
51
SILK_SOURCES += $(SILK_SOURCES_ARM)
52

53
if HAVE_ARM_NEON_INTR
54
CELT_SOURCES += $(CELT_SOURCES_ARM_NEON_INTR)
55
SILK_SOURCES += $(SILK_SOURCES_ARM_NEON_INTR)
56 57
endif

58 59 60 61
if HAVE_ARM_NE10
CELT_SOURCES += $(CELT_SOURCES_ARM_NE10)
endif

62
if OPUS_ARM_EXTERNAL_ASM
63 64
noinst_LTLIBRARIES = libarmasm.la
libarmasm_la_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S)
65 66
BUILT_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
 $(CELT_AM_SOURCES_ARM_ASM:.s.in=.s) \
Timothy B. Terriberry's avatar
Timothy B. Terriberry committed
67
 $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
68
endif
69 70
endif

Ralph Giles's avatar
Ralph Giles committed
71 72 73
CLEANFILES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
 $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)

74 75 76
include celt_headers.mk
include silk_headers.mk
include opus_headers.mk
77

78
libopus_la_SOURCES = $(CELT_SOURCES) $(SILK_SOURCES) $(OPUS_SOURCES)
79
libopus_la_LDFLAGS = -no-undefined -version-info @OPUS_LT_CURRENT@:@OPUS_LT_REVISION@:@OPUS_LT_AGE@
80
libopus_la_LIBADD = $(NE10_LIBS) $(LIBM)
81 82 83
if OPUS_ARM_EXTERNAL_ASM
libopus_la_LIBADD += libarmasm.la
endif
84

Andrew Allen's avatar
Andrew Allen committed
85
pkginclude_HEADERS = include/opus.h include/opus_multistream.h include/opus_types.h include/opus_defines.h include/opus_projection.h
86

87 88
noinst_HEADERS = $(OPUS_HEAD) $(SILK_HEAD) $(CELT_HEAD)

89
if EXTRA_PROGRAMS
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
noinst_PROGRAMS = 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 \
                  opus_compare \
                  opus_demo \
                  repacketizer_demo \
                  silk/tests/test_unit_LPC_inv_pred_gain \
                  tests/test_opus_api \
                  tests/test_opus_decode \
                  tests/test_opus_encode \
Andrew Allen's avatar
Andrew Allen committed
105
                  tests/test_opus_padding \
106 107
                  tests/test_opus_projection \
                  trivial_example
108 109 110 111 112 113 114 115 116 117 118 119 120

TESTS = 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 \
        silk/tests/test_unit_LPC_inv_pred_gain \
        tests/test_opus_api \
        tests/test_opus_decode \
        tests/test_opus_encode \
Andrew Allen's avatar
Andrew Allen committed
121 122
        tests/test_opus_padding \
        tests/test_opus_projection
123

124 125
opus_demo_SOURCES = src/opus_demo.c

126
opus_demo_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
127

128
repacketizer_demo_SOURCES = src/repacketizer_demo.c
129

130
repacketizer_demo_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
Ralph Giles's avatar
Ralph Giles committed
131

132
opus_compare_SOURCES = src/opus_compare.c
Ron's avatar
Ron committed
133
opus_compare_LDADD = $(LIBM)
134

135 136 137
trivial_example_SOURCES = doc/trivial_example.c
trivial_example_LDADD = libopus.la $(LIBM)

Gregory Maxwell's avatar
Gregory Maxwell committed
138
tests_test_opus_api_SOURCES = tests/test_opus_api.c tests/test_opus_common.h
139
tests_test_opus_api_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
140

141
tests_test_opus_encode_SOURCES = tests/test_opus_encode.c tests/opus_encode_regressions.c tests/test_opus_common.h
142
tests_test_opus_encode_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
143

Gregory Maxwell's avatar
Gregory Maxwell committed
144
tests_test_opus_decode_SOURCES = tests/test_opus_decode.c tests/test_opus_common.h
145
tests_test_opus_decode_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
Gregory Maxwell's avatar
Gregory Maxwell committed
146

147
tests_test_opus_padding_SOURCES = tests/test_opus_padding.c tests/test_opus_common.h
148
tests_test_opus_padding_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
149

150 151
CELT_OBJ = $(CELT_SOURCES:.c=.lo)
SILK_OBJ = $(SILK_SOURCES:.c=.lo)
Jean-Marc Valin's avatar
Jean-Marc Valin committed
152 153 154 155 156 157 158
OPUS_OBJ = $(OPUS_SOURCES:.c=.lo)

tests_test_opus_projection_SOURCES = tests/test_opus_projection.c tests/test_opus_common.h
tests_test_opus_projection_LDADD = $(OPUS_OBJ) $(SILK_OBJ) $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
if OPUS_ARM_EXTERNAL_ASM
tests_test_opus_projection_LDADD += libarmasm.la
endif
159

160
silk_tests_test_unit_LPC_inv_pred_gain_SOURCES = silk/tests/test_unit_LPC_inv_pred_gain.c
161 162 163 164
silk_tests_test_unit_LPC_inv_pred_gain_LDADD = $(SILK_OBJ) $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
if OPUS_ARM_EXTERNAL_ASM
silk_tests_test_unit_LPC_inv_pred_gain_LDADD += libarmasm.la
endif
165

Gregory Maxwell's avatar
Gregory Maxwell committed
166
celt_tests_test_unit_cwrs32_SOURCES = celt/tests/test_unit_cwrs32.c
Ron's avatar
Ron committed
167
celt_tests_test_unit_cwrs32_LDADD = $(LIBM)
Gregory Maxwell's avatar
Gregory Maxwell committed
168 169

celt_tests_test_unit_dft_SOURCES = celt/tests/test_unit_dft.c
170
celt_tests_test_unit_dft_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
171 172 173
if OPUS_ARM_EXTERNAL_ASM
celt_tests_test_unit_dft_LDADD += libarmasm.la
endif
Gregory Maxwell's avatar
Gregory Maxwell committed
174 175

celt_tests_test_unit_entropy_SOURCES = celt/tests/test_unit_entropy.c
Ron's avatar
Ron committed
176
celt_tests_test_unit_entropy_LDADD = $(LIBM)
Gregory Maxwell's avatar
Gregory Maxwell committed
177 178

celt_tests_test_unit_laplace_SOURCES = celt/tests/test_unit_laplace.c
Ron's avatar
Ron committed
179
celt_tests_test_unit_laplace_LDADD = $(LIBM)
Gregory Maxwell's avatar
Gregory Maxwell committed
180 181

celt_tests_test_unit_mathops_SOURCES = celt/tests/test_unit_mathops.c
182
celt_tests_test_unit_mathops_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
183
if OPUS_ARM_EXTERNAL_ASM
184
celt_tests_test_unit_mathops_LDADD += libarmasm.la
185
endif
Gregory Maxwell's avatar
Gregory Maxwell committed
186 187

celt_tests_test_unit_mdct_SOURCES = celt/tests/test_unit_mdct.c
188
celt_tests_test_unit_mdct_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
189 190 191
if OPUS_ARM_EXTERNAL_ASM
celt_tests_test_unit_mdct_LDADD += libarmasm.la
endif
Gregory Maxwell's avatar
Gregory Maxwell committed
192 193

celt_tests_test_unit_rotation_SOURCES = celt/tests/test_unit_rotation.c
194
celt_tests_test_unit_rotation_LDADD = $(CELT_OBJ) $(NE10_LIBS) $(LIBM)
195
if OPUS_ARM_EXTERNAL_ASM
196
celt_tests_test_unit_rotation_LDADD += libarmasm.la
197
endif
Gregory Maxwell's avatar
Gregory Maxwell committed
198 199

celt_tests_test_unit_types_SOURCES = celt/tests/test_unit_types.c
Ron's avatar
Ron committed
200
celt_tests_test_unit_types_LDADD = $(LIBM)
201
endif
202

203
if CUSTOM_MODES
204
pkginclude_HEADERS += include/opus_custom.h
205
if EXTRA_PROGRAMS
206 207
noinst_PROGRAMS += opus_custom_demo
opus_custom_demo_SOURCES = celt/opus_custom_demo.c
Ron's avatar
Ron committed
208
opus_custom_demo_LDADD = libopus.la $(LIBM)
209
endif
210
endif
211

212
EXTRA_DIST = opus.pc.in \
213
             opus-uninstalled.pc.in \
214
             opus.m4 \
215
             Makefile.mips \
216
             Makefile.unix \
217
             CMakeLists.txt \
218
             cmake/CFeatureCheck.cmake \
219 220 221 222
             cmake/OpusBuildtype.cmake \
             cmake/OpusConfig.cmake \
             cmake/OpusConfig.cmake.in \
             cmake/OpusFunctions.cmake \
223
             cmake/OpusPackageVersion.cmake \
224 225
             cmake/OpusSources.cmake \
             cmake/config.h.cmake.in \
226
             cmake/vla.c \
227
             tests/run_vectors.sh \
228
             celt/arm/arm2gnu.pl \
Ron's avatar
Ron committed
229
             celt/arm/celt_pitch_xcorr_arm.s \
230 231 232 233 234 235 236 237 238 239 240
             win32/VS2015/opus.vcxproj \
             win32/VS2015/test_opus_encode.vcxproj.filters \
             win32/VS2015/test_opus_encode.vcxproj \
             win32/VS2015/opus_demo.vcxproj \
             win32/VS2015/test_opus_api.vcxproj.filters \
             win32/VS2015/test_opus_api.vcxproj \
             win32/VS2015/test_opus_decode.vcxproj.filters \
             win32/VS2015/opus_demo.vcxproj.filters \
             win32/VS2015/opus.vcxproj.filters \
             win32/VS2015/test_opus_decode.vcxproj \
             win32/VS2015/opus.sln \
241
             win32/VS2015/common.props \
242 243
             win32/genversion.bat \
             win32/config.h
Ralph Giles's avatar
Ralph Giles committed
244 245 246

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = opus.pc
247

248 249
m4datadir = $(datadir)/aclocal
m4data_DATA = opus.m4
250 251 252 253 254 255 256 257 258 259 260

# Targets to build and install just the library without the docs
opus check-opus install-opus: export NO_DOXYGEN = 1

opus: all
check-opus: check
install-opus: install


# Or just the docs
docs:
261
	( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
262 263

install-docs:
264
	( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
265 266 267 268


# Or everything (by default)
all-local:
269
	@[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
270 271

install-data-local:
272
	@[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
273 274

clean-local:
275
	-( cd doc && $(MAKE) $(AM_MAKEFLAGS) clean )
276 277

uninstall-local:
278
	( cd doc && $(MAKE) $(AM_MAKEFLAGS) uninstall )
279 280


Ron's avatar
Ron committed
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
# We check this every time make is run, with configure.ac being touched to
# trigger an update of the build system files if update_version changes the
# current PACKAGE_VERSION (or if package_version was modified manually by a
# user with either AUTO_UPDATE=no or no update_version script present - the
# latter being the normal case for tarball releases).
#
# We can't just add the package_version file to CONFIGURE_DEPENDENCIES since
# simply running autoconf will not actually regenerate configure for us when
# the content of that file changes (due to autoconf dependency checking not
# knowing about that without us creating yet another file for it to include).
#
# The MAKECMDGOALS check is a gnu-make'ism, but will degrade 'gracefully' for
# makes that don't support it.  The only loss of functionality is not forcing
# an update of package_version for `make dist` if AUTO_UPDATE=no, but that is
# unlikely to be a real problem for any real user.
$(top_srcdir)/configure.ac: force
	@case "$(MAKECMDGOALS)" in \
	    dist-hook)                             exit 0       ;; \
	    dist-* | dist | distcheck | distclean) _arg=release ;; \
	esac; \
	if ! $(top_srcdir)/update_version $$_arg 2> /dev/null; then \
302 303 304
	    if [ ! -e $(top_srcdir)/package_version ]; then \
		echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
	    fi; \
Ron's avatar
Ron committed
305 306 307 308 309 310 311 312 313 314 315 316
	    . $(top_srcdir)/package_version || exit 1; \
	    [ "$(PACKAGE_VERSION)" != "$$PACKAGE_VERSION" ] || exit 0; \
	fi; \
	touch $@

force:

# Create a minimal package_version file when make dist is run.
dist-hook:
	echo 'PACKAGE_VERSION="$(PACKAGE_VERSION)"' > $(top_distdir)/package_version


317
.PHONY: opus check-opus install-opus docs install-docs
318 319 320 321 322 323 324

# automake doesn't do dependency tracking for asm files, that I can tell
$(CELT_SOURCES_ARM_ASM:%.s=%-gnu.S): celt/arm/armopts-gnu.S
$(CELT_SOURCES_ARM_ASM:%.s=%-gnu.S): $(top_srcdir)/celt/arm/arm2gnu.pl

# convert ARM asm to GNU as format
%-gnu.S: $(top_srcdir)/%.s
325
	$(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
326 327
# For autoconf-modified sources (e.g., armopts.s)
%-gnu.S: %.s
328
	$(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
329

330 331 332
OPT_UNIT_TEST_OBJ = $(celt_tests_test_unit_mathops_SOURCES:.c=.o) \
                    $(celt_tests_test_unit_rotation_SOURCES:.c=.o) \
                    $(celt_tests_test_unit_mdct_SOURCES:.c=.o) \
333 334
                    $(celt_tests_test_unit_dft_SOURCES:.c=.o) \
                    $(silk_tests_test_unit_LPC_inv_pred_gain_SOURCES:.c=.o)
335 336 337

if HAVE_SSE
SSE_OBJ = $(CELT_SOURCES_SSE:.c=.lo)
338
$(SSE_OBJ): CFLAGS += $(OPUS_X86_SSE_CFLAGS)
339
endif
340 341

if HAVE_SSE2
342
SSE2_OBJ = $(CELT_SOURCES_SSE2:.c=.lo)
343
$(SSE2_OBJ): CFLAGS += $(OPUS_X86_SSE2_CFLAGS)
344
endif
345 346 347 348 349

if HAVE_SSE4_1
SSE4_1_OBJ = $(CELT_SOURCES_SSE4_1:.c=.lo) \
             $(SILK_SOURCES_SSE4_1:.c=.lo) \
             $(SILK_SOURCES_FIXED_SSE4_1:.c=.lo)
350
$(SSE4_1_OBJ): CFLAGS += $(OPUS_X86_SSE4_1_CFLAGS)
351
endif
352

353
if HAVE_ARM_NEON_INTR
354 355 356
ARM_NEON_INTR_OBJ = $(CELT_SOURCES_ARM_NEON_INTR:.c=.lo) \
                    $(SILK_SOURCES_ARM_NEON_INTR:.c=.lo) \
                    $(SILK_SOURCES_FIXED_ARM_NEON_INTR:.c=.lo)
357
$(ARM_NEON_INTR_OBJ): CFLAGS += \
358
 $(OPUS_ARM_NEON_INTR_CFLAGS)  $(NE10_CFLAGS)
359
endif