From 4ab49e6ed54603ca26040c43cf4628cd0186632f Mon Sep 17 00:00:00 2001 From: "P. F. Chimento" Date: Wed, 8 Jun 2011 22:46:32 +0200 Subject: [PATCH] Enable automatic generation of .gitignore Using git.mk in toplevel dir --- .gitignore | 25 ---- Makefile.am | 7 ++ docs/.gitignore | 2 - docs/Makefile.am | 2 + docs/reference/.gitignore | 20 ---- docs/reference/Makefile.am | 2 + git.mk | 200 ++++++++++++++++++++++++++++++++ interpreters/.gitignore | 2 - interpreters/Makefile.am | 2 + interpreters/frotz/.gitignore | 8 -- interpreters/frotz/Makefile.am | 2 + interpreters/git/.gitignore | 8 -- interpreters/git/Makefile.am | 2 + interpreters/glulxe/.gitignore | 8 -- interpreters/glulxe/Makefile.am | 2 + interpreters/nitfol/.gitignore | 14 --- interpreters/nitfol/Makefile.am | 6 +- libchimara/.gitignore | 9 -- libchimara/Makefile.am | 2 + player/.gitignore | 8 -- player/Makefile.am | 3 +- tests/.gitignore | 11 -- tests/Makefile.am | 2 + 23 files changed, 230 insertions(+), 117 deletions(-) delete mode 100644 .gitignore delete mode 100644 docs/.gitignore delete mode 100644 docs/reference/.gitignore create mode 100644 git.mk delete mode 100644 interpreters/.gitignore delete mode 100644 interpreters/frotz/.gitignore delete mode 100644 interpreters/git/.gitignore delete mode 100644 interpreters/glulxe/.gitignore delete mode 100644 interpreters/nitfol/.gitignore delete mode 100644 libchimara/.gitignore delete mode 100644 player/.gitignore delete mode 100644 tests/.gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 13462f6..0000000 --- a/.gitignore +++ /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 -*~ diff --git a/Makefile.am b/Makefile.am index 9cac9d7..a163df8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 index 282522d..0000000 --- a/docs/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/docs/Makefile.am b/docs/Makefile.am index b68c774..372c2a7 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1 +1,3 @@ SUBDIRS=reference + +-include $(top_srcdir)/git.mk diff --git a/docs/reference/.gitignore b/docs/reference/.gitignore deleted file mode 100644 index e16f857..0000000 --- a/docs/reference/.gitignore +++ /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 diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am index ccb250b..7994e0e 100644 --- a/docs/reference/Makefile.am +++ b/docs/reference/Makefile.am @@ -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 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 index 282522d..0000000 --- a/interpreters/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/interpreters/Makefile.am b/interpreters/Makefile.am index 2e8fc83..0b1cb2e 100644 --- a/interpreters/Makefile.am +++ b/interpreters/Makefile.am @@ -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 index de64204..0000000 --- a/interpreters/frotz/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -frotz.la -*.o -*.lo - diff --git a/interpreters/frotz/Makefile.am b/interpreters/frotz/Makefile.am index fdecc89..16c91a6 100644 --- a/interpreters/frotz/Makefile.am +++ b/interpreters/frotz/Makefile.am @@ -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 index 2389b6c..0000000 --- a/interpreters/git/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -git.la -*.o -*.lo - diff --git a/interpreters/git/Makefile.am b/interpreters/git/Makefile.am index 89642c8..bbed8c4 100644 --- a/interpreters/git/Makefile.am +++ b/interpreters/git/Makefile.am @@ -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 index 366ab74..0000000 --- a/interpreters/glulxe/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -glulxe.la -*.o -*.lo - diff --git a/interpreters/glulxe/Makefile.am b/interpreters/glulxe/Makefile.am index 152e8d0..f3da057 100644 --- a/interpreters/glulxe/Makefile.am +++ b/interpreters/glulxe/Makefile.am @@ -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 index b6895fe..0000000 --- a/interpreters/nitfol/.gitignore +++ /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 diff --git a/interpreters/nitfol/Makefile.am b/interpreters/nitfol/Makefile.am index c1dca0f..a54d42a 100644 --- a/interpreters/nitfol/Makefile.am +++ b/interpreters/nitfol/Makefile.am @@ -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 index 23ef07f..0000000 --- a/libchimara/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -chimara-marshallers.[ch] -libchimara.la -*.o -*.lo - diff --git a/libchimara/Makefile.am b/libchimara/Makefile.am index 65b84bb..3f98d08 100644 --- a/libchimara/Makefile.am +++ b/libchimara/Makefile.am @@ -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 index ec0fa4d..0000000 --- a/player/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.o -chimara -chimara.menus -*.gschema.valid diff --git a/player/Makefile.am b/player/Makefile.am index 89a9655..2482798 100644 --- a/player/Makefile.am +++ b/player/Makefile.am @@ -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 index 8de7f56..0000000 --- a/tests/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.o -*.lo -*.la -glulxercise -plugin-loader -test-multisession -test-close diff --git a/tests/Makefile.am b/tests/Makefile.am index d00d911..f2f1e87 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 -- 2.30.2