[gnome-control-center] Automatically generate .gitignore files with git.mk



commit 5d882a3bdde1c4988b87dcbba2cbb7806fe80f42
Author: Thomas Wood <thos gnome org>
Date:   Thu Jul 16 00:38:51 2009 +0100

    Automatically generate .gitignore files with git.mk
    
    Add git.mk and include it in all Makefiles to generate .gitignore files

 .gitignore                                       |    8 -
 Makefile.am                                      |    2 +
 capplets/Makefile.am                             |    2 +
 capplets/about-me/Makefile.am                    |    2 +
 capplets/about-me/icons/Makefile.am              |    2 +
 capplets/accessibility/Makefile.am               |    2 +
 capplets/accessibility/at-properties/Makefile.am |    2 +
 capplets/appearance/Makefile.am                  |    2 +
 capplets/appearance/data/Makefile.am             |    2 +
 capplets/common/Makefile.am                      |    2 +
 capplets/default-applications/Makefile.am        |    2 +
 capplets/display/Makefile.am                     |    2 +
 capplets/keybindings/Makefile.am                 |    2 +
 capplets/keyboard/Makefile.am                    |    2 +
 capplets/localization/Makefile.am                |    3 +-
 capplets/mouse/Makefile.am                       |    2 +
 capplets/network/Makefile.am                     |    2 +
 capplets/windows/Makefile.am                     |    2 +
 font-viewer/Makefile.am                          |    2 +
 git.mk                                           |  182 ++++++++++++++++++++++
 help/Makefile.am                                 |    2 +
 libslab/Makefile.am                              |    2 +
 libwindow-settings/Makefile.am                   |    2 +
 shell/Makefile.am                                |    2 +
 typing-break/Makefile.am                         |    2 +
 25 files changed, 228 insertions(+), 9 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 25d9aaa..26afa74 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,3 +18,5 @@ EXTRA_DIST = \
 	gnome-doc-utils.make
 
 DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper --disable-update-mimedb
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/Makefile.am b/capplets/Makefile.am
index f83a847..d88c1d3 100644
--- a/capplets/Makefile.am
+++ b/capplets/Makefile.am
@@ -21,3 +21,5 @@ endif
 
 DIST_SUBDIRS = \
 	$(always_built_SUBDIRS) display about-me
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/about-me/Makefile.am b/capplets/about-me/Makefile.am
index 0b38dae..4690b64 100644
--- a/capplets/about-me/Makefile.am
+++ b/capplets/about-me/Makefile.am
@@ -57,3 +57,5 @@ endif # BUILD_ABOUTME
 
 CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(MARSHALFILES)
 EXTRA_DIST = $(glade_files) fprintd-marshal.list
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/about-me/icons/Makefile.am b/capplets/about-me/icons/Makefile.am
index 718fe65..e0977b3 100644
--- a/capplets/about-me/icons/Makefile.am
+++ b/capplets/about-me/icons/Makefile.am
@@ -14,3 +14,5 @@ pixmaps_DATA =			\
 	right-thumb.svg
 
 EXTRA_DIST = $(pixmaps_DATA)
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/accessibility/Makefile.am b/capplets/accessibility/Makefile.am
index 183e71a..4c96fba 100644
--- a/capplets/accessibility/Makefile.am
+++ b/capplets/accessibility/Makefile.am
@@ -1 +1,3 @@
 SUBDIRS = at-properties
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/accessibility/at-properties/Makefile.am b/capplets/accessibility/at-properties/Makefile.am
index 3f3ee4a..c74c1a7 100644
--- a/capplets/accessibility/at-properties/Makefile.am
+++ b/capplets/accessibility/at-properties/Makefile.am
@@ -27,3 +27,5 @@ INCLUDES   = $(AT_CAPPLET_CFLAGS)     \
 	     -DGNOMELOCALEDIR="\"$(datadir)/locale\""
 CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA)
 EXTRA_DIST = $(ui_DATA) $(pixmap_DATA)
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/appearance/Makefile.am b/capplets/appearance/Makefile.am
index 32084f5..226e4ec 100644
--- a/capplets/appearance/Makefile.am
+++ b/capplets/appearance/Makefile.am
@@ -58,3 +58,5 @@ INCLUDES = \
 	-DWALLPAPER_DATADIR="\"$(wallpaperdir)\""
 
 CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES)
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/appearance/data/Makefile.am b/capplets/appearance/data/Makefile.am
index 3240655..3571ffa 100644
--- a/capplets/appearance/data/Makefile.am
+++ b/capplets/appearance/data/Makefile.am
@@ -57,3 +57,5 @@ EXTRA_DIST = $(xml_in_files)
 
 
 CLEANFILES = $(desktop_in_files) $(desktop_DATA) $(mime_DATA)
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/common/Makefile.am b/capplets/common/Makefile.am
index 4e7d5d3..6720883 100644
--- a/capplets/common/Makefile.am
+++ b/capplets/common/Makefile.am
@@ -59,3 +59,5 @@ gnome_theme_test_LDADD = 						\
 
 noinst_PROGRAMS = \
 	gnome-theme-test
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/default-applications/Makefile.am b/capplets/default-applications/Makefile.am
index a68c8e4..d099d9b 100644
--- a/capplets/default-applications/Makefile.am
+++ b/capplets/default-applications/Makefile.am
@@ -71,3 +71,5 @@ update-icon-cache:
 
 CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA) $(xmldata_DATA) $(autostart_DATA) $(bin_SCRIPTS)
 EXTRA_DIST = $(xmldata_in_files) gnome-default-applications.pc.in
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/display/Makefile.am b/capplets/display/Makefile.am
index ff0bcdf..14bba49 100644
--- a/capplets/display/Makefile.am
+++ b/capplets/display/Makefile.am
@@ -54,3 +54,5 @@ update-icon-cache:
 		echo "*** Icon cache not updated.  After (un)install, run this:"; \
 		echo "***   $(gtk_update_icon_cache)"; \
 	fi
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/keybindings/Makefile.am b/capplets/keybindings/Makefile.am
index b7adfe5..62847fa 100644
--- a/capplets/keybindings/Makefile.am
+++ b/capplets/keybindings/Makefile.am
@@ -42,3 +42,5 @@ CLEANFILES = \
 	$(xml_DATA)
 EXTRA_DIST = $(ui_DATA) $(xml_in_files) gnome-keybindings.pc.in
 
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/keyboard/Makefile.am b/capplets/keyboard/Makefile.am
index 4774d9b..9dc3225 100644
--- a/capplets/keyboard/Makefile.am
+++ b/capplets/keyboard/Makefile.am
@@ -34,3 +34,5 @@ INCLUDES = \
 	-DGNOMECC_GLADE_DIR="\"$(pkgdatadir)/glade\""
 CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA)
 EXTRA_DIST = $(Glade_DATA)
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/localization/Makefile.am b/capplets/localization/Makefile.am
index f1d86a9..639336e 100644
--- a/capplets/localization/Makefile.am
+++ b/capplets/localization/Makefile.am
@@ -23,4 +23,5 @@ INCLUDES =						\
 	-DGNOMELOCALEDIR="\"$(datadir)/locale\"" 	\
 	-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\""
 
-CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA)
\ No newline at end of file
+CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA)
+-include $(top_srcdir)/git.mk
diff --git a/capplets/mouse/Makefile.am b/capplets/mouse/Makefile.am
index f89173c..f8685e8 100644
--- a/capplets/mouse/Makefile.am
+++ b/capplets/mouse/Makefile.am
@@ -31,3 +31,5 @@ INCLUDES = \
 	-DGNOMECC_GLADE_DIR="\"$(pkgdatadir)/glade\""
 CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA)
 EXTRA_DIST = $(Glade_DATA) $(pixmap_DATA)
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/network/Makefile.am b/capplets/network/Makefile.am
index 0622083..f4f6cf9 100644
--- a/capplets/network/Makefile.am
+++ b/capplets/network/Makefile.am
@@ -46,3 +46,5 @@ update-icon-cache:
 	fi
 
 CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(desktop_in_files) $(desktop_DATA)
+
+-include $(top_srcdir)/git.mk
diff --git a/capplets/windows/Makefile.am b/capplets/windows/Makefile.am
index af98f8d..e73506c 100644
--- a/capplets/windows/Makefile.am
+++ b/capplets/windows/Makefile.am
@@ -28,3 +28,5 @@ INCLUDES   = $(GNOMECC_CAPPLETS_CFLAGS)					\
 CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA)
 EXTRA_DIST = $(ui_DATA)
 
+
+-include $(top_srcdir)/git.mk
diff --git a/font-viewer/Makefile.am b/font-viewer/Makefile.am
index 3255cd7..a71de6c 100644
--- a/font-viewer/Makefile.am
+++ b/font-viewer/Makefile.am
@@ -44,3 +44,5 @@ CLEANFILES = $(desktop_in_files) $(desktop_DATA) \
 EXTRA_DIST = \
   fontilus.schemas.in \
   gnome-font-viewer.desktop.in.in
+
+-include $(top_srcdir)/git.mk
diff --git a/git.mk b/git.mk
new file mode 100644
index 0000000..01bf288
--- /dev/null
+++ b/git.mk
@@ -0,0 +1,182 @@
+# 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, intltool.
+#
+#
+# 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.
+#
+
+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
+	@echo Generating $@; \
+	{ \
+		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)" = 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_POFILES) \
+				"*/.xml2po.mo" \
+				"*/*.omf.out" \
+			; 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" \
+				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) \
+			$(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]" \
+		; do echo /$$x; done; \
+	} | \
+	sed "s ^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \
+	sed 's@/[.]/@/@g' | \
+	LANG=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:
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir"); \
+	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/help/Makefile.am b/help/Makefile.am
index 262e6d1..ff928cb 100644
--- a/help/Makefile.am
+++ b/help/Makefile.am
@@ -6,3 +6,5 @@ DOC_ENTITIES = config-accessibility-keyboard.xml config-background.xml config-be
 DOC_INCLUDES = 
 
 DOC_LINGUAS = ca ca valencia cs de el en_GB es fr it ja oc pa pl pt pt_BR ru sv uk vi zh_CN
+
+-include $(top_srcdir)/git.mk
diff --git a/libslab/Makefile.am b/libslab/Makefile.am
index dc182c6..5f6c4b3 100644
--- a/libslab/Makefile.am
+++ b/libslab/Makefile.am
@@ -103,3 +103,5 @@ CLEANFILES =				\
 EXTRA_DIST=				\
 	search-entry-watermark.svg	\
 	nld-marshal.list
+
+-include $(top_srcdir)/git.mk
diff --git a/libwindow-settings/Makefile.am b/libwindow-settings/Makefile.am
index 9ca4828..d11871b 100644
--- a/libwindow-settings/Makefile.am
+++ b/libwindow-settings/Makefile.am
@@ -52,3 +52,5 @@ libmetacity_la_LDFLAGS = $(wms_flags)
 libmetacity_la_LIBADD = 		\
 	$(GNOMECC_LIBS)			\
 	libgnome-window-settings.la
+
+-include $(top_srcdir)/git.mk
diff --git a/shell/Makefile.am b/shell/Makefile.am
index ebeb850..d55c344 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -43,3 +43,5 @@ menu_DATA = gnomecc.menu
 EXTRA_DIST = gnomecc.desktop.in.in gnomecc.directory.in gnomecc.menu $(schemas_DATA).in
 
 DISTCLEANFILES = gnomecc.desktop gnomecc.desktop.in gnomecc.directory $(schemas_DATA)
+
+-include $(top_srcdir)/git.mk
diff --git a/typing-break/Makefile.am b/typing-break/Makefile.am
index 5027d8d..31b0907 100644
--- a/typing-break/Makefile.am
+++ b/typing-break/Makefile.am
@@ -47,3 +47,5 @@ update-icon-cache:
 		echo "*** Icon cache not updated.  After (un)install, run this:"; \
 		echo "***   $(gtk_update_icon_cache)"; \
 	fi
+
+-include $(top_srcdir)/git.mk



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