Enable automatic generation of .gitignore
authorP. F. Chimento <philip.chimento@gmail.com>
Wed, 8 Jun 2011 20:46:32 +0000 (22:46 +0200)
committerP. F. Chimento <philip.chimento@gmail.com>
Wed, 8 Jun 2011 20:46:32 +0000 (22:46 +0200)
Using git.mk in toplevel dir

23 files changed:
.gitignore [deleted file]
Makefile.am
docs/.gitignore [deleted file]
docs/Makefile.am
docs/reference/.gitignore [deleted file]
docs/reference/Makefile.am
git.mk [new file with mode: 0644]
interpreters/.gitignore [deleted file]
interpreters/Makefile.am
interpreters/frotz/.gitignore [deleted file]
interpreters/frotz/Makefile.am
interpreters/git/.gitignore [deleted file]
interpreters/git/Makefile.am
interpreters/glulxe/.gitignore [deleted file]
interpreters/glulxe/Makefile.am
interpreters/nitfol/.gitignore [deleted file]
interpreters/nitfol/Makefile.am
libchimara/.gitignore [deleted file]
libchimara/Makefile.am
player/.gitignore [deleted file]
player/Makefile.am
tests/.gitignore [deleted file]
tests/Makefile.am

diff --git a/.gitignore b/.gitignore
deleted file mode 100644 (file)
index 13462f6..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-ABOUT-NLS
-INSTALL
-Makefile
-Makefile.in
-aclocal.m4
-autom4te.cache
-chimara-plugin.pc
-chimara.pc
-chimara.spec
-compile
-config.*
-configure
-depcomp
-gtk-doc.make
-install-sh
-libtool
-ltmain.sh
-m4
-missing
-stamp-h1
-ylwrap
-*.anjuta*
-TODO.tasks
-intltool-*.in
-*~
index 9cac9d78b8ebefaafd01706e9f3d7588197ee701..a163df8615b21d7b7febdb4276ca437707fa7070 100644 (file)
@@ -22,6 +22,11 @@ EXTRA_DIST = chimara.pc.in chimara-plugin.pc.in chimara.spec.in
 
 DISTCLEANFILES = chimara.pc chimara-plugin.pc chimara.spec
 
+MAINTAINERCLEANFILES = ABOUT-NLS INSTALL aclocal.m4 compile config.guess \
+       config.h.in config.rpath config.sub depcomp gtk-doc.make install-sh \
+       intltool-extract.in     intltool-merge.in intltool-update.in ltmain.sh missing \
+       ylwrap m4 autom4te.cache
+
 ACLOCAL_AMFLAGS = -I m4
 
 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
@@ -37,3 +42,5 @@ rpm:
        "To build an RPM package, you must run configure with --enable-rpm."; \
        exit 1
 endif
+
+-include $(top_srcdir)/git.mk
diff --git a/docs/.gitignore b/docs/.gitignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
index b68c77455a65df28ee32ea52daab2327f9da300e..372c2a7a1f8e34ed75bc0858c2ae857bad6fc775 100644 (file)
@@ -1 +1,3 @@
 SUBDIRS=reference
+
+-include $(top_srcdir)/git.mk
diff --git a/docs/reference/.gitignore b/docs/reference/.gitignore
deleted file mode 100644 (file)
index e16f857..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-.libs
-Makefile
-Makefile.in
-build-selector-table.pl
-chimara-decl-list.txt
-chimara-decl.txt
-chimara-overrides.txt
-chimara-undeclared.txt
-chimara-undocumented.txt
-chimara-unused.txt
-chimara.args
-chimara.hierarchy
-chimara.interfaces
-chimara.prerequisites
-chimara.signals
-*.stamp
-html
-selectors.xml
-version.xml
-xml
index ccb250bb9a55d759dbc85d6f1fae96e4438d0f2c..7994e0e828c931c8b5f0aa23fbff0262af198dc0 100644 (file)
@@ -141,3 +141,5 @@ dist_noinst_SCRIPTS = build-selector-table.pl
 selectors.xml: $(srcdir)/../../libchimara/gi_dispa.c
        $(PERL) build-selector-table.pl $< > $@
 
+
+-include $(top_srcdir)/git.mk
diff --git a/git.mk b/git.mk
new file mode 100644 (file)
index 0000000..abd6c0a
--- /dev/null
+++ b/git.mk
@@ -0,0 +1,200 @@
+# git.mk
+#
+# Copyright 2009, Red Hat, Inc.
+# Written by Behdad Esfahbod
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.
+#
+# The canonical source for this file is pango/git.mk, or whereever the
+# header of pango/git.mk suggests in the future.
+#
+# To use in your project, import this file in your git repo's toplevel,
+# then do "make -f git.mk".  This modifies all Makefile.am files in
+# your project to include git.mk.
+#
+# This enables automatic .gitignore generation.  If you need to ignore
+# more files, add them to the GITIGNOREFILES variable in your Makefile.am.
+# But think twice before doing that.  If a file has to be in .gitignore,
+# chances are very high that it's a generated file and should be in one
+# of MOSTLYCLEANFILES, CLEANFILES, DISTCLEANFILES, or MAINTAINERCLEANFILES.
+#
+# The only case that you need to manually add a file to GITIGNOREFILES is
+# when remove files in one of mostlyclean-local, clean-local, distclean-local,
+# or maintainer-clean-local.
+#
+# Note that for files like editor backup, etc, there are better places to
+# ignore them.  See "man gitignore".
+#
+# If "make maintainer-clean" removes the files but they are not recognized
+# by this script (that is, if "git status" shows untracked files still), send
+# me the output of "git status" as well as your Makefile.am and Makefile for
+# the directories involved.
+#
+# For a list of toplevel files that should be in MAINTAINERCLEANFILES, see
+# pango/Makefile.am.
+#
+# Don't EXTRA_DIST this file.  It is supposed to only live in git clones,
+# not tarballs.  It serves no useful purpose in tarballs and clutters the
+# build dir.
+#
+# This file knows how to handle autoconf, automake, libtool, gtk-doc,
+# gnome-doc-utils, mallard, intltool, gsettings.
+#
+#
+# KNOWN ISSUES:
+#
+# - Recursive configure doesn't work as $(top_srcdir)/git.mk inside the
+#   submodule doesn't find us.  If you have configure.{in,ac} files in
+#   subdirs, add a proxy git.mk file in those dirs that simply does:
+#   "include $(top_srcdir)/../git.mk".  Add more ..'s to your taste.
+#   And add those files to git.  See vte/gnome-pty-helper/git.mk for
+#   example.
+#
+# ChangeLog
+#
+# - 2010-12-06 Add support for Mallard docs
+# - 2010-12-06 Start this change log
+
+git-all: git-mk-install
+
+git-mk-install:
+       @echo Installing git makefile
+       @any_failed=; find $(top_srcdir) -name Makefile.am | while read x; do \
+               if grep 'include .*/git.mk' $$x >/dev/null; then \
+                       echo $$x already includes git.mk; \
+               else \
+                       failed=; \
+                       echo "Updating $$x"; \
+                       { cat $$x; \
+                         echo ''; \
+                         echo '-include $$(top_srcdir)/git.mk'; \
+                       } > $$x.tmp || failed=1; \
+                       if test x$$failed = x; then \
+                               mv $$x.tmp $$x || failed=1; \
+                       fi; \
+                       if test x$$failed = x; then : else \
+                               echo Failed updating $$x; >&2 \
+                               any_failed=1; \
+                       fi; \
+       fi; done; test -z "$$any_failed"
+
+.PHONY: git-all git-mk-install
+
+
+### .gitignore generation
+
+$(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
+       $(AM_V_GEN) \
+       { \
+               if test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x; then :; else \
+                       for x in \
+                               $(DOC_MODULE)-decl-list.txt \
+                               $(DOC_MODULE)-decl.txt \
+                               tmpl/$(DOC_MODULE)-unused.sgml \
+                               "tmpl/*.bak" \
+                               xml html \
+                       ; do echo /$$x; done; \
+               fi; \
+               if test "x$(DOC_MODULE)$(DOC_ID)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \
+                       for x in \
+                               $(_DOC_C_DOCS) \
+                               $(_DOC_LC_DOCS) \
+                               $(_DOC_OMF_ALL) \
+                               $(_DOC_DSK_ALL) \
+                               $(_DOC_HTML_ALL) \
+                               $(_DOC_MOFILES) \
+                               $(_DOC_POFILES) \
+                               $(DOC_H_FILE) \
+                               "*/.xml2po.mo" \
+                               "*/*.omf.out" \
+                       ; do echo /$$x; done; \
+               fi; \
+               if test "x$(gsettings_SCHEMAS)" = x; then :; else \
+                       for x in \
+                               $(gsettings_SCHEMAS:.xml=.valid) \
+                               $(gsettings__enum_file) \
+                       ; do echo /$$x; done; \
+               fi; \
+               if test -f $(srcdir)/po/Makefile.in.in; then \
+                       for x in \
+                               po/Makefile.in.in \
+                               po/Makefile.in \
+                               po/Makefile \
+                               po/POTFILES \
+                               po/stamp-it \
+                               po/.intltool-merge-cache \
+                               "po/*.gmo" \
+                               "po/*.mo" \
+                               po/$(GETTEXT_PACKAGE).pot \
+                               intltool-extract.in \
+                               intltool-merge.in \
+                               intltool-update.in \
+                       ; do echo /$$x; done; \
+               fi; \
+               if test -f $(srcdir)/configure; then \
+                       for x in \
+                               autom4te.cache \
+                               configure \
+                               config.h \
+                               stamp-h1 \
+                               libtool \
+                               config.lt \
+                       ; do echo /$$x; done; \
+               fi; \
+               for x in \
+                       .gitignore \
+                       $(GITIGNOREFILES) \
+                       $(CLEANFILES) \
+                       $(PROGRAMS) \
+                       $(check_PROGRAMS) \
+                       $(EXTRA_PROGRAMS) \
+                       $(LTLIBRARIES) \
+                       so_locations \
+                       .libs _libs \
+                       $(MOSTLYCLEANFILES) \
+                       "*.$(OBJEXT)" \
+                       "*.lo" \
+                       $(DISTCLEANFILES) \
+                       $(am__CONFIG_DISTCLEAN_FILES) \
+                       $(CONFIG_CLEAN_FILES) \
+                       TAGS ID GTAGS GRTAGS GSYMS GPATH tags \
+                       "*.tab.c" \
+                       $(MAINTAINERCLEANFILES) \
+                       $(BUILT_SOURCES) \
+                       $(DEPDIR) \
+                       Makefile \
+                       Makefile.in \
+                       "*.orig" \
+                       "*.rej" \
+                       "*.bak" \
+                       "*~" \
+                       ".*.sw[nop]" \
+                       ".dirstamp" \
+               ; do echo /$$x; done; \
+       } | \
+       sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \
+       sed 's@/[.]/@/@g' | \
+       LC_ALL=C sort | uniq > $@.tmp && \
+       mv $@.tmp $@;
+
+all: $(srcdir)/.gitignore gitignore-recurse-maybe
+gitignore-recurse-maybe:
+       @if test "x$(SUBDIRS)" = "x$(DIST_SUBDIRS)"; then :; else \
+               $(MAKE) $(AM_MAKEFLAGS) gitignore-recurse; \
+       fi;
+gitignore-recurse:
+       @for subdir in $(DIST_SUBDIRS); do \
+         case " $(SUBDIRS) " in \
+           *" $$subdir "*) :;; \
+           *) test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir");; \
+         esac; \
+       done
+gitignore: $(srcdir)/.gitignore gitignore-recurse
+
+maintainer-clean: gitignore-clean
+gitignore-clean:
+       -rm -f $(srcdir)/.gitignore
+
+.PHONY: gitignore-clean gitignore gitignore-recurse gitignore-recurse-maybe
diff --git a/interpreters/.gitignore b/interpreters/.gitignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
index 2e8fc836e286976932fd6d65cfcf89d0f18859f5..0b1cb2e11122dd9bc68e7b9ccc42d5333c5db126 100644 (file)
@@ -1 +1,3 @@
 SUBDIRS=nitfol frotz glulxe git
+
+-include $(top_srcdir)/git.mk
diff --git a/interpreters/frotz/.gitignore b/interpreters/frotz/.gitignore
deleted file mode 100644 (file)
index de64204..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-frotz.la
-*.o
-*.lo
-
index fdecc89e04ce59d310081152b6bb8106e40d3801..16c91a62c72675c548a96f37870c940fed41fad1 100644 (file)
@@ -16,3 +16,5 @@ frotz_la_LDFLAGS = -module $(PLUGIN_LIBTOOL_FLAGS)
 
 frotzdocdir = $(datadir)/doc/$(PACKAGE)/frotz
 dist_frotzdoc_DATA = AUTHORS COPYING README TODO
+
+-include $(top_srcdir)/git.mk
diff --git a/interpreters/git/.gitignore b/interpreters/git/.gitignore
deleted file mode 100644 (file)
index 2389b6c..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-git.la
-*.o
-*.lo
-
index 89642c8f1304cf2bb8d82d5686ab36b84415a83c..bbed8c42cbe4ee7c7b2f58d5b11d2c25ad72603d 100644 (file)
@@ -44,3 +44,5 @@ CLEANFILES = version.h test/*.tmp
 # Mac OS X (PowerPC) settings.
 #CC = gcc2 -Wall -O3 -no-cpp-precomp
 #OPTIONS = -DUSE_DIRECT_THREADING -DUSE_BIG_ENDIAN_UNALIGNED -DUSE_MMAP -DUSE_INLINE
+
+-include $(top_srcdir)/git.mk
diff --git a/interpreters/glulxe/.gitignore b/interpreters/glulxe/.gitignore
deleted file mode 100644 (file)
index 366ab74..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-glulxe.la
-*.o
-*.lo
-
index 152e8d03016dfb50310c2ec55a41e9a21bd8318d..f3da057f77f9070dcf998c80aad69ce06e64beda 100644 (file)
@@ -16,3 +16,5 @@ dist_pkglibexec_SCRIPTS = profile-analyze.py
 
 glulxedocdir = $(datadir)/doc/$(PACKAGE)/glulxe
 dist_glulxedoc_DATA = README
+
+-include $(top_srcdir)/git.mk
diff --git a/interpreters/nitfol/.gitignore b/interpreters/nitfol/.gitignore
deleted file mode 100644 (file)
index b6895fe..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-copying.c
-dbg_help.h
-inform.c
-nitfol.info
-nitfol.la
-*.o
-*.lo
-*.texi
-startunix.c
-texinfo.tex
index c1dca0f6b52e553abe98f1fe2f2bbf630414dc5e..a54d42a2df2bd788d1ad30df833871a7d5a3dd4f 100644 (file)
@@ -29,7 +29,9 @@ nitfol_TEXINFOS = dbg_help.texi options.texi
 # man_MANS = nitfol.6
 
 BUILT_SOURCES = copying.c dbg_help.h startunix.c dbg_help.texi options.texi
-CLEANFILES = $(BUILT_SOURCES) nitfol.6 
+CLEANFILES = $(BUILT_SOURCES) nitfol.6
+DISTCLEANFILES = inform.c nitfol.info
+MAINTAINERCLEANFILES = texinfo.tex
 
 dbg_help.h: inform.y y2help.pl
        $(AM_V_GEN)$(PERL) $(srcdir)/y2help.pl $(srcdir)/inform.y
@@ -53,3 +55,5 @@ EXTRA_DIST = nitfol.opt crashme.inf test.inf
 
 nitfoldocdir = $(datadir)/doc/$(PACKAGE)/nitfol
 dist_nitfoldoc_DATA = ChangeLog COPYING INSTALL README
+
+-include $(top_srcdir)/git.mk
diff --git a/libchimara/.gitignore b/libchimara/.gitignore
deleted file mode 100644 (file)
index 23ef07f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-chimara-marshallers.[ch]
-libchimara.la
-*.o
-*.lo
-
index 65b84bb23e6b7ed9da2eecd4dce610d17dcb4418..3f98d0898082f8a1b2ae40bc2ffbd763e221f27c 100644 (file)
@@ -71,3 +71,5 @@ chimara-marshallers.h: chimara-marshallers.txt
        $(AM_V_GEN)glib-genmarshal --header --prefix=_chimara_marshal $< > $@
 
 EXTRA_DIST = doc.c glkstart.c chimara-marshallers.txt
+
+-include $(top_srcdir)/git.mk
diff --git a/player/.gitignore b/player/.gitignore
deleted file mode 100644 (file)
index ec0fa4d..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-*.o
-chimara
-chimara.menus
-*.gschema.valid
index 89a9655365e66dbc45dbe38ae8e30615aced4e4f..2482798027e91e91212bf89dfa0df9fec4b0c3a2 100644 (file)
@@ -29,4 +29,5 @@ gsettings_SCHEMAS = org.chimara-if.gschema.xml
 
 endif
 
-EXTRA_DIST = $(gsettings_SCHEMAS)
\ No newline at end of file
+EXTRA_DIST = $(gsettings_SCHEMAS)
+-include $(top_srcdir)/git.mk
diff --git a/tests/.gitignore b/tests/.gitignore
deleted file mode 100644 (file)
index 8de7f56..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-*.o
-*.lo
-*.la
-glulxercise
-plugin-loader
-test-multisession
-test-close
index d00d91149de4035983209657221920497096bb1f..f2f1e872d9676d4c6b556fe43009c1ffe8df7850 100644 (file)
@@ -56,3 +56,5 @@ test_userstyle_la_LDFLAGS = $(TEST_PLUGIN_LIBTOOL_FLAGS)
 soundtest_la_SOURCES = soundtest.c
 soundtest_la_LDFLAGS = $(TEST_PLUGIN_LIBTOOL_FLAGS)
 
+
+-include $(top_srcdir)/git.mk