shithub: opusfile

Download patch

ref: 009e82533442d8d63632ac867c91da9e846725d5
parent: 9502cd843681e20d9454e5a6fba7713beadb12b5
author: Ron <ron@debian.org>
date: Sun Nov 11 17:09:29 EST 2012

Add some extra makefile targets

The opusfile and install-opusfile targets let us build and install just
the library (without the docs, even if doxygen is present and enabled).

The docs and install-docs targets let us build and install just the docs
without the library.

The default for make and make install remains to build both if doxgen
is present and enabled.

Signed-off-by: Ralph Giles <giles@mozilla.com>

--- a/Makefile.am
+++ b/Makefile.am
@@ -34,23 +34,37 @@
  doc/git-version.sh \
  doc/opus_logo.svg
 
-#API Documentation
+# Targets to build and install just the library without the docs
+opusfile install-opusfile: export NO_DOXYGEN = 1
 
-if HAVE_DOXYGEN
+opusfile: all
+install-opusfile: install
 
-all-local: doc/doxygen-build.stamp
+# 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
+
 doc/doxygen-build.stamp: doc/Doxyfile $(top_srcdir)/doc/opus_logo.svg \
- $(top_srcdir)/include/*.h
-	cd doc && doxygen
-	touch "$@"
+                         $(top_srcdir)/include/*.h
+	@[ -n "$(NO_DOXYGEN)" ] || ( cd doc && doxygen && touch $(@F) )
 
-install-data-local:
-	cd doc && for f in `find html -type f \! -name "installdox"` ; do \
-         $(INSTALL) -d $(DESTDIR)$(docdir)/html/search;   \
-         $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f;     \
-	done
 
+if HAVE_DOXYGEN
+
+# Or everything (by default)
+all-local: docs
+
+install-data-local: install-docs
+
 clean-local:
 	$(RM) -r doc/html
 	$(RM) -r doc/latex
@@ -60,3 +74,5 @@
 	$(RM) -r $(DESTDIR)$(docdir)/html
 
 endif
+
+.PHONY: opusfile install-opusfile docs install-docs