Skip to content

Commit

Permalink
Add git.mk to generate the .gitignore.
Browse files Browse the repository at this point in the history
  • Loading branch information
nacho committed May 5, 2009
1 parent 832f0f4 commit 9680df0
Show file tree
Hide file tree
Showing 39 changed files with 258 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ ChangeLog:
fi

.PHONY: ChangeLog

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions data/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ CLEANFILES = \




-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions docs/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
SUBDIRS = reference

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions docs/reference/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,5 @@ include $(top_srcdir)/gtk-doc.make
regenerate-types:
grep _get_type $(DOC_SOURCE_DIR)/gedit-*.h | grep -oR '^.*\.h' | sort | uniq - | sed -r 's/^.*\.h$/#include "\0"/' > gedit.types
grep _get_type $(DOC_SOURCE_DIR)/gedit-*.h | grep -oR '^.*\.h' | sort | uniq - | sed -re 'y/-/_/' -e 's/^(.*)\.h$/\1_get_type/' >> gedit.types.new

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions gedit/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,5 @@ endif
if BUILD_SEXY
libgedit_la_SOURCES += sexy-icon-entry.c sexy-icon-entry.h
endif

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions gedit/dialogs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ ui_DATA = \

EXTRA_DIST = $(ui_DATA)


-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions gedit/smclient/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ EXTRA_DIST = \
eggsmclient-osx.c \
eggsmclient-win32.c \
eggsmclient-xsmp.c

-include $(top_srcdir)/git.mk
182 changes: 182 additions & 0 deletions git.mk
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions help/C/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ omffile = gedit-C.omf
entities = legal.xml
include $(top_srcdir)/xmldocs.make
dist-hook: app-dist-hook

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions help/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ DOC_FIGURES = \

DOC_LINGUAS = ar bg ca da de el es fi fr hu it ja ko oc pt_BR ru sv th uk zh_CN zh_HK zh_TW


-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions omf-install/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ uninstall-local:
done
-rmdir $(omf_dest_dir)
-scrollkeeper-update -p $(scrollkeeper_localstate_dir)

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions pixmaps/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ EXTRA_DIST = \
$(icon_DATA) \
$(logo_DATA) \
gedit.ico

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugin-loaders/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ SUBDIRS = c
if ENABLE_PYTHON
SUBDIRS += python
endif

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugin-loaders/c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ libcloader_la_SOURCES = \

libcloader_la_LDFLAGS = $(LOADER_LIBTOOL_FLAGS)
libcloader_la_LIBADD = $(GEDIT_LIBS)

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugin-loaders/python/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ libpythonloader_la_LDFLAGS = $(LOADER_LIBTOOL_FLAGS)
libpythonloader_la_LIBADD = \
$(GEDIT_LIBS) \
bindings/gedit.la

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugin-loaders/python/bindings/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,5 @@ CLEANFILES = $(BUILT_SOURCES)

dist-hook:
cd $(distdir); rm -f $(BUILT_SOURCES)

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ DIST_SUBDIRS += externaltools pythonconsole snippets
SUBDIRS += externaltools pythonconsole snippets
endif


-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/changecase/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ EXTRA_DIST = $(ui_DATA) $(plugin_in_files)
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)


-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/docinfo/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ EXTRA_DIST = $(ui_DATA) $(plugin_in_files)
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)


-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/externaltools/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ EXTRA_DIST = $(plugin_in_files)

CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/externaltools/data/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ DISTCLEANFILES = \
$(desktop_files) \
$(tools_SCRIPTS)


-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/externaltools/scripts/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
EXTRA_DIST = gedit-tool-merge.pl


-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/externaltools/tools/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ EXTRA_DIST = $(ui_DATA)

CLEANFILES = *.bak *.gladep
DISTCLEANFILES = *.bak *.gladep

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/filebrowser/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@ DISTCLEANFILES = \
$(plugin_DATA) \
$(schemas_DATA) \
$(BUILT_SOURCES)

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/indent/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ EXTRA_DIST = $(ui_DATA) $(plugin_in_files)
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)


-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/modelines/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ EXTRA_DIST = \
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)


-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/pythonconsole/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ EXTRA_DIST = $(plugin_in_files)

CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/pythonconsole/pythonconsole/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ EXTRA_DIST = $(ui_DATA)

CLEANFILES =
DISTCLEANFILES =

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/sample/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ EXTRA_DIST = $(ui_DATA) $(plugin_in_files)
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)


-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/snippets/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ EXTRA_DIST = $(plugin_in_files)

CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/snippets/data/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ snippets_DATA = \
snippetsdir = $(GEDIT_PLUGINS_DATA_DIR)/snippets

EXTRA_DIST = $(snippets_DATA)

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/snippets/data/lang/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ lang_DATA = \
langdir = $(GEDIT_PLUGINS_DATA_DIR)/snippets/lang

EXTRA_DIST = $(lang_DATA)

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/snippets/snippets/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ EXTRA_DIST = $(ui_DATA)

CLEANFILES = *.bak *.gladep *.pyc
DISTCLEANFILES = *.bak *.gladep *.pyc

-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/sort/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ EXTRA_DIST = $(ui_DATA) $(plugin_in_files)
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)


-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/spell/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@ dist-hook:
cd $(distdir); rm -f $(BUILT_SOURCES)



-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/taglist/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ DISTCLEANFILES = \




-include $(top_srcdir)/git.mk
2 changes: 2 additions & 0 deletions plugins/time/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ EXTRA_DIST = $(ui_DATA) $(plugin_in_files)
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)


-include $(top_srcdir)/git.mk
Loading

0 comments on commit 9680df0

Please sign in to comment.