Makefile.am 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. ACLOCAL_AMFLAGS = -I m4
  2. AM_CFLAGS = -I$(top_srcdir)/include $(DEPS_CFLAGS)
  3. dist_doc_DATA = COPYING AUTHORS README.md
  4. opusincludedir = ${includedir}/opus
  5. opusinclude_HEADERS = include/opusfile.h
  6. lib_LTLIBRARIES = libopusfile.la libopusurl.la
  7. libopusfile_la_SOURCES = \
  8. src/info.c \
  9. src/internal.c src/internal.h \
  10. src/opusfile.c src/stream.c
  11. libopusfile_la_LIBADD = $(DEPS_LIBS) $(lrintf_lib)
  12. libopusfile_la_LDFLAGS = -no-undefined \
  13. -version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@
  14. libopusurl_la_SOURCES = src/http.c src/internal.c src/internal.h
  15. libopusurl_la_CFLAGS = $(AM_CFLAGS) $(URL_DEPS_CFLAGS)
  16. libopusurl_la_LIBADD = libopusfile.la $(URL_DEPS_LIBS)
  17. libopusurl_la_LDFLAGS = -no-undefined \
  18. -version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@
  19. if OP_ENABLE_EXAMPLES
  20. noinst_PROGRAMS = examples/opusfile_example examples/seeking_example
  21. endif
  22. examples_opusfile_example_SOURCES = examples/opusfile_example.c
  23. examples_seeking_example_SOURCES = examples/seeking_example.c
  24. examples_opusfile_example_LDADD = libopusurl.la libopusfile.la
  25. examples_seeking_example_LDADD = libopusurl.la libopusfile.la
  26. if OP_WIN32
  27. if OP_ENABLE_HTTP
  28. libopusurl_la_SOURCES += src/wincerts.c src/winerrno.h
  29. libopusurl_la_LIBADD += -lws2_32 -lcrypt32
  30. endif
  31. examples_opusfile_example_SOURCES += examples/win32utf8.c examples/win32utf8.h
  32. examples_seeking_example_SOURCES += examples/win32utf8.c examples/win32utf8.h
  33. endif
  34. pkgconfigdir = $(libdir)/pkgconfig
  35. pkgconfig_DATA = opusfile.pc opusurl.pc
  36. debug:
  37. $(MAKE) CFLAGS="${CFLAGS} -O0 -ggdb -DOP_ENABLE_ASSERTIONS" all
  38. EXTRA_DIST = \
  39. opusfile.pc.in \
  40. opusurl.pc.in \
  41. opusfile-uninstalled.pc.in \
  42. opusurl-uninstalled.pc.in \
  43. doc/Doxyfile.in \
  44. doc/opus_logo.svg \
  45. doc/Makefile \
  46. unix/Makefile \
  47. win32/VS2015/opusfile.sln \
  48. win32/VS2015/opusfile.vcxproj \
  49. win32/VS2015/opusfile.vcxproj.filters \
  50. win32/VS2015/opusfile_example.vcxproj \
  51. win32/VS2015/opusfile_example.vcxproj.filters \
  52. win32/VS2015/seeking_example.vcxproj \
  53. win32/VS2015/seeking_example.vcxproj.filters
  54. # Targets to build and install just the library without the docs
  55. opusfile install-opusfile: NO_DOXYGEN = 1
  56. opusfile: all
  57. install-opusfile: install
  58. # Or just the docs
  59. docs: doc/doxygen-build.stamp
  60. install-docs:
  61. @if [ -z "$(NO_DOXYGEN)" ]; then \
  62. ( cd doc && \
  63. echo "Installing documentation in $(DESTDIR)$(docdir)"; \
  64. $(INSTALL) -d $(DESTDIR)$(docdir)/html/search; \
  65. for f in `find html -type f \! -name "installdox"` ; do \
  66. $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f; \
  67. done ) \
  68. fi
  69. doc/doxygen-build.stamp: doc/Doxyfile $(top_srcdir)/doc/opus_logo.svg \
  70. $(top_srcdir)/include/*.h
  71. @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && doxygen && touch $(@F) )
  72. if HAVE_DOXYGEN
  73. # Or everything (by default)
  74. all-local: docs
  75. install-data-local: install-docs
  76. clean-local:
  77. $(RM) -r doc/html
  78. $(RM) -r doc/latex
  79. $(RM) doc/doxygen-build.stamp
  80. uninstall-local:
  81. $(RM) -r $(DESTDIR)$(docdir)/html
  82. endif
  83. # We check this every time make is run, with configure.ac being touched to
  84. # trigger an update of the build system files if update_version changes the
  85. # current PACKAGE_VERSION (or if package_version was modified manually by a
  86. # user with either AUTO_UPDATE=no or no update_version script present - the
  87. # latter being the normal case for tarball releases).
  88. #
  89. # We can't just add the package_version file to CONFIGURE_DEPENDENCIES since
  90. # simply running autoconf will not actually regenerate configure for us when
  91. # the content of that file changes (due to autoconf dependency checking not
  92. # knowing about that without us creating yet another file for it to include).
  93. #
  94. # The MAKECMDGOALS check is a gnu-make'ism, but will degrade 'gracefully' for
  95. # makes that don't support it. The only loss of functionality is not forcing
  96. # an update of package_version for `make dist` if AUTO_UPDATE=no, but that is
  97. # unlikely to be a real problem for any real user.
  98. $(top_srcdir)/configure.ac: force
  99. @case "$(MAKECMDGOALS)" in \
  100. dist-hook) exit 0 ;; \
  101. dist-* | dist | distcheck | distclean) _arg=release ;; \
  102. esac; \
  103. if ! $(top_srcdir)/update_version $$_arg 2> /dev/null; then \
  104. if [ ! -e $(top_srcdir)/package_version ]; then \
  105. echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
  106. fi; \
  107. . $(top_srcdir)/package_version || exit 1; \
  108. [ "$(PACKAGE_VERSION)" != "$$PACKAGE_VERSION" ] || exit 0; \
  109. fi; \
  110. touch $@
  111. force:
  112. # Create a minimal package_version file when make dist is run.
  113. dist-hook:
  114. echo 'PACKAGE_VERSION="$(PACKAGE_VERSION)"' > $(top_distdir)/package_version
  115. .PHONY: opusfile install-opusfile docs install-docs