Skip to content

Commit 0cb413b

Browse files
committed
build-sys: update git.mk
1 parent 37cf67a commit 0cb413b

File tree

1 file changed

+122
-22
lines changed

1 file changed

+122
-22
lines changed

git.mk

+122-22
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# git.mk
22
#
33
# Copyright 2009, Red Hat, Inc.
4-
# Copyright 2010,2011 Behdad Esfahbod
4+
# Copyright 2010,2011,2012,2013 Behdad Esfahbod
55
# Written by Behdad Esfahbod
66
#
77
# Copying and distribution of this file, with or without modification,
@@ -45,7 +45,8 @@
4545
# build dir.
4646
#
4747
# This file knows how to handle autoconf, automake, libtool, gtk-doc,
48-
# gnome-doc-utils, yelp.m4, mallard, intltool, gsettings, dejagnu.
48+
# gnome-doc-utils, yelp.m4, mallard, intltool, gsettings, dejagnu, appdata,
49+
# appstream.
4950
#
5051
# This makefile provides the following targets:
5152
#
@@ -64,14 +65,74 @@
6465
# example.
6566
#
6667

68+
69+
70+
###############################################################################
71+
# Variables user modules may want to add to toplevel MAINTAINERCLEANFILES:
72+
###############################################################################
73+
74+
#
75+
# Most autotools-using modules should be fine including this variable in their
76+
# toplevel MAINTAINERCLEANFILES:
77+
GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL = \
78+
$(srcdir)/aclocal.m4 \
79+
$(srcdir)/autoscan.log \
80+
$(srcdir)/configure.scan \
81+
`AUX_DIR=$(srcdir)/$$(cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_AUX_DIR:$$1' ./configure.ac); \
82+
test "x$$AUX_DIR" = "x$(srcdir)/" && AUX_DIR=$(srcdir); \
83+
for x in \
84+
ar-lib \
85+
compile \
86+
config.guess \
87+
config.sub \
88+
depcomp \
89+
install-sh \
90+
ltmain.sh \
91+
missing \
92+
mkinstalldirs \
93+
test-driver \
94+
ylwrap \
95+
; do echo "$$AUX_DIR/$$x"; done` \
96+
`cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_HEADERS:$$1' ./configure.ac | \
97+
head -n 1 | while read f; do echo "$(srcdir)/$$f.in"; done`
98+
#
99+
# All modules should also be fine including the following variable, which
100+
# removes automake-generated Makefile.in files:
101+
GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN = \
102+
`cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_FILES:$$1' ./configure.ac | \
103+
while read f; do \
104+
case $$f in Makefile|*/Makefile) \
105+
test -f "$(srcdir)/$$f.am" && echo "$(srcdir)/$$f.in";; esac; \
106+
done`
107+
#
108+
# Modules that use libtool and use AC_CONFIG_MACRO_DIR() may also include this,
109+
# though it's harmless to include regardless.
110+
GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL = \
111+
`MACRO_DIR=$(srcdir)/$$(cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_MACRO_DIR:$$1' ./configure.ac); \
112+
if test "x$$MACRO_DIR" != "x$(srcdir)/"; then \
113+
for x in \
114+
libtool.m4 \
115+
ltoptions.m4 \
116+
ltsugar.m4 \
117+
ltversion.m4 \
118+
lt~obsolete.m4 \
119+
; do echo "$$MACRO_DIR/$$x"; done; \
120+
fi`
121+
122+
123+
124+
###############################################################################
125+
# Default rule is to install ourselves in all Makefile.am files:
126+
###############################################################################
127+
67128
git-all: git-mk-install
68129
69130
git-mk-install:
70-
@echo Installing git makefile
131+
@echo "Installing git makefile"
71132
@any_failed=; \
72133
find "`test -z "$(top_srcdir)" && echo . || echo "$(top_srcdir)"`" -name Makefile.am | while read x; do \
73134
if grep 'include .*/git.mk' $$x >/dev/null; then \
74-
echo $$x already includes git.mk; \
135+
echo "$$x already includes git.mk"; \
75136
else \
76137
failed=; \
77138
echo "Updating $$x"; \
@@ -83,35 +144,40 @@ git-mk-install:
83144
mv $$x.tmp $$x || failed=1; \
84145
fi; \
85146
if test x$$failed = x; then : else \
86-
echo Failed updating $$x; >&2 \
147+
echo "Failed updating $$x"; >&2 \
87148
any_failed=1; \
88149
fi; \
89150
fi; done; test -z "$$any_failed"
90151
91152
.PHONY: git-all git-mk-install
92153
93154
94-
### .gitignore generation
155+
156+
###############################################################################
157+
# Actual .gitignore generation:
158+
###############################################################################
95159
96160
$(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
97-
$(AM_V_GEN) \
98-
{ \
161+
@echo "git.mk: Generating $@"
162+
@{ \
99163
if test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x; then :; else \
100164
for x in \
101165
$(DOC_MODULE)-decl-list.txt \
102166
$(DOC_MODULE)-decl.txt \
103167
tmpl/$(DOC_MODULE)-unused.sgml \
104168
"tmpl/*.bak" \
105169
xml html \
106-
; do echo /$$x; done; \
170+
; do echo "/$$x"; done; \
171+
FLAVOR=$$(cd $(top_srcdir); $(AUTOCONF) --trace 'GTK_DOC_CHECK:$$2' ./configure.ac); \
172+
case $$FLAVOR in *no-tmpl*) echo /tmpl;; esac; \
107173
fi; \
108174
if test "x$(DOC_MODULE)$(DOC_ID)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \
109175
for lc in $(DOC_LINGUAS); do \
110176
for x in \
111177
$(if $(DOC_MODULE),$(DOC_MODULE).xml) \
112178
$(DOC_PAGES) \
113179
$(DOC_INCLUDES) \
114-
; do echo /$$lc/$$x; done; \
180+
; do echo "/$$lc/$$x"; done; \
115181
done; \
116182
for x in \
117183
$(_DOC_OMF_ALL) \
@@ -129,30 +195,46 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
129195
$(HELP_FILES) \
130196
"$$lc.stamp" \
131197
"$$lc.mo" \
132-
; do echo /$$lc/$$x; done; \
198+
; do echo "/$$lc/$$x"; done; \
133199
done; \
134200
fi; \
135201
if test "x$(gsettings_SCHEMAS)" = x; then :; else \
136202
for x in \
137203
$(gsettings_SCHEMAS:.xml=.valid) \
138204
$(gsettings__enum_file) \
139-
; do echo /$$x; done; \
205+
; do echo "/$$x"; done; \
206+
fi; \
207+
if test "x$(appdata_XML)" = x; then :; else \
208+
for x in \
209+
$(appdata_XML:.xml=.valid) \
210+
; do echo "/$$x"; done; \
211+
fi; \
212+
if test "x$(appstream_XML)" = x; then :; else \
213+
for x in \
214+
$(appstream_XML:.xml=.valid) \
215+
; do echo "/$$x"; done; \
140216
fi; \
141217
if test -f $(srcdir)/po/Makefile.in.in; then \
142218
for x in \
143219
po/Makefile.in.in \
220+
po/Makefile.in.in~ \
144221
po/Makefile.in \
145222
po/Makefile \
223+
po/Makevars.template \
146224
po/POTFILES \
225+
po/Rules-quot \
147226
po/stamp-it \
148227
po/.intltool-merge-cache \
149228
"po/*.gmo" \
229+
"po/*.header" \
150230
"po/*.mo" \
231+
"po/*.sed" \
232+
"po/*.sin" \
151233
po/$(GETTEXT_PACKAGE).pot \
152234
intltool-extract.in \
153235
intltool-merge.in \
154236
intltool-update.in \
155-
; do echo /$$x; done; \
237+
; do echo "/$$x"; done; \
156238
fi; \
157239
if test -f $(srcdir)/configure; then \
158240
for x in \
@@ -162,14 +244,23 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
162244
stamp-h1 \
163245
libtool \
164246
config.lt \
165-
; do echo /$$x; done; \
247+
; do echo "/$$x"; done; \
166248
fi; \
167249
if test "x$(DEJATOOL)" = x; then :; else \
168250
for x in \
169251
$(DEJATOOL) \
170-
; do echo /$$x.sum; echo /$$x.log; done; \
252+
; do echo "/$$x.sum"; echo "/$$x.log"; done; \
171253
echo /site.exp; \
172254
fi; \
255+
if test "x$(am__dirstamp)" = x; then :; else \
256+
echo "$(am__dirstamp)"; \
257+
fi; \
258+
if test "x$(LTCOMPILE)" = x -a "x$(LTCXXCOMPILE)" = x -a "x$(GTKDOC_RUN)" = x; then :; else \
259+
for x in \
260+
"*.lo" \
261+
".libs" "_libs" \
262+
; do echo "$$x"; done; \
263+
fi; \
173264
for x in \
174265
.gitignore \
175266
$(GITIGNOREFILES) \
@@ -178,18 +269,23 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
178269
$(LIBRARIES) $(check_LIBRARIES) $(EXTRA_LIBRARIES) \
179270
$(LTLIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LTLIBRARIES) \
180271
so_locations \
181-
.libs _libs \
182272
$(MOSTLYCLEANFILES) \
183-
"*.$(OBJEXT)" \
184-
"*.lo" \
273+
$(TEST_LOGS) \
274+
$(TEST_LOGS:.log=.trs) \
275+
$(TEST_SUITE_LOG) \
276+
"*.gcda" \
277+
"*.gcno" \
185278
$(DISTCLEANFILES) \
186279
$(am__CONFIG_DISTCLEAN_FILES) \
187280
$(CONFIG_CLEAN_FILES) \
188281
TAGS ID GTAGS GRTAGS GSYMS GPATH tags \
189282
"*.tab.c" \
190283
$(MAINTAINERCLEANFILES) \
191284
$(BUILT_SOURCES) \
192-
$(DEPDIR) \
285+
$(patsubst %.vala,%.c,$(filter %.vala,$(SOURCES))) \
286+
$(filter %_vala.stamp,$(DIST_COMMON)) \
287+
$(filter %.vapi,$(DIST_COMMON)) \
288+
$(filter $(addprefix %,$(notdir $(patsubst %.vapi,%.h,$(filter %.vapi,$(DIST_COMMON))))),$(DIST_COMMON)) \
193289
Makefile \
194290
Makefile.in \
195291
"*.orig" \
@@ -198,7 +294,11 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
198294
"*~" \
199295
".*.sw[nop]" \
200296
".dirstamp" \
201-
; do echo /$$x; done; \
297+
; do echo "/$$x"; done; \
298+
for x in \
299+
"*.$(OBJEXT)" \
300+
$(DEPDIR) \
301+
; do echo "$$x"; done; \
202302
} | \
203303
sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \
204304
sed 's@/[.]/@/@g' | \
@@ -212,12 +312,12 @@ gitignore-recurse-maybe:
212312
@for subdir in $(DIST_SUBDIRS); do \
213313
case " $(SUBDIRS) " in \
214314
*" $$subdir "*) :;; \
215-
*) test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse-maybe || echo "Skipping $$subdir");; \
315+
*) test "$$subdir" = . -o -e "$$subdir/.git" || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) gitignore || echo "Skipping $$subdir");; \
216316
esac; \
217317
done
218318
gitignore-recurse:
219319
@for subdir in $(DIST_SUBDIRS); do \
220-
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir"); \
320+
test "$$subdir" = . -o -e "$$subdir/.git" || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) gitignore || echo "Skipping $$subdir"); \
221321
done
222322
223323
maintainer-clean: gitignore-clean

0 commit comments

Comments
 (0)