bash_completion: Move common code into function
[ganeti-local] / Makefile.am
index a62a3e4..dd6d0bd 100644 (file)
@@ -45,7 +45,8 @@ DIRS = \
 
 MAINTAINERCLEANFILES = \
        $(docpng) \
 
 MAINTAINERCLEANFILES = \
        $(docpng) \
-       $(maninput)
+       $(maninput) \
+       doc/news.rst
 
 maintainer-clean-local:
        rm -rf doc/api doc/html
 
 maintainer-clean-local:
        rm -rf doc/api doc/html
@@ -148,7 +149,8 @@ docrst = \
        doc/install.rst \
        doc/locking.rst \
        doc/rapi.rst \
        doc/install.rst \
        doc/locking.rst \
        doc/rapi.rst \
-       doc/security.rst
+       doc/security.rst \
+       doc/news.rst
 
 doc/html/.stamp: $(docrst) $(docpng) doc/conf.py configure.ac
        @test -n "$(SPHINX)" || \
 
 doc/html/.stamp: $(docrst) $(docpng) doc/conf.py configure.ac
        @test -n "$(SPHINX)" || \
@@ -163,6 +165,14 @@ doc/html/.stamp: $(docrst) $(docpng) doc/conf.py configure.ac
 
 doc/html: doc/html/.stamp
 
 
 doc/html: doc/html/.stamp
 
+doc/news.rst: NEWS
+       set -e; \
+       { echo '.. This file is automatically updated at build time from $<.'; \
+         echo '.. Do not edit.'; \
+         echo; \
+         cat $<; \
+       } > $@
+
 docdot = \
        doc/arch-2.0.dot \
        doc/design-2.1-lock-acquire.dot \
 docdot = \
        doc/arch-2.0.dot \
        doc/design-2.1-lock-acquire.dot \
@@ -170,7 +180,16 @@ docdot = \
 
 docpng = $(patsubst %.dot,%.png,$(docdot))
 
 
 docpng = $(patsubst %.dot,%.png,$(docdot))
 
-noinst_DATA = $(manhtml) doc/html
+# Things to build but not to install (add it to EXTRA_DIST if it should be
+# distributed)
+noinst_DATA = \
+       devel/upload \
+       doc/html \
+       doc/examples/bash_completion \
+       doc/examples/ganeti.cron \
+       doc/examples/ganeti.initd \
+       doc/examples/hooks/ipsec \
+       $(manhtml)
 
 gnt_scripts = \
        scripts/gnt-backup \
 
 gnt_scripts = \
        scripts/gnt-backup \
@@ -199,7 +218,6 @@ dist_tools_SCRIPTS = \
        tools/lvmstrap
 
 EXTRA_DIST = \
        tools/lvmstrap
 
 EXTRA_DIST = \
-       $(MAINTAINERCLEANFILES) \
        NEWS \
        pylintrc \
        autotools/build-bash-completion \
        NEWS \
        pylintrc \
        autotools/build-bash-completion \
@@ -209,6 +227,7 @@ EXTRA_DIST = \
        daemons/ganeti-cleaner.in \
        devel/upload.in \
        $(docdot) \
        daemons/ganeti-cleaner.in \
        devel/upload.in \
        $(docdot) \
+       $(docpng) \
        $(docrst) \
        doc/conf.py \
        doc/html \
        $(docrst) \
        doc/conf.py \
        doc/html \
@@ -222,7 +241,8 @@ EXTRA_DIST = \
        $(dist_TESTS) \
        $(TEST_FILES) \
        man/footer.sgml \
        $(dist_TESTS) \
        $(TEST_FILES) \
        man/footer.sgml \
-       $(mansgml) $(maninput) \
+       $(mansgml) \
+       $(maninput) \
        qa/ganeti-qa.py \
        qa/qa-sample.json \
        qa/qa_cluster.py \
        qa/ganeti-qa.py \
        qa/qa-sample.json \
        qa/qa_cluster.py \
@@ -256,7 +276,9 @@ man_MANS = \
 
 mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
 manhtml = $(patsubst %.sgml,%.html,$(mansgml))
 
 mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
 manhtml = $(patsubst %.sgml,%.html,$(mansgml))
-maninput = $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) $(patsubst %.html,%.html.in,$(manhtml))
+maninput = \
+       $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
+       $(patsubst %.html,%.html.in,$(manhtml))
 
 TEST_FILES = \
        test/data/bdev-both.txt \
 
 TEST_FILES = \
        test/data/bdev-both.txt \
@@ -312,11 +334,6 @@ srclink_files = \
 check_python_code = \
        $(all_python_code)
 
 check_python_code = \
        $(all_python_code)
 
-all-local: devel/upload \
-       doc/examples/bash_completion \
-       doc/examples/ganeti.initd doc/examples/ganeti.cron \
-       doc/examples/hooks/ipsec
-
 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
        sed -f $(REPLACE_VARS_SED) < $< > $@
        chmod u+x $@
 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
        sed -f $(REPLACE_VARS_SED) < $< > $@
        chmod u+x $@
@@ -343,11 +360,13 @@ doc/%.png: doc/%.dot
        $(DOT) -Tpng -o $@ $<
 
 man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
        $(DOT) -Tpng -o $@ $<
 
 man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
-       @test -n "$(DOCBOOK2MAN)" || { echo 'docbook2man' not found during configure; exit 1; }
+       @test -n "$(DOCBOOK2MAN)" || \
+         { echo 'docbook2man' not found during configure; exit 1; }
        $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
 
 man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
        $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
 
 man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
-       @test -n "$(DOCBOOK2HTML)" || { echo 'docbook2html' not found during configure; exit 1; }
+       @test -n "$(DOCBOOK2HTML)" || \
+         { echo 'docbook2html' not found during configure; exit 1; }
        $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
 
 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
        $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
 
 man/%.7: man/%.7.in $(REPLACE_VARS_SED)