Makefile.am 4.5 KB

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