From b6512b444db0ff1405b5054a89b62dcbf083a3bc Mon Sep 17 00:00:00 2001
From: Ron <ron@debian.org>
Date: Mon, 21 May 2012 23:16:39 +0930
Subject: [PATCH] Enable building just the library (or just the docs)

Both are still built and installed by default though.
---
 Makefile.am | 40 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 37 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 92766f5a3..6f51f51a3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,8 +2,6 @@ AUTOMAKE_OPTIONS = subdir-objects
 
 lib_LTLIBRARIES = libopus.la
 
-SUBDIRS = . doc
-
 INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/celt -I$(top_srcdir)/silk -I$(top_srcdir)/silk/float -I$(top_srcdir)/silk/fixed
 
 include celt_sources.mk
@@ -81,7 +79,43 @@ opus_custom_demo_SOURCES = celt/opus_custom_demo.c
 opus_custom_demo_LDADD = libopus.la -lm
 endif
 
-EXTRA_DIST = opus.pc.in opus-uninstalled.pc.in
+EXTRA_DIST = opus.pc.in opus-uninstalled.pc.in doc
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = opus.pc
+
+
+# Targets to build and install just the library without the docs
+opus check-opus install-opus: export NO_DOXYGEN = 1
+
+opus: all
+check-opus: check
+install-opus: install
+
+
+# Or just the docs
+docs:
+	$(MAKE) $(AM_MAKEFLAGS) -C doc
+
+install-docs:
+	$(MAKE) $(AM_MAKEFLAGS) -C doc install
+
+
+# Or everything (by default)
+all-local:
+	@[ -n "$(NO_DOXYGEN)" ] || $(MAKE) $(AM_MAKEFLAGS) -C doc
+
+install-data-local:
+	@[ -n "$(NO_DOXYGEN)" ] || $(MAKE) $(AM_MAKEFLAGS) -C doc install
+
+clean-local:
+	$(MAKE) $(AM_MAKEFLAGS) -C doc clean
+
+distclean-local:
+	$(MAKE) $(AM_MAKEFLAGS) -C doc distclean
+
+uninstall-local:
+	$(MAKE) $(AM_MAKEFLAGS) -C doc uninstall
+
+
+.PHONY: opus check-opus install-opus docs install-docs
-- 
GitLab