Revert "Allow the examples to build with --disable-http"
[opusfile.git] / Makefile.am
index ef7f650..c5fcecb 100644 (file)
@@ -4,42 +4,82 @@ AM_CFLAGS = -I$(top_srcdir)/include $(DEPS_CFLAGS)
 
 dist_doc_DATA = COPYING AUTHORS README.txt
 
-include_HEADERS = include/opusfile.h
+opusincludedir = ${includedir}/opus
+opusinclude_HEADERS = include/opusfile.h
 
-lib_LTLIBRARIES = libopusfile.la
+lib_LTLIBRARIES = libopusfile.la libopusurl.la
 libopusfile_la_SOURCES = \
-       src/http.c src/info.c \
+       src/info.c \
        src/internal.c src/internal.h \
        src/opusfile.c src/stream.c
 libopusfile_la_LIBADD = $(DEPS_LIBS)
 libopusfile_la_LDFLAGS = -no-undefined \
  -version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@
 
+libopusurl_la_SOURCES = src/http.c src/internal.c src/internal.h
+libopusurl_la_LIBADD = libopusfile.la $(URL_DEPS_LIBS)
+libopusurl_la_LDFLAGS = -no-undefined \
+ -version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@
+
+if OP_ENABLE_HTTP
+if OP_WIN32
+libopusurl_la_SOURCES += src/wincerts.c
+libopusurl_la_LIBADD += -lws2_32 -lcrypt32
+endif
+endif
+
 noinst_PROGRAMS = examples/opusfile_example examples/seeking_example
 
-examples_opusfile_example_LDADD = libopusfile.la
-examples_seeking_example_LDADD = libopusfile.la
+examples_opusfile_example_LDADD = libopusurl.la libopusfile.la
+examples_seeking_example_LDADD = libopusurl.la libopusfile.la
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = opusfile.pc opusurl.pc
 
 debug:
        $(MAKE) CFLAGS="${CFLAGS} -O0 -ggdb -DOP_ENABLE_ASSERTIONS" all
 
-#API Documentation
+EXTRA_DIST = \
+ opusfile.pc.in \
+ opusurl.pc.in \
+ opusfile-uninstalled.pc.in \
+ opusurl-uninstalled.pc.in \
+ doc/Doxyfile.in \
+ doc/git-version.sh \
+ doc/opus_logo.svg \
+ doc/Makefile \
+ unix/Makefile
+
+# Targets to build and install just the library without the docs
+opusfile install-opusfile: NO_DOXYGEN = 1
+
+opusfile: all
+install-opusfile: install
+
+# Or just the docs
+docs: doc/doxygen-build.stamp
+
+install-docs:
+       @if [ -z "$(NO_DOXYGEN)" ]; then \
+         ( cd doc && \
+           echo "Installing documentation in $(DESTDIR)$(docdir)"; \
+           for f in `find html -type f \! -name "installdox"` ; do \
+             $(INSTALL) -d $(DESTDIR)$(docdir)/html/search;   \
+             $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f;     \
+           done ) \
+       fi
 
-if HAVE_DOXYGEN
+doc/doxygen-build.stamp: doc/Doxyfile $(top_srcdir)/doc/opus_logo.svg \
+                         $(top_srcdir)/include/*.h
+       @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && doxygen && touch $(@F) )
 
-EXTRA_DIST = doc/Doxyfile.in doc/opus_logo.svg
 
-all-local: doc/doxygen-build.stamp
+if HAVE_DOXYGEN
 
-doc/doxygen-build.stamp: doc/Doxyfile $(top_srcdir)/doc/opus_logo.svg \
- $(top_srcdir)/include/*.h
-       cd doc && doxygen
-       touch "$@"
+# Or everything (by default)
+all-local: docs
 
-install-data-local:
-       cd doc && for f in `find html -type f \! -name "installdox"` ; do \
-         $(INSTALL_DATA) -D $$f $(DESTDIR)$(docdir)/$$f ; \
-       done
+install-data-local: install-docs
 
 clean-local:
        $(RM) -r doc/html
@@ -50,3 +90,5 @@ uninstall-local:
        $(RM) -r $(DESTDIR)$(docdir)/html
 
 endif
+
+.PHONY: opusfile install-opusfile docs install-docs