[the-board] [build] Auto-generate .gitignore with git.mk



commit 2f84903a38a2a1fc7d5c0f9928a7825e65a916c2
Author: Lucas Rocha <lucasr gnome org>
Date:   Fri Nov 26 16:02:10 2010 +0000

    [build] Auto-generate .gitignore with git.mk

 .gitignore                   |   96 +++++++++++----------
 Makefile.am                  |   57 ++++++++++++
 data/Makefile.am             |    2 +
 data/backgrounds/Makefile.am |    2 +
 data/fonts/Makefile.am       |    4 +-
 data/icons/Makefile.am       |    2 +
 data/style/Makefile.am       |    2 +
 data/things/Makefile.am      |    2 +
 git.mk                       |  196 ++++++++++++++++++++++++++++++++++++++++++
 src/Makefile-js.am           |    2 +
 src/Makefile.am              |    4 +-
 11 files changed, 320 insertions(+), 49 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 7f15f64..2fd4768 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,16 +8,20 @@
 /.*.sw[nop]
 /.deps
 /.dirstamp
+/.gitignore
 /.libs
+/ABOUT-NLS
 /GPATH
 /GRTAGS
 /GSYMS
 /GTAGS
 /ID
+/INSTALL
 /Makefile
 /Makefile.in
 /TAGS
 /_libs
+/aclocal.m4
 /autom4te.cache
 /config.cache
 /config.h
@@ -25,68 +29,66 @@
 /config.lt
 /config.status
 /config.status.lineno
+/config/
 /configure
 /configure.lineno
 /intltool-extract.in
 /intltool-merge.in
 /intltool-update.in
 /libtool
+/m4/codeset.m4
+/m4/gettext.m4
+/m4/glibc2.m4
+/m4/glibc21.m4
+/m4/iconv.m4
+/m4/intdiv0.m4
+/m4/intl.m4
+/m4/intldir.m4
+/m4/intlmacosx.m4
+/m4/intltool.m4
+/m4/intmax.m4
+/m4/inttypes-pri.m4
+/m4/inttypes_h.m4
+/m4/lcmessage.m4
+/m4/lib-ld.m4
+/m4/lib-link.m4
+/m4/lib-prefix.m4
+/m4/libtool.m4
+/m4/lock.m4
+/m4/longlong.m4
+/m4/ltoptions.m4
+/m4/ltsugar.m4
+/m4/ltversion.m4
+/m4/lt~obsolete.m4
+/m4/nls.m4
+/m4/po.m4
+/m4/printf-posix.m4
+/m4/progtest.m4
+/m4/size_max.m4
+/m4/stdint_h.m4
+/m4/uintmax_t.m4
+/m4/visibility.m4
+/m4/wchar_t.m4
+/m4/wint_t.m4
+/m4/xsize.m4
 /po/*.gmo
 /po/*.mo
 /po/.intltool-merge-cache
 /po/Makefile
 /po/Makefile.in
 /po/Makefile.in.in
+/po/Makefile.in.in~
+/po/Makevars.template
 /po/POTFILES
+/po/Rules-quot
+/po/boldquot.sed
+/po/en boldquot header
+/po/en quot header
+/po/insert-header.sin
+/po/quot.sed
+/po/remove-potcdate.sin
 /po/stamp-it
 /po/the-board.pot
 /so_locations
 /stamp-h1
 /tags
-ABOUT-NLS
-aclocal.m4
-config/
-data/Makefile
-data/Makefile.in
-data/backgrounds/Makefile
-data/backgrounds/Makefile.in
-data/fonts/Makefile
-data/fonts/Makefile.in
-data/fonts/fonts.conf
-data/fonts/uninstalled-fonts.conf
-data/icons/Makefile
-data/icons/Makefile.in
-data/style/Makefile
-data/style/Makefile.in
-data/things/Makefile
-data/things/Makefile.in
-po/Makefile.in.in~
-po/Makevars.template
-po/Rules-quot
-po/boldquot.sed
-po/en boldquot header
-po/en quot header
-po/insert-header.sin
-po/quot.sed
-po/remove-potcdate.sin
-src/.deps/
-src/.libs/
-src/Makefile
-src/Makefile.in
-src/Tb-1.0.gir
-src/Tb-1.0.typelib
-src/js/util/path.js
-src/libtb-1.0.la
-src/libtb_1_0_la-tb-box.lo
-src/libtb_1_0_la-tb-enum-types.lo
-src/libtb_1_0_la-tb-gio-util.lo
-src/libtb_1_0_la-tb-gdk-util.lo
-src/libtb_1_0_la-tb-gobject-util.lo
-src/stamp-big-enum-types.h
-src/stamp-tb-enum-types.h
-src/tb-enum-types.c
-src/tb-enum-types.h
-src/the-board
-src/the-board-start
-src/the-board-uninstalled
-src/the_board_start-main.o
diff --git a/Makefile.am b/Makefile.am
index af847ae..975ac3b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,6 +8,63 @@ EXTRA_DIST = \
 stale-files-clean-local:
 	-$(RM) $(abs_top_builddir)/*.la $(abs_top_builddir)/*.gir $(abs_top_builddir)/*.typelib
 
+GITIGNOREFILES= \
+    ABOUT-NLS \
+    config/ \
+    po/Makefile.in.in~ \
+    po/Makevars.template \
+    po/Rules-quot \
+    po/boldquot.sed \
+    po/en boldquot header \
+    po/en quot header \
+    po/insert-header.sin \
+    po/quot.sed \
+    po/remove-potcdate.sin \
+    m4/codeset.m4 \
+    m4/gettext.m4 \
+    m4/glibc2.m4 \
+    m4/glibc21.m4 \
+    m4/iconv.m4 \
+    m4/intdiv0.m4 \
+    m4/intl.m4 \
+    m4/intldir.m4 \
+    m4/intlmacosx.m4 \
+    m4/intltool.m4 \
+    m4/intmax.m4 \
+    m4/inttypes-pri.m4 \
+    m4/inttypes_h.m4 \
+    m4/lcmessage.m4 \
+    m4/lib-ld.m4 \
+    m4/lib-link.m4 \
+    m4/lib-prefix.m4 \
+    m4/libtool.m4 \
+    m4/lock.m4 \
+    m4/longlong.m4 \
+    m4/ltoptions.m4 \
+    m4/ltsugar.m4 \
+    m4/ltversion.m4 \
+    m4/lt~obsolete.m4 \
+    m4/nls.m4 \
+    m4/po.m4 \
+    m4/printf-posix.m4 \
+    m4/progtest.m4 \
+    m4/size_max.m4 \
+    m4/stdint_h.m4 \
+    m4/uintmax_t.m4 \
+    m4/visibility.m4 \
+    m4/wchar_t.m4 \
+    m4/wint_t.m4 \
+    m4/xsize.m4
+
+MAINTAINERCLEANFILES = \
+    INSTALL \
+    aclocal.m4 \
+    config.log \
+    config.status \
+    configure
+
+-include $(top_srcdir)/git.mk
+
 dist-hook:
 	@if test -d "$(srcdir)/.git"; \
 	then \
diff --git a/data/Makefile.am b/data/Makefile.am
index 8286676..dfa9b60 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1 +1,3 @@
 SUBDIRS = backgrounds fonts icons style things
+
+-include $(top_srcdir)/git.mk
diff --git a/data/backgrounds/Makefile.am b/data/backgrounds/Makefile.am
index d3e4559..36f765b 100644
--- a/data/backgrounds/Makefile.am
+++ b/data/backgrounds/Makefile.am
@@ -19,3 +19,5 @@ wooddir = $(backgroundsdir)/wood
 
 dist_wood_DATA = \
     wood/bg.jpg
+
+-include $(top_srcdir)/git.mk
diff --git a/data/fonts/Makefile.am b/data/fonts/Makefile.am
index 5445cfa..b39d5c7 100644
--- a/data/fonts/Makefile.am
+++ b/data/fonts/Makefile.am
@@ -18,8 +18,10 @@ nodist_fontconfig_DATA = \
 
 dist_fonts_DATA =
 
-CLEANFILES = uninstalled-fonts.conf
+CLEANFILES = fonts.conf uninstalled-fonts.conf
 
 EXTRA_DIST = \
     fonts.conf.in \
     uninstalled-fonts.conf.in
+
+-include $(top_srcdir)/git.mk
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
index e7fa51e..4d3d8c4 100644
--- a/data/icons/Makefile.am
+++ b/data/icons/Makefile.am
@@ -45,3 +45,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/data/style/Makefile.am b/data/style/Makefile.am
index 450baa8..8013f8c 100644
--- a/data/style/Makefile.am
+++ b/data/style/Makefile.am
@@ -8,3 +8,5 @@ dist_style_DATA = \
     startup.png \
     style.css \
     tool-box-button-selected.png
+
+-include $(top_srcdir)/git.mk
diff --git a/data/things/Makefile.am b/data/things/Makefile.am
index 256ab07..2b74f1a 100644
--- a/data/things/Makefile.am
+++ b/data/things/Makefile.am
@@ -28,3 +28,5 @@ dist_video_DATA = \
     video/video-controls-bg.png \
     video/video-progress-bar-bar.png \
     video/video-progress-bar-bg.png
+
+-include $(top_srcdir)/git.mk
diff --git a/git.mk b/git.mk
new file mode 100644
index 0000000..894adb4
--- /dev/null
+++ b/git.mk
@@ -0,0 +1,196 @@
+# 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, 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.
+#
+
+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)" = 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/src/Makefile-js.am b/src/Makefile-js.am
index b0aa4ab..c3126e0 100644
--- a/src/Makefile-js.am
+++ b/src/Makefile-js.am
@@ -48,5 +48,7 @@ dist_jsutil_DATA = \
     js/util/mathUtil.js \
     js/util/path.js
 
+CLEANFILES += js/util/path.js
+
 EXTRA_DIST += \
     js/util/path.js.in
diff --git a/src/Makefile.am b/src/Makefile.am
index b32e0f5..9a18fd3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -47,7 +47,7 @@ include Makefile-tb.am
 gir_DATA += $(INTROSPECTION_GIRS)
 typelib_DATA += $(gir_DATA:.gir=.typelib)
 
-CLEANFILES += gir_DATA typelib_DATA
+CLEANFILES += $(gir_DATA) $(typelib_DATA)
 
 libexec_PROGRAMS += the-board-start
 
@@ -79,3 +79,5 @@ the-board-uninstalled: the-board-uninstalled.in
 
 CLEANFILES += the-board-uninstalled
 EXTRA_DIST += the-board-uninstalled.in
+
+-include $(top_srcdir)/git.mk



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