Revert "Allow the examples to build with --disable-http"
[opusfile.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2
3 AM_CFLAGS = -I$(top_srcdir)/include $(DEPS_CFLAGS)
4
5 dist_doc_DATA = COPYING AUTHORS README.txt
6
7 opusincludedir = ${includedir}/opus
8 opusinclude_HEADERS = include/opusfile.h
9
10 lib_LTLIBRARIES = libopusfile.la libopusurl.la
11 libopusfile_la_SOURCES = \
12         src/info.c \
13         src/internal.c src/internal.h \
14         src/opusfile.c src/stream.c
15 libopusfile_la_LIBADD = $(DEPS_LIBS)
16 libopusfile_la_LDFLAGS = -no-undefined \
17  -version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@
18
19 libopusurl_la_SOURCES = src/http.c src/internal.c src/internal.h
20 libopusurl_la_LIBADD = libopusfile.la $(URL_DEPS_LIBS)
21 libopusurl_la_LDFLAGS = -no-undefined \
22  -version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@
23
24 if OP_ENABLE_HTTP
25 if OP_WIN32
26 libopusurl_la_SOURCES += src/wincerts.c
27 libopusurl_la_LIBADD += -lws2_32 -lcrypt32
28 endif
29 endif
30
31 noinst_PROGRAMS = examples/opusfile_example examples/seeking_example
32
33 examples_opusfile_example_LDADD = libopusurl.la libopusfile.la
34 examples_seeking_example_LDADD = libopusurl.la libopusfile.la
35
36 pkgconfigdir = $(libdir)/pkgconfig
37 pkgconfig_DATA = opusfile.pc opusurl.pc
38
39 debug:
40         $(MAKE) CFLAGS="${CFLAGS} -O0 -ggdb -DOP_ENABLE_ASSERTIONS" all
41
42 EXTRA_DIST = \
43  opusfile.pc.in \
44  opusurl.pc.in \
45  opusfile-uninstalled.pc.in \
46  opusurl-uninstalled.pc.in \
47  doc/Doxyfile.in \
48  doc/git-version.sh \
49  doc/opus_logo.svg \
50  doc/Makefile \
51  unix/Makefile
52
53 # Targets to build and install just the library without the docs
54 opusfile install-opusfile: NO_DOXYGEN = 1
55
56 opusfile: all
57 install-opusfile: install
58
59 # Or just the docs
60 docs: doc/doxygen-build.stamp
61
62 install-docs:
63         @if [ -z "$(NO_DOXYGEN)" ]; then \
64           ( cd doc && \
65             echo "Installing documentation in $(DESTDIR)$(docdir)"; \
66             for f in `find html -type f \! -name "installdox"` ; do \
67               $(INSTALL) -d $(DESTDIR)$(docdir)/html/search;   \
68               $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f;     \
69             done ) \
70         fi
71
72 doc/doxygen-build.stamp: doc/Doxyfile $(top_srcdir)/doc/opus_logo.svg \
73                          $(top_srcdir)/include/*.h
74         @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && doxygen && touch $(@F) )
75
76
77 if HAVE_DOXYGEN
78
79 # Or everything (by default)
80 all-local: docs
81
82 install-data-local: install-docs
83
84 clean-local:
85         $(RM) -r doc/html
86         $(RM) -r doc/latex
87         $(RM) doc/doxygen-build.stamp
88
89 uninstall-local:
90         $(RM) -r $(DESTDIR)$(docdir)/html
91
92 endif
93
94 .PHONY: opusfile install-opusfile docs install-docs