Makefile.am 4.58 KB
Newer Older
1 2 3 4
ACLOCAL_AMFLAGS = -I m4

AM_CFLAGS = -I$(top_srcdir)/include $(DEPS_CFLAGS)

Chocobo1's avatar
Chocobo1 committed
5
dist_doc_DATA = COPYING AUTHORS README.md
6

7 8
opusincludedir = ${includedir}/opus
opusinclude_HEADERS = include/opusfile.h
9

Ron's avatar
Ron committed
10
lib_LTLIBRARIES = libopusfile.la libopusurl.la
11
libopusfile_la_SOURCES = \
12
	src/info.c \
13 14
	src/internal.c src/internal.h \
	src/opusfile.c src/stream.c
Ron's avatar
Ron committed
15
libopusfile_la_LIBADD = $(DEPS_LIBS) $(lrintf_lib)
16 17
libopusfile_la_LDFLAGS = -no-undefined \
 -version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@
18

Ron's avatar
Ron committed
19
libopusurl_la_SOURCES = src/http.c src/internal.c src/internal.h
20
libopusurl_la_CFLAGS = $(AM_CFLAGS) $(URL_DEPS_CFLAGS)
21 22 23 24
libopusurl_la_LIBADD = libopusfile.la $(URL_DEPS_LIBS)
libopusurl_la_LDFLAGS = -no-undefined \
 -version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@

25
if OP_ENABLE_EXAMPLES
26
noinst_PROGRAMS = examples/opusfile_example examples/seeking_example
27
endif
28 29 30 31 32 33

examples_opusfile_example_SOURCES = examples/opusfile_example.c
examples_seeking_example_SOURCES = examples/seeking_example.c
examples_opusfile_example_LDADD = libopusurl.la libopusfile.la
examples_seeking_example_LDADD = libopusurl.la libopusfile.la

Timothy B. Terriberry's avatar
Timothy B. Terriberry committed
34
if OP_WIN32
35
if OP_ENABLE_HTTP
36
libopusurl_la_SOURCES += src/wincerts.c src/winerrno.h
37
libopusurl_la_LIBADD += -lws2_32 -lcrypt32
38
endif
39 40
examples_opusfile_example_SOURCES += examples/win32utf8.c examples/win32utf8.h
examples_seeking_example_SOURCES += examples/win32utf8.c examples/win32utf8.h
41 42
endif

Ron's avatar
Ron committed
43 44 45
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = opusfile.pc opusurl.pc

46 47 48
debug:
	$(MAKE) CFLAGS="${CFLAGS} -O0 -ggdb -DOP_ENABLE_ASSERTIONS" all

49 50
EXTRA_DIST = \
 opusfile.pc.in \
51
 opusurl.pc.in \
52
 opusfile-uninstalled.pc.in \
53
 opusurl-uninstalled.pc.in \
54
 doc/Doxyfile.in \
55 56
 doc/opus_logo.svg \
 doc/Makefile \
57
 unix/Makefile \
58 59 60 61 62 63 64
 win32/VS2015/opusfile.sln \
 win32/VS2015/opusfile.vcxproj \
 win32/VS2015/opusfile.vcxproj.filters \
 win32/VS2015/opusfile_example.vcxproj \
 win32/VS2015/opusfile_example.vcxproj.filters \
 win32/VS2015/seeking_example.vcxproj \
 win32/VS2015/seeking_example.vcxproj.filters
65

Ron's avatar
Ron committed
66
# Targets to build and install just the library without the docs
67
opusfile install-opusfile: NO_DOXYGEN = 1
68

Ron's avatar
Ron committed
69 70 71 72 73
opusfile: all
install-opusfile: install

# Or just the docs
docs: doc/doxygen-build.stamp
74

Ron's avatar
Ron committed
75 76 77 78
install-docs:
	@if [ -z "$(NO_DOXYGEN)" ]; then \
	  ( cd doc && \
	    echo "Installing documentation in $(DESTDIR)$(docdir)"; \
79
	    $(INSTALL) -d $(DESTDIR)$(docdir)/html/search; \
Ron's avatar
Ron committed
80 81 82 83
	    for f in `find html -type f \! -name "installdox"` ; do \
	      $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f;     \
	    done ) \
	fi
84

85
doc/doxygen-build.stamp: doc/Doxyfile $(top_srcdir)/doc/opus_logo.svg \
Ron's avatar
Ron committed
86 87
                         $(top_srcdir)/include/*.h
	@[ -n "$(NO_DOXYGEN)" ] || ( cd doc && doxygen && touch $(@F) )
88

Ron's avatar
Ron committed
89 90 91 92 93 94 95

if HAVE_DOXYGEN

# Or everything (by default)
all-local: docs

install-data-local: install-docs
96 97 98 99 100 101 102 103 104 105

clean-local:
	$(RM) -r doc/html
	$(RM) -r doc/latex
	$(RM) doc/doxygen-build.stamp

uninstall-local:
	$(RM) -r $(DESTDIR)$(docdir)/html

endif
Ron's avatar
Ron committed
106

Ron's avatar
Ron committed
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
# 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


Ron's avatar
Ron committed
143
.PHONY: opusfile install-opusfile docs install-docs