|
0 |
# git.mk
|
|
1 |
#
|
|
2 |
# Copyright 2009, Red Hat, Inc.
|
|
3 |
# Written by Behdad Esfahbod
|
|
4 |
#
|
|
5 |
# Copying and distribution of this file, with or without modification,
|
|
6 |
# are permitted in any medium without royalty provided the copyright
|
|
7 |
# notice and this notice are preserved.
|
|
8 |
#
|
|
9 |
# The canonical source for this file is pango/git.mk, or whereever the
|
|
10 |
# header of pango/git.mk suggests in the future.
|
|
11 |
#
|
|
12 |
# To use in your project, import this file in your git repo's toplevel,
|
|
13 |
# then do "make -f git.mk". This modifies all Makefile.am files in
|
|
14 |
# your project to include git.mk.
|
|
15 |
#
|
|
16 |
# This enables automatic .gitignore generation. If you need to ignore
|
|
17 |
# more files, add them to the GITIGNOREFILES variable in your Makefile.am.
|
|
18 |
# But think twice before doing that. If a file has to be in .gitignore,
|
|
19 |
# chances are very high that it's a generated file and should be in one
|
|
20 |
# of MOSTLYCLEANFILES, CLEANFILES, DISTCLEANFILES, or MAINTAINERCLEANFILES.
|
|
21 |
#
|
|
22 |
# The only case that you need to manually add a file to GITIGNOREFILES is
|
|
23 |
# when remove files in one of mostlyclean-local, clean-local, distclean-local,
|
|
24 |
# or maintainer-clean-local.
|
|
25 |
#
|
|
26 |
# Note that for files like editor backup, etc, there are better places to
|
|
27 |
# ignore them. See "man gitignore".
|
|
28 |
#
|
|
29 |
# If "make maintainer-clean" removes the files but they are not recognized
|
|
30 |
# by this script (that is, if "git status" shows untracked files still), send
|
|
31 |
# me the output of "git status" as well as your Makefile.am and Makefile for
|
|
32 |
# the directories involved.
|
|
33 |
#
|
|
34 |
# For a list of toplevel files that should be in MAINTAINERCLEANFILES, see
|
|
35 |
# pango/Makefile.am.
|
|
36 |
#
|
|
37 |
# Don't EXTRA_DIST this file. It is supposed to only live in git clones,
|
|
38 |
# not tarballs. It serves no useful purpose in tarballs and clutters the
|
|
39 |
# build dir.
|
|
40 |
#
|
|
41 |
# This file knows how to handle autoconf, automake, libtool, gtk-doc,
|
|
42 |
# gnome-doc-utils, mallard, intltool, gsettings.
|
|
43 |
#
|
|
44 |
#
|
|
45 |
# KNOWN ISSUES:
|
|
46 |
#
|
|
47 |
# - Recursive configure doesn't work as $(top_srcdir)/git.mk inside the
|
|
48 |
# submodule doesn't find us. If you have configure.{in,ac} files in
|
|
49 |
# subdirs, add a proxy git.mk file in those dirs that simply does:
|
|
50 |
# "include $(top_srcdir)/../git.mk". Add more ..'s to your taste.
|
|
51 |
# And add those files to git. See vte/gnome-pty-helper/git.mk for
|
|
52 |
# example.
|
|
53 |
#
|
|
54 |
# ChangeLog
|
|
55 |
#
|
|
56 |
# - 2010-12-06 Add support for Mallard docs
|
|
57 |
# - 2010-12-06 Start this change log
|
|
58 |
|
|
59 |
git-all: git-mk-install
|
|
60 |
|
|
61 |
git-mk-install:
|
|
62 |
@echo Installing git makefile
|
|
63 |
@any_failed=; find $(top_srcdir) -name Makefile.am | while read x; do \
|
|
64 |
if grep 'include .*/git.mk' $$x >/dev/null; then \
|
|
65 |
echo $$x already includes git.mk; \
|
|
66 |
else \
|
|
67 |
failed=; \
|
|
68 |
echo "Updating $$x"; \
|
|
69 |
{ cat $$x; \
|
|
70 |
echo ''; \
|
|
71 |
echo '-include $$(top_srcdir)/git.mk'; \
|
|
72 |
} > $$x.tmp || failed=1; \
|
|
73 |
if test x$$failed = x; then \
|
|
74 |
mv $$x.tmp $$x || failed=1; \
|
|
75 |
fi; \
|
|
76 |
if test x$$failed = x; then : else \
|
|
77 |
echo Failed updating $$x; >&2 \
|
|
78 |
any_failed=1; \
|
|
79 |
fi; \
|
|
80 |
fi; done; test -z "$$any_failed"
|
|
81 |
|
|
82 |
.PHONY: git-all git-mk-install
|
|
83 |
|
|
84 |
|
|
85 |
### .gitignore generation
|
|
86 |
|
|
87 |
$(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
|
|
88 |
$(AM_V_GEN) \
|
|
89 |
{ \
|
|
90 |
if test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x; then :; else \
|
|
91 |
for x in \
|
|
92 |
$(DOC_MODULE)-decl-list.txt \
|
|
93 |
$(DOC_MODULE)-decl.txt \
|
|
94 |
tmpl/$(DOC_MODULE)-unused.sgml \
|
|
95 |
"tmpl/*.bak" \
|
|
96 |
xml html \
|
|
97 |
; do echo /$$x; done; \
|
|
98 |
fi; \
|
|
99 |
if test "x$(DOC_MODULE)$(DOC_ID)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \
|
|
100 |
for x in \
|
|
101 |
$(_DOC_C_DOCS) \
|
|
102 |
$(_DOC_LC_DOCS) \
|
|
103 |
$(_DOC_OMF_ALL) \
|
|
104 |
$(_DOC_DSK_ALL) \
|
|
105 |
$(_DOC_HTML_ALL) \
|
|
106 |
$(_DOC_MOFILES) \
|
|
107 |
$(_DOC_POFILES) \
|
|
108 |
$(DOC_H_FILE) \
|
|
109 |
"*/.xml2po.mo" \
|
|
110 |
"*/*.omf.out" \
|
|
111 |
; do echo /$$x; done; \
|
|
112 |
fi; \
|
|
113 |
if test "x$(gsettings_SCHEMAS)" = x; then :; else \
|
|
114 |
for x in \
|
|
115 |
$(gsettings_SCHEMAS:.xml=.valid) \
|
|
116 |
$(gsettings__enum_file) \
|
|
117 |
; do echo /$$x; done; \
|
|
118 |
fi; \
|
|
119 |
if test -f $(srcdir)/po/Makefile.in.in; then \
|
|
120 |
for x in \
|
|
121 |
po/Makefile.in.in \
|
|
122 |
po/Makefile.in \
|
|
123 |
po/Makefile \
|
|
124 |
po/POTFILES \
|
|
125 |
po/stamp-it \
|
|
126 |
po/.intltool-merge-cache \
|
|
127 |
"po/*.gmo" \
|
|
128 |
"po/*.mo" \
|
|
129 |
po/$(GETTEXT_PACKAGE).pot \
|
|
130 |
intltool-extract.in \
|
|
131 |
intltool-merge.in \
|
|
132 |
intltool-update.in \
|
|
133 |
; do echo /$$x; done; \
|
|
134 |
fi; \
|
|
135 |
if test -f $(srcdir)/configure; then \
|
|
136 |
for x in \
|
|
137 |
autom4te.cache \
|
|
138 |
configure \
|
|
139 |
config.h \
|
|
140 |
stamp-h1 \
|
|
141 |
libtool \
|
|
142 |
config.lt \
|
|
143 |
; do echo /$$x; done; \
|
|
144 |
fi; \
|
|
145 |
for x in \
|
|
146 |
.gitignore \
|
|
147 |
$(GITIGNOREFILES) \
|
|
148 |
$(CLEANFILES) \
|
|
149 |
$(PROGRAMS) \
|
|
150 |
$(check_PROGRAMS) \
|
|
151 |
$(EXTRA_PROGRAMS) \
|
|
152 |
$(LTLIBRARIES) \
|
|
153 |
so_locations \
|
|
154 |
.libs _libs \
|
|
155 |
$(MOSTLYCLEANFILES) \
|
|
156 |
"*.$(OBJEXT)" \
|
|
157 |
"*.lo" \
|
|
158 |
$(DISTCLEANFILES) \
|
|
159 |
$(am__CONFIG_DISTCLEAN_FILES) \
|
|
160 |
$(CONFIG_CLEAN_FILES) \
|
|
161 |
TAGS ID GTAGS GRTAGS GSYMS GPATH tags \
|
|
162 |
"*.tab.c" \
|
|
163 |
$(MAINTAINERCLEANFILES) \
|
|
164 |
$(BUILT_SOURCES) \
|
|
165 |
$(DEPDIR) \
|
|
166 |
Makefile \
|
|
167 |
Makefile.in \
|
|
168 |
"*.orig" \
|
|
169 |
"*.rej" \
|
|
170 |
"*.bak" \
|
|
171 |
"*~" \
|
|
172 |
".*.sw[nop]" \
|
|
173 |
".dirstamp" \
|
|
174 |
; do echo /$$x; done; \
|
|
175 |
} | \
|
|
176 |
sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \
|
|
177 |
sed 's@/[.]/@/@g' | \
|
|
178 |
LC_ALL=C sort | uniq > $@.tmp && \
|
|
179 |
mv $@.tmp $@;
|
|
180 |
|
|
181 |
all: $(srcdir)/.gitignore gitignore-recurse-maybe
|
|
182 |
gitignore-recurse-maybe:
|
|
183 |
@if test "x$(SUBDIRS)" = "x$(DIST_SUBDIRS)"; then :; else \
|
|
184 |
$(MAKE) $(AM_MAKEFLAGS) gitignore-recurse; \
|
|
185 |
fi;
|
|
186 |
gitignore-recurse:
|
|
187 |
@for subdir in $(DIST_SUBDIRS); do \
|
|
188 |
case " $(SUBDIRS) " in \
|
|
189 |
*" $$subdir "*) :;; \
|
|
190 |
*) test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir");; \
|
|
191 |
esac; \
|
|
192 |
done
|
|
193 |
gitignore: $(srcdir)/.gitignore gitignore-recurse
|
|
194 |
|
|
195 |
maintainer-clean: gitignore-clean
|
|
196 |
gitignore-clean:
|
|
197 |
-rm -f $(srcdir)/.gitignore
|
|
198 |
|
|
199 |
.PHONY: gitignore-clean gitignore gitignore-recurse gitignore-recurse-maybe
|