[mousetrap/gnome3-wip: 177/240] Generate AUTHORS and ChangeLog when `make dist` is run.



commit 99184f43b772d4ca9fa9f9f645dbee6ee78d349b
Author: Stoney Jackson <dr stoney gmail com>
Date:   Thu Jun 26 23:11:15 2014 -0400

    Generate AUTHORS and ChangeLog when `make dist` is run.

 AUTHORS              |    2 -
 ChangeLog            |    2 -
 Makefile.am          |   58 ++++++++++++++++++++++++++++++++++++-------------
 bin/mt-gen-AUTHORS   |   15 ++++++++----
 bin/mt-gen-ChangeLog |   11 +++++++--
 5 files changed, 60 insertions(+), 28 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 3f9e3b7..7353132 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,37 +1,63 @@
-# Standard targets generated by automake
-# Source: http://www.gnu.org/software/automake/manual/automake.html#Standard-Targets
-#
-# make all -  Build programs, libraries, documentation, etc. (same as make).
-# make install - Install what needs to be installed, copying the files from the package’s tree to 
system-wide directories.
-# make install-strip -  Same as make install, then strip debugging symbols. Some users like to trade space 
for useful bug reports...
-# make uninstall - The opposite of make install: erase the installed files. (This needs to be run from the 
same build tree that was installed.)
-# make clean -  Erase from the build tree the files built by make all.
-# make distclean -   Additionally erase anything ./configure created.
-# make check -    Run the test suite, if any.
-# make installcheck -    Check the installed programs or libraries, if supported.
-# make dist -     Recreate package-version.tar.gz from all the source files.
-
 mousetrapdir=$(pkgpythondir)
 
 EXTRA_DIST= \
        setup.py \
        src/mousetrap
 
+
+##############################################################################
+# TARGET: all
+
 all-local:
-       $(PYTHON) $(srcdir)/setup.py build --build-base $(builddir)/build --verbose
+       $(PYTHON) $(srcdir)/setup.py build \
+               --build-base $(builddir)/build \
+               --verbose
+
+
+##############################################################################
+# TARGET: dist
+
+dist-hook: gen-ChangeLog gen-AUTHORS del-pyc
+
+.PHONY: gen-ChangeLog gen-AUTHORS del-pyc
+gen-ChangeLog:
+       $(top_srcdir)/bin/mt-gen-ChangeLog $(distdir)/ChangeLog
+
+gen-AUTHORS:
+       $(top_srcdir)/bin/mt-gen-AUTHORS $(distdir)/AUTHORS
 
-dist-hook:
+del-pyc:
        find . -name '*.pyc' -delete
 
+
+##############################################################################
+# TARGET: install
+
 install-exec-local:
-       $(PYTHON) $(srcdir)/setup.py install --prefix $(DESTDIR)$(prefix) --single-version-externally-managed 
--record $(DESTDIR)$(pkgpythondir)/install_files.txt --verbose
+       $(PYTHON) $(srcdir)/setup.py install \
+               --prefix $(DESTDIR)$(prefix) \
+               --single-version-externally-managed \
+               --record $(DESTDIR)$(pkgpythondir)/install_files.txt \
+               --verbose
+
+
+##############################################################################
+# TARGET: uninstall
 
 uninstall-local:
        cat $(DESTDIR)$(pkgpythondir)/install_files.txt | xargs rm -rf
        rm -r $(DESTDIR)$(pkgpythondir)
 
+
+##############################################################################
+# TARGET: clean
+
 clean-local:
        $(PYTHON) $(srcdir)/setup.py clean --all
 
+
+##############################################################################
+# TARGET: distclean
+
 distclean-local:
        rm -rf $(builddir)/mousetrap.egg-info
diff --git a/bin/mt-gen-AUTHORS b/bin/mt-gen-AUTHORS
index 377a998..be744f5 100755
--- a/bin/mt-gen-AUTHORS
+++ b/bin/mt-gen-AUTHORS
@@ -1,9 +1,14 @@
 #!/usr/bin/env bash
 (
+    if [ -z "$1" ] ; then
+        echo "$0: No out file specified."
+        exit 1
+    fi
+    echo Generating "$1"
     source "$(dirname "$0")/mt-define-mousetrap-home"
     cd "$MOUSETRAP_HOME"
-    echo "# Generated by `basename $0`" > AUTHORS
-    echo "# Do not edit." >> AUTHORS
-    echo "Commits Author" >> AUTHORS
-    git shortlog -s -e -n | sed 's/@/ AT /g' | sed 's/\./ DOT /g' >> AUTHORS
-    )
+    echo "# Generated by `basename $0`" > "$1"
+    echo "# Do not edit." >> "$1"
+    echo "Commits Author" >> "$1"
+    git shortlog -s -e -n | sed 's/@/ AT /g' | sed 's/\./ DOT /g' >> "$1"
+)
diff --git a/bin/mt-gen-ChangeLog b/bin/mt-gen-ChangeLog
index 092c878..54a5b43 100755
--- a/bin/mt-gen-ChangeLog
+++ b/bin/mt-gen-ChangeLog
@@ -1,8 +1,13 @@
 #!/usr/bin/env bash
 (
+    if [ -z "$1" ] ; then
+        echo "$0: No out file specified."
+        exit 1
+    fi
+    echo Generating "$1"
     source "$(dirname "$0")/mt-define-mousetrap-home"
     cd "$MOUSETRAP_HOME"
-    echo "# Generated by `basename "$0"`" > ChangeLog
-    echo "# Do not edit." >> ChangeLog
-    git log --stat >> ChangeLog
+    echo "# Generated by `basename "$0"`" > "$1"
+    echo "# Do not edit." >> "$1"
+    git log --stat >> "$1"
 )


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]