Expand SILK macro to avoid "Wexpansion-to-defined" violation
[opus.git] / Makefile.am
index 6556ee8..4d3a888 100644 (file)
+# 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
 
-#AM_CFLAGS = -Isrc -Iinterface -fPIC -Wall -O3 
-NAME = libSKP_SILK_SDK
-AM_CPPFLAGS = $(AM_CFLAGS)
-
-INCLUDES = -I$(top_srcdir)/src_FLP -I$(top_srcdir)/src_SigProc_FIX -I$(top_srcdir)/src_SigProc_FLP -I$(top_srcdir)/src_common -I$(top_srcdir)/interface -I$(top_srcdir)/../celt/libcelt
-EXTRA_DIST = Silk_FLP.sln \
-Silk_FLP.sln \
-src_FIX/src_FIX.vcxproj \
-src_FIX/src_FIX.vcxproj.filters \
-src_FLP/src_FLP.vcxproj \
-src_FLP/src_FLP.vcxproj.filters \
-src_common/src_common.vcxproj \
-src_common/src_common.vcxproj.filters \
-test/Encoder.c \
-test/Decoder.c \
-test/signalCompare.c \
-src_SigProc_FLP/src_SigProc_FLP.vcxproj \
-src_SigProc_FLP/src_SigProc_FLP.vcxproj.filters \
-src_SigProc_FIX/src_SigProc_FIX.vcxproj \
-src_SigProc_FIX/src_SigProc_FIX.vcxproj.filters \
-test_silk_dec/test_silk_dec.vcxproj \
-test_silk_dec/test_silk_dec.vcxproj.filters \
-test_silk_enc/test_silk_enc.vcxproj \
-test_silk_enc/test_silk_enc.vcxproj.filters
-
-lib_LTLIBRARIES        = libSKP_SILK_SDK.la
-libSKP_SILK_SDK_la_SOURCES = src_common/SKP_Silk_CNG.c \
-src_common/SKP_Silk_code_signs.c \
-src_common/SKP_Silk_create_init_destroy.c \
-src_common/SKP_Silk_decode_core.c \
-src_common/SKP_Silk_decode_frame.c \
-src_common/SKP_Silk_decode_parameters.c \
-src_common/SKP_Silk_decode_indices.c \
-src_common/SKP_Silk_decode_pulses.c \
-src_common/SKP_Silk_decoder_set_fs.c \
-src_common/SKP_Silk_dec_API.c \
-src_common/SKP_Silk_enc_API.c \
-src_common/SKP_Silk_encode_indices.c \
-src_common/SKP_Silk_encode_pulses.c \
-src_common/SKP_Silk_gain_quant.c \
-src_common/SKP_Silk_interpolate.c \
-src_common/SKP_Silk_LP_variable_cutoff.c \
-src_common/SKP_Silk_NLSF2A_stable.c \
-src_common/SKP_Silk_NLSF_MSVQ_decode.c \
-src_common/SKP_Silk_NSQ.c \
-src_common/SKP_Silk_NSQ_del_dec.c \
-src_common/SKP_Silk_PLC.c \
-src_common/SKP_Silk_pulses_to_bytes.c \
-src_common/SKP_Silk_shell_coder.c \
-src_common/SKP_Silk_tables_gain.c \
-src_common/SKP_Silk_tables_LTP.c \
-src_common/SKP_Silk_tables_NLSF_CB0_10.c \
-src_common/SKP_Silk_tables_NLSF_CB0_16.c \
-src_common/SKP_Silk_tables_NLSF_CB1_10.c \
-src_common/SKP_Silk_tables_NLSF_CB1_16.c \
-src_common/SKP_Silk_tables_other.c \
-src_common/SKP_Silk_tables_pitch_lag.c \
-src_common/SKP_Silk_tables_pulses_per_block.c \
-src_common/SKP_Silk_VAD.c \
-src_common/SKP_Silk_control_audio_bandwidth.c \
-src_common/SKP_Silk_quant_LTP_gains.c \
-src_common/SKP_Silk_VQ_WMat_EC.c \
-src_FLP/SKP_Silk_apply_sine_window_FLP.c \
-src_FLP/SKP_Silk_control_codec_FLP.c \
-src_FLP/SKP_Silk_corrMatrix_FLP.c \
-src_FLP/SKP_Silk_encode_frame_FLP.c \
-src_FLP/SKP_Silk_find_LPC_FLP.c \
-src_FLP/SKP_Silk_find_LTP_FLP.c \
-src_FLP/SKP_Silk_find_pitch_lags_FLP.c \
-src_FLP/SKP_Silk_find_pred_coefs_FLP.c \
-src_FLP/SKP_Silk_HP_variable_cutoff_FLP.c \
-src_FLP/SKP_Silk_init_encoder_FLP.c \
-src_FLP/SKP_Silk_LPC_analysis_filter_FLP.c \
-src_FLP/SKP_Silk_LTP_analysis_filter_FLP.c \
-src_FLP/SKP_Silk_LTP_scale_ctrl_FLP.c \
-src_FLP/SKP_Silk_NLSF_MSVQ_decode_FLP.c \
-src_FLP/SKP_Silk_NLSF_MSVQ_encode_FLP.c \
-src_FLP/SKP_Silk_NLSF_VQ_rate_distortion_FLP.c \
-src_FLP/SKP_Silk_NLSF_VQ_sum_error_FLP.c \
-src_FLP/SKP_Silk_NLSF_VQ_weights_laroia_FLP.c \
-src_FLP/SKP_Silk_noise_shape_analysis_FLP.c \
-src_FLP/SKP_Silk_prefilter_FLP.c \
-src_FLP/SKP_Silk_process_gains_FLP.c \
-src_FLP/SKP_Silk_process_NLSFs_FLP.c \
-src_FLP/SKP_Silk_regularize_correlations_FLP.c \
-src_FLP/SKP_Silk_residual_energy_FLP.c \
-src_FLP/SKP_Silk_solve_LS_FLP.c \
-src_FLP/SKP_Silk_warped_autocorrelation_FLP.c \
-src_FLP/SKP_Silk_wrappers_FLP.c \
-src_SigProc_FIX/SKP_Silk_A2NLSF.c \
-src_SigProc_FIX/SKP_Silk_allpass_int.c \
-src_SigProc_FIX/SKP_Silk_ana_filt_bank_1.c \
-src_SigProc_FIX/SKP_Silk_apply_sine_window.c \
-src_SigProc_FIX/SKP_Silk_array_maxabs.c \
-src_SigProc_FIX/SKP_Silk_autocorr.c \
-src_SigProc_FIX/SKP_Silk_biquad_alt.c \
-src_SigProc_FIX/SKP_Silk_burg_modified.c \
-src_SigProc_FIX/SKP_Silk_bwexpander_32.c \
-src_SigProc_FIX/SKP_Silk_bwexpander.c \
-src_SigProc_FIX/SKP_Silk_decode_pitch.c \
-src_SigProc_FIX/SKP_Silk_inner_prod_aligned.c \
-src_SigProc_FIX/SKP_Silk_k2a.c \
-src_SigProc_FIX/SKP_Silk_k2a_Q16.c \
-src_SigProc_FIX/SKP_Silk_lin2log.c \
-src_SigProc_FIX/SKP_Silk_log2lin.c \
-src_SigProc_FIX/SKP_Silk_lowpass_int.c \
-src_SigProc_FIX/SKP_Silk_lowpass_short.c \
-src_SigProc_FIX/SKP_Silk_LPC_inv_pred_gain.c \
-src_SigProc_FIX/SKP_Silk_LPC_stabilize.c \
-src_SigProc_FIX/SKP_Silk_LPC_synthesis_filter.c \
-src_SigProc_FIX/SKP_Silk_LPC_synthesis_order16.c \
-src_SigProc_FIX/SKP_Silk_LSF_cos_table.c \
-src_SigProc_FIX/SKP_Silk_MA.c \
-src_SigProc_FIX/SKP_Silk_NLSF2A.c \
-src_SigProc_FIX/SKP_Silk_NLSF_stabilize.c \
-src_SigProc_FIX/SKP_Silk_NLSF_VQ_weights_laroia.c \
-src_SigProc_FIX/SKP_Silk_pitch_analysis_core.c \
-src_SigProc_FIX/SKP_Silk_pitch_est_tables.c \
-src_SigProc_FIX/SKP_Silk_resampler.c \
-src_SigProc_FIX/SKP_Silk_resampler_down2_3.c \
-src_SigProc_FIX/SKP_Silk_resampler_down2.c \
-src_SigProc_FIX/SKP_Silk_resampler_down3.c \
-src_SigProc_FIX/SKP_Silk_resampler_private_AR2.c \
-src_SigProc_FIX/SKP_Silk_resampler_private_ARMA4.c \
-src_SigProc_FIX/SKP_Silk_resampler_private_copy.c \
-src_SigProc_FIX/SKP_Silk_resampler_private_down4.c \
-src_SigProc_FIX/SKP_Silk_resampler_private_down_FIR.c \
-src_SigProc_FIX/SKP_Silk_resampler_private_IIR_FIR.c \
-src_SigProc_FIX/SKP_Silk_resampler_private_up2_HQ.c \
-src_SigProc_FIX/SKP_Silk_resampler_private_up4.c \
-src_SigProc_FIX/SKP_Silk_resampler_rom.c \
-src_SigProc_FIX/SKP_Silk_resampler_up2.c \
-src_SigProc_FIX/SKP_Silk_scale_copy_vector16.c \
-src_SigProc_FIX/SKP_Silk_scale_vector.c \
-src_SigProc_FIX/SKP_Silk_schur64.c \
-src_SigProc_FIX/SKP_Silk_schur.c \
-src_SigProc_FIX/SKP_Silk_sigm_Q15.c \
-src_SigProc_FIX/SKP_Silk_sort.c \
-src_SigProc_FIX/SKP_Silk_sum_sqr_shift.c \
-src_SigProc_FLP/SKP_Silk_allpass_int_FLP.c \
-src_SigProc_FLP/SKP_Silk_autocorrelation_FLP.c \
-src_SigProc_FLP/SKP_Silk_burg_modified_FLP.c \
-src_SigProc_FLP/SKP_Silk_bwexpander_FLP.c \
-src_SigProc_FLP/SKP_Silk_decimate2_coarse_FLP.c \
-src_SigProc_FLP/SKP_Silk_decimate2_coarsest_FLP.c \
-src_SigProc_FLP/SKP_Silk_energy_FLP.c \
-src_SigProc_FLP/SKP_Silk_inner_product_FLP.c \
-src_SigProc_FLP/SKP_Silk_k2a_FLP.c \
-src_SigProc_FLP/SKP_Silk_levinsondurbin_FLP.c \
-src_SigProc_FLP/SKP_Silk_LPC_inv_pred_gain_FLP.c \
-src_SigProc_FLP/SKP_Silk_pitch_analysis_core_FLP.c \
-src_SigProc_FLP/SKP_Silk_scale_copy_vector_FLP.c \
-src_SigProc_FLP/SKP_Silk_scale_vector_FLP.c \
-src_SigProc_FLP/SKP_Silk_schur_FLP.c \
-src_SigProc_FLP/SKP_Silk_sort_FLP.c
-
-
-libSKP_SILK_SDK_la_CFLAGS = $(AM_CFLAGS)
-libSKP_SILK_SDK_la_LDFLAGS = $(LIBS)
-
-library_includedir = $(prefix)/include/silk
-library_include_HEADERS        = interface/SKP_debug.h \
-interface/SKP_Silk_control.h \
-interface/SKP_Silk_errors.h \
-interface/SKP_Silk_SDK_API.h \
-interface/SKP_Silk_typedef.h \
-src_common/SKP_Silk_define.h \
-src_common/SKP_Silk_main.h \
-src_common/SKP_Silk_PLC.h \
-src_common/SKP_Silk_structs.h \
-src_common/SKP_Silk_tables.h \
-src_common/SKP_Silk_tables_NLSF_CB.h \
-src_common/SKP_Silk_tuning_parameters.h \
-src_common/SKP_Silk_setup_complexity.h \
-src_FIX/SKP_Silk_main_FIX.h \
-src_FIX/SKP_Silk_structs_FIX.h \
-src_FLP/SKP_Silk_assembler_FLP.h \
-src_FLP/SKP_Silk_main_FLP.h \
-src_FLP/SKP_Silk_structs_FLP.h \
-src_SigProc_FIX/SKP_Silk_common_pitch_est_defines.h \
-src_SigProc_FIX/SKP_Silk_Inlines.h \
-src_SigProc_FIX/SKP_Silk_MacroCount.h \
-src_SigProc_FIX/SKP_Silk_MacroDebug.h \
-src_SigProc_FIX/SKP_Silk_macros.h \
-src_SigProc_FIX/SKP_Silk_pitch_est_defines.h \
-src_SigProc_FIX/SKP_Silk_resampler_private.h \
-src_SigProc_FIX/SKP_Silk_resampler_rom.h \
-src_SigProc_FIX/SKP_Silk_resampler_structs.h \
-src_SigProc_FIX/SKP_Silk_SigProc_FIX.h \
-src_SigProc_FLP/SKP_Silk_SigProc_FLP.h
-
-bin_PROGRAMS = Encoder Decoder signalCompare
-Encoder_SOURCES = test/Encoder.c $(top_builddir)/interface/SKP_Silk_SDK_API.h
-Encoder_LDADD = $(lib_LTLIBRARIES) 
-Encoder_LDFLAGS = $(LIBS)
-
-Decoder_SOURCES = test/Decoder.c $(top_builddir)/interface/SKP_Silk_SDK_API.h
-Decoder_LDADD = $(lib_LTLIBRARIES) 
-Decoder_LDFLAGS = $(LIBS)
-
-signalCompare_SOURCES = test/signalCompare.c $(top_builddir)/interface/SKP_Silk_SDK_API.h
-signalCompare_LDADD = $(lib_LTLIBRARIES) 
-signalCompare_LDFLAGS = $(LIBS)
-
-LIBS = ../celt/libcelt/libcelt0.la
+AUTOMAKE_OPTIONS = subdir-objects
+ACLOCAL_AMFLAGS = -I m4
+
+lib_LTLIBRARIES = libopus.la
+
+DIST_SUBDIRS = doc
+
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/celt -I$(top_srcdir)/silk \
+              -I$(top_srcdir)/silk/float -I$(top_srcdir)/silk/fixed $(NE10_CFLAGS)
+
+include celt_sources.mk
+include silk_sources.mk
+include opus_sources.mk
+
+if FIXED_POINT
+SILK_SOURCES += $(SILK_SOURCES_FIXED)
+if HAVE_SSE4_1
+SILK_SOURCES += $(SILK_SOURCES_SSE4_1) $(SILK_SOURCES_FIXED_SSE4_1)
+endif
+else
+SILK_SOURCES += $(SILK_SOURCES_FLOAT)
+if HAVE_SSE4_1
+SILK_SOURCES += $(SILK_SOURCES_SSE4_1)
+endif
+endif
+
+if DISABLE_FLOAT_API
+else
+OPUS_SOURCES += $(OPUS_SOURCES_FLOAT)
+endif
+
+if HAVE_SSE
+CELT_SOURCES += $(CELT_SOURCES_SSE)
+endif
+if HAVE_SSE2
+CELT_SOURCES += $(CELT_SOURCES_SSE2)
+endif
+if HAVE_SSE4_1
+CELT_SOURCES += $(CELT_SOURCES_SSE4_1)
+endif
+
+if CPU_ARM
+CELT_SOURCES += $(CELT_SOURCES_ARM)
+SILK_SOURCES += $(SILK_SOURCES_ARM)
+
+if OPUS_ARM_NEON_INTR
+CELT_SOURCES += $(CELT_SOURCES_ARM_NEON_INTR)
+endif
+
+if HAVE_ARM_NE10
+CELT_SOURCES += $(CELT_SOURCES_ARM_NE10)
+endif
+
+if OPUS_ARM_EXTERNAL_ASM
+noinst_LTLIBRARIES = libarmasm.la
+libarmasm_la_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S)
+BUILT_SOURCES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
+ $(CELT_AM_SOURCES_ARM_ASM:.s.in=.s) \
+ $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
+endif
+endif
+
+CLEANFILES = $(CELT_SOURCES_ARM_ASM:.s=-gnu.S) \
+ $(CELT_AM_SOURCES_ARM_ASM:.s.in=-gnu.S)
+
+include celt_headers.mk
+include silk_headers.mk
+include opus_headers.mk
+
+libopus_la_SOURCES = $(CELT_SOURCES) $(SILK_SOURCES) $(OPUS_SOURCES)
+libopus_la_LDFLAGS = -no-undefined -version-info @OPUS_LT_CURRENT@:@OPUS_LT_REVISION@:@OPUS_LT_AGE@
+libopus_la_LIBADD = $(NE10_LIBS) $(LIBM)
+if OPUS_ARM_EXTERNAL_ASM
+libopus_la_LIBADD += libarmasm.la
+endif
+
+pkginclude_HEADERS = include/opus.h include/opus_multistream.h include/opus_types.h include/opus_defines.h
+
+noinst_HEADERS = $(OPUS_HEAD) $(SILK_HEAD) $(CELT_HEAD)
+
+if EXTRA_PROGRAMS
+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
+
+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
+
+opus_demo_SOURCES = src/opus_demo.c
+
+opus_demo_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
+
+repacketizer_demo_SOURCES = src/repacketizer_demo.c
+
+repacketizer_demo_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
+
+opus_compare_SOURCES = src/opus_compare.c
+opus_compare_LDADD = $(LIBM)
+
+tests_test_opus_api_SOURCES = tests/test_opus_api.c tests/test_opus_common.h
+tests_test_opus_api_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
+
+tests_test_opus_encode_SOURCES = tests/test_opus_encode.c tests/test_opus_common.h
+tests_test_opus_encode_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
+
+tests_test_opus_decode_SOURCES = tests/test_opus_decode.c tests/test_opus_common.h
+tests_test_opus_decode_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
+
+tests_test_opus_padding_SOURCES = tests/test_opus_padding.c tests/test_opus_common.h
+tests_test_opus_padding_LDADD = libopus.la $(NE10_LIBS) $(LIBM)
+
+celt_tests_test_unit_cwrs32_SOURCES = celt/tests/test_unit_cwrs32.c
+celt_tests_test_unit_cwrs32_LDADD = $(LIBM)
+
+celt_tests_test_unit_dft_SOURCES = celt/tests/test_unit_dft.c
+celt_tests_test_unit_dft_LDADD = $(NE10_LIBS) $(LIBM)
+if OPUS_ARM_EXTERNAL_ASM
+celt_tests_test_unit_dft_LDADD += libarmasm.la
+endif
+
+celt_tests_test_unit_entropy_SOURCES = celt/tests/test_unit_entropy.c
+celt_tests_test_unit_entropy_LDADD = $(LIBM)
+
+celt_tests_test_unit_laplace_SOURCES = celt/tests/test_unit_laplace.c
+celt_tests_test_unit_laplace_LDADD = $(LIBM)
+
+celt_tests_test_unit_mathops_SOURCES = celt/tests/test_unit_mathops.c
+celt_tests_test_unit_mathops_LDADD = $(NE10_LIBS) $(LIBM)
+if OPUS_ARM_EXTERNAL_ASM
+celt_tests_test_unit_mathops_LDADD += libarmasm.la
+endif
+
+celt_tests_test_unit_mdct_SOURCES = celt/tests/test_unit_mdct.c
+celt_tests_test_unit_mdct_LDADD = $(NE10_LIBS) $(LIBM)
+if OPUS_ARM_EXTERNAL_ASM
+celt_tests_test_unit_mdct_LDADD += libarmasm.la
+endif
+
+celt_tests_test_unit_rotation_SOURCES = celt/tests/test_unit_rotation.c
+celt_tests_test_unit_rotation_LDADD = $(NE10_LIBS) $(LIBM)
+if OPUS_ARM_EXTERNAL_ASM
+celt_tests_test_unit_rotation_LDADD += libarmasm.la
+endif
+
+celt_tests_test_unit_types_SOURCES = celt/tests/test_unit_types.c
+celt_tests_test_unit_types_LDADD = $(LIBM)
+endif
+
+if CUSTOM_MODES
+pkginclude_HEADERS += include/opus_custom.h
+if EXTRA_PROGRAMS
+noinst_PROGRAMS += opus_custom_demo
+opus_custom_demo_SOURCES = celt/opus_custom_demo.c
+opus_custom_demo_LDADD = libopus.la $(LIBM)
+endif
+endif
+
+EXTRA_DIST = version.mk \
+             opus.pc.in \
+             opus-uninstalled.pc.in \
+             opus.m4 \
+             Makefile.mips \
+             Makefile.unix \
+             tests/run_vectors.sh \
+             celt/arm/arm2gnu.pl \
+             celt/arm/celt_pitch_xcorr_arm.s \
+             win32/VS2010/silk_float.vcxproj \
+             win32/VS2010/celt.vcxproj.filters \
+             win32/VS2010/opus.vcxproj \
+             win32/VS2010/silk_common.vcxproj.filters \
+             win32/VS2010/silk_float.vcxproj.filters \
+             win32/VS2010/test_opus_encode.vcxproj.filters \
+             win32/VS2010/silk_common.vcxproj \
+             win32/VS2010/test_opus_encode.vcxproj \
+             win32/VS2010/opus_demo.vcxproj \
+             win32/VS2010/test_opus_api.vcxproj.filters \
+             win32/VS2010/test_opus_api.vcxproj \
+             win32/VS2010/test_opus_decode.vcxproj.filters \
+             win32/VS2010/silk_fixed.vcxproj.filters \
+             win32/VS2010/opus_demo.vcxproj.filters \
+             win32/VS2010/silk_fixed.vcxproj \
+             win32/VS2010/opus.vcxproj.filters \
+             win32/VS2010/test_opus_decode.vcxproj \
+             win32/VS2010/celt.vcxproj \
+             win32/VS2010/opus.sln \
+             win32/genversion.bat \
+             win32/config.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = opus.pc
+
+m4datadir = $(datadir)/aclocal
+m4data_DATA = opus.m4
+
+# 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:
+       ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
+
+install-docs:
+       ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
+
+
+# Or everything (by default)
+all-local:
+       @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) )
+
+install-data-local:
+       @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && $(MAKE) $(AM_MAKEFLAGS) install )
+
+clean-local:
+       -( cd doc && $(MAKE) $(AM_MAKEFLAGS) clean )
+
+uninstall-local:
+       ( cd doc && $(MAKE) $(AM_MAKEFLAGS) uninstall )
+
+
+# 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 \
+           if [ ! -e $(top_srcdir)/package_version ]; then \
+               echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
+           fi; \
+           . $(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
+
+
+.PHONY: opus check-opus install-opus docs install-docs
+
+# 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
+       $(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
+# For autoconf-modified sources (e.g., armopts.s)
+%-gnu.S: %.s
+       $(top_srcdir)/celt/arm/arm2gnu.pl @ARM2GNU_PARAMS@ < $< > $@
+
+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) \
+                    $(celt_tests_test_unit_dft_SOURCES:.c=.o)
+
+if HAVE_SSE
+SSE_OBJ = $(CELT_SOURCES_SSE:.c=.lo)
+$(SSE_OBJ) $(OPT_UNIT_TEST_OBJ): CFLAGS += $(OPUS_X86_SSE_CFLAGS)
+endif
+
+if HAVE_SSE2
+SSE2_OBJ = $(CELT_SOURCES_SSE2:.c=.lo)
+$(SSE2_OBJ) $(OPT_UNIT_TEST_OBJ): CFLAGS += $(OPUS_X86_SSE2_CFLAGS)
+endif
+
+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)
+$(SSE4_1_OBJ) $(OPT_UNIT_TEST_OBJ): CFLAGS += $(OPUS_X86_SSE4_1_CFLAGS)
+endif
+
+if OPUS_ARM_NEON_INTR
+CELT_ARM_NEON_INTR_OBJ = $(CELT_SOURCES_ARM_NEON_INTR:.c=.lo)
+$(CELT_ARM_NEON_INTR_OBJ) $(OPT_UNIT_TEST_OBJ): CFLAGS += \
+ $(OPUS_ARM_NEON_INTR_CFLAGS)  $(NE10_CFLAGS)
+endif