blob: 6e2708f2dbc01e594a33dee2daf99913e0ecc081 [file] [log] [blame]
Behdad Esfahbod23e4fac2015-08-31 19:41:01 +01001# git.mk, a small Makefile to autogenerate .gitignore files
2# for autotools-based projects.
Behdad Esfahbod29aa4002009-11-02 16:28:39 -05003#
4# Copyright 2009, Red Hat, Inc.
Behdad Esfahbod22c625a2013-03-04 20:56:15 -05005# Copyright 2010,2011,2012,2013 Behdad Esfahbod
Behdad Esfahbod29aa4002009-11-02 16:28:39 -05006# Written by Behdad Esfahbod
7#
8# Copying and distribution of this file, with or without modification,
Behdad Esfahbod6efe1ec2012-07-11 15:30:08 -04009# is permitted in any medium without royalty provided the copyright
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050010# notice and this notice are preserved.
11#
Behdad Esfahbod22c625a2013-03-04 20:56:15 -050012# The latest version of this file can be downloaded from:
Behdad Esfahbodd1466782015-02-26 13:52:50 -080013GIT_MK_URL = https://raw.githubusercontent.com/behdad/git.mk/master/git.mk
14#
Behdad Esfahbod22c625a2013-03-04 20:56:15 -050015# Bugs, etc, should be reported upstream at:
16# https://github.com/behdad/git.mk
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050017#
18# To use in your project, import this file in your git repo's toplevel,
19# then do "make -f git.mk". This modifies all Makefile.am files in
Behdad Esfahbodbee74ef2012-01-27 02:14:08 -050020# your project to -include git.mk. Remember to add that line to new
21# Makefile.am files you create in your project, or just rerun the
22# "make -f git.mk".
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050023#
24# This enables automatic .gitignore generation. If you need to ignore
25# more files, add them to the GITIGNOREFILES variable in your Makefile.am.
26# But think twice before doing that. If a file has to be in .gitignore,
27# chances are very high that it's a generated file and should be in one
28# of MOSTLYCLEANFILES, CLEANFILES, DISTCLEANFILES, or MAINTAINERCLEANFILES.
29#
30# The only case that you need to manually add a file to GITIGNOREFILES is
31# when remove files in one of mostlyclean-local, clean-local, distclean-local,
Behdad Esfahbodbee74ef2012-01-27 02:14:08 -050032# or maintainer-clean-local make targets.
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050033#
34# Note that for files like editor backup, etc, there are better places to
35# ignore them. See "man gitignore".
36#
37# If "make maintainer-clean" removes the files but they are not recognized
38# by this script (that is, if "git status" shows untracked files still), send
39# me the output of "git status" as well as your Makefile.am and Makefile for
Behdad Esfahbodbee74ef2012-01-27 02:14:08 -050040# the directories involved and I'll diagnose.
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050041#
42# For a list of toplevel files that should be in MAINTAINERCLEANFILES, see
Behdad Esfahbodbee74ef2012-01-27 02:14:08 -050043# Makefile.am.sample in the git.mk git repo.
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050044#
45# Don't EXTRA_DIST this file. It is supposed to only live in git clones,
46# not tarballs. It serves no useful purpose in tarballs and clutters the
47# build dir.
48#
49# This file knows how to handle autoconf, automake, libtool, gtk-doc,
Behdad Esfahbodd1466782015-02-26 13:52:50 -080050# gnome-doc-utils, yelp.m4, mallard, intltool, gsettings, dejagnu, appdata,
Behdad Esfahbod2e025502017-10-27 10:23:01 -060051# appstream, hotdoc.
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050052#
Behdad Esfahbod6efe1ec2012-07-11 15:30:08 -040053# This makefile provides the following targets:
54#
55# - all: "make all" will build all gitignore files.
56# - gitignore: makes all gitignore files in the current dir and subdirs.
57# - .gitignore: make gitignore file for the current dir.
58# - gitignore-recurse: makes all gitignore files in the subdirs.
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050059#
60# KNOWN ISSUES:
61#
62# - Recursive configure doesn't work as $(top_srcdir)/git.mk inside the
63# submodule doesn't find us. If you have configure.{in,ac} files in
64# subdirs, add a proxy git.mk file in those dirs that simply does:
65# "include $(top_srcdir)/../git.mk". Add more ..'s to your taste.
66# And add those files to git. See vte/gnome-pty-helper/git.mk for
67# example.
68#
69
Behdad Esfahbod22c625a2013-03-04 20:56:15 -050070
71
72###############################################################################
73# Variables user modules may want to add to toplevel MAINTAINERCLEANFILES:
74###############################################################################
75
76#
77# Most autotools-using modules should be fine including this variable in their
78# toplevel MAINTAINERCLEANFILES:
79GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL = \
80 $(srcdir)/aclocal.m4 \
81 $(srcdir)/autoscan.log \
Behdad Esfahbod22c625a2013-03-04 20:56:15 -050082 $(srcdir)/configure.scan \
Behdad Esfahboddddf9902013-08-26 17:58:25 -040083 `AUX_DIR=$(srcdir)/$$(cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_AUX_DIR:$$1' ./configure.ac); \
Behdad Esfahbod627af692013-08-06 16:53:56 -040084 test "x$$AUX_DIR" = "x$(srcdir)/" && AUX_DIR=$(srcdir); \
85 for x in \
Behdad Esfahbod72225272013-08-06 15:19:23 -040086 ar-lib \
87 compile \
88 config.guess \
Behdad Esfahbod2e025502017-10-27 10:23:01 -060089 config.rpath \
Behdad Esfahbod72225272013-08-06 15:19:23 -040090 config.sub \
91 depcomp \
92 install-sh \
93 ltmain.sh \
94 missing \
95 mkinstalldirs \
Behdad Esfahbod6b4fdde2013-09-30 13:48:19 -040096 test-driver \
Behdad Esfahbodd1466782015-02-26 13:52:50 -080097 ylwrap \
Behdad Esfahbod72225272013-08-06 15:19:23 -040098 ; do echo "$$AUX_DIR/$$x"; done` \
Behdad Esfahboddddf9902013-08-26 17:58:25 -040099 `cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_HEADERS:$$1' ./configure.ac | \
Behdad Esfahbod72225272013-08-06 15:19:23 -0400100 head -n 1 | while read f; do echo "$(srcdir)/$$f.in"; done`
Behdad Esfahbod22c625a2013-03-04 20:56:15 -0500101#
102# All modules should also be fine including the following variable, which
103# removes automake-generated Makefile.in files:
104GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN = \
Behdad Esfahboddddf9902013-08-26 17:58:25 -0400105 `cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_FILES:$$1' ./configure.ac | \
Behdad Esfahbod22c625a2013-03-04 20:56:15 -0500106 while read f; do \
107 case $$f in Makefile|*/Makefile) \
108 test -f "$(srcdir)/$$f.am" && echo "$(srcdir)/$$f.in";; esac; \
109 done`
110#
Behdad Esfahbod6b4fdde2013-09-30 13:48:19 -0400111# Modules that use libtool and use AC_CONFIG_MACRO_DIR() may also include this,
112# though it's harmless to include regardless.
Behdad Esfahbod22c625a2013-03-04 20:56:15 -0500113GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL = \
Behdad Esfahbod6b4fdde2013-09-30 13:48:19 -0400114 `MACRO_DIR=$(srcdir)/$$(cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_MACRO_DIR:$$1' ./configure.ac); \
115 if test "x$$MACRO_DIR" != "x$(srcdir)/"; then \
116 for x in \
117 libtool.m4 \
118 ltoptions.m4 \
119 ltsugar.m4 \
120 ltversion.m4 \
121 lt~obsolete.m4 \
122 ; do echo "$$MACRO_DIR/$$x"; done; \
123 fi`
Behdad Esfahbod2e025502017-10-27 10:23:01 -0600124#
125# Modules that use gettext and use AC_CONFIG_MACRO_DIR() may also include this,
126# though it's harmless to include regardless.
127GITIGNORE_MAINTAINERCLEANFILES_M4_GETTEXT = \
128 `MACRO_DIR=$(srcdir)/$$(cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_MACRO_DIR:$$1' ./configure.ac); \
129 if test "x$$MACRO_DIR" != "x$(srcdir)/"; then \
130 for x in \
131 codeset.m4 \
132 extern-inline.m4 \
133 fcntl-o.m4 \
134 gettext.m4 \
135 glibc2.m4 \
136 glibc21.m4 \
137 iconv.m4 \
138 intdiv0.m4 \
139 intl.m4 \
140 intldir.m4 \
141 intlmacosx.m4 \
142 intmax.m4 \
143 inttypes-pri.m4 \
144 inttypes_h.m4 \
145 lcmessage.m4 \
146 lib-ld.m4 \
147 lib-link.m4 \
148 lib-prefix.m4 \
149 lock.m4 \
150 longlong.m4 \
151 nls.m4 \
152 po.m4 \
153 printf-posix.m4 \
154 progtest.m4 \
155 size_max.m4 \
156 stdint_h.m4 \
157 threadlib.m4 \
158 uintmax_t.m4 \
159 visibility.m4 \
160 wchar_t.m4 \
161 wint_t.m4 \
162 xsize.m4 \
163 ; do echo "$$MACRO_DIR/$$x"; done; \
164 fi`
Behdad Esfahbod22c625a2013-03-04 20:56:15 -0500165
166
167
168###############################################################################
169# Default rule is to install ourselves in all Makefile.am files:
170###############################################################################
171
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500172git-all: git-mk-install
173
174git-mk-install:
Behdad Esfahbod36a661c2013-04-11 13:38:37 -0400175 @echo "Installing git makefile"
Behdad Esfahbodbee74ef2012-01-27 02:14:08 -0500176 @any_failed=; \
177 find "`test -z "$(top_srcdir)" && echo . || echo "$(top_srcdir)"`" -name Makefile.am | while read x; do \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500178 if grep 'include .*/git.mk' $$x >/dev/null; then \
Behdad Esfahbod36a661c2013-04-11 13:38:37 -0400179 echo "$$x already includes git.mk"; \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500180 else \
181 failed=; \
182 echo "Updating $$x"; \
183 { cat $$x; \
184 echo ''; \
185 echo '-include $$(top_srcdir)/git.mk'; \
186 } > $$x.tmp || failed=1; \
187 if test x$$failed = x; then \
188 mv $$x.tmp $$x || failed=1; \
189 fi; \
190 if test x$$failed = x; then : else \
Behdad Esfahbod36a661c2013-04-11 13:38:37 -0400191 echo "Failed updating $$x"; >&2 \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500192 any_failed=1; \
193 fi; \
194 fi; done; test -z "$$any_failed"
195
Behdad Esfahbodd1466782015-02-26 13:52:50 -0800196git-mk-update:
197 wget $(GIT_MK_URL) -O $(top_srcdir)/git.mk
198
199.PHONY: git-all git-mk-install git-mk-update
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500200
201
Behdad Esfahbod22c625a2013-03-04 20:56:15 -0500202
203###############################################################################
204# Actual .gitignore generation:
205###############################################################################
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500206
207$(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
Behdad Esfahbod72225272013-08-06 15:19:23 -0400208 @echo "git.mk: Generating $@"
209 @{ \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500210 if test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x; then :; else \
211 for x in \
212 $(DOC_MODULE)-decl-list.txt \
213 $(DOC_MODULE)-decl.txt \
214 tmpl/$(DOC_MODULE)-unused.sgml \
215 "tmpl/*.bak" \
Behdad Esfahbod23e4fac2015-08-31 19:41:01 +0100216 $(REPORT_FILES) \
217 $(DOC_MODULE).pdf \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500218 xml html \
Behdad Esfahbod36a661c2013-04-11 13:38:37 -0400219 ; do echo "/$$x"; done; \
Behdad Esfahboddddf9902013-08-26 17:58:25 -0400220 FLAVOR=$$(cd $(top_srcdir); $(AUTOCONF) --trace 'GTK_DOC_CHECK:$$2' ./configure.ac); \
221 case $$FLAVOR in *no-tmpl*) echo /tmpl;; esac; \
Behdad Esfahbod23e4fac2015-08-31 19:41:01 +0100222 if echo "$(SCAN_OPTIONS)" | grep -q "\-\-rebuild-types"; then \
223 echo "/$(DOC_MODULE).types"; \
224 fi; \
225 if echo "$(SCAN_OPTIONS)" | grep -q "\-\-rebuild-sections"; then \
226 echo "/$(DOC_MODULE)-sections.txt"; \
227 fi; \
228 if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
229 for x in \
230 $(SETUP_FILES) \
231 $(DOC_MODULE).types \
232 ; do echo "/$$x"; done; \
233 fi; \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500234 fi; \
Behdad Esfahbodbee74ef2012-01-27 02:14:08 -0500235 if test "x$(DOC_MODULE)$(DOC_ID)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \
Behdad Esfahbod6efe1ec2012-07-11 15:30:08 -0400236 for lc in $(DOC_LINGUAS); do \
237 for x in \
238 $(if $(DOC_MODULE),$(DOC_MODULE).xml) \
239 $(DOC_PAGES) \
240 $(DOC_INCLUDES) \
Behdad Esfahbod36a661c2013-04-11 13:38:37 -0400241 ; do echo "/$$lc/$$x"; done; \
Behdad Esfahbod6efe1ec2012-07-11 15:30:08 -0400242 done; \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500243 for x in \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500244 $(_DOC_OMF_ALL) \
245 $(_DOC_DSK_ALL) \
246 $(_DOC_HTML_ALL) \
Behdad Esfahbodbee74ef2012-01-27 02:14:08 -0500247 $(_DOC_MOFILES) \
Behdad Esfahbodbee74ef2012-01-27 02:14:08 -0500248 $(DOC_H_FILE) \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500249 "*/.xml2po.mo" \
250 "*/*.omf.out" \
251 ; do echo /$$x; done; \
252 fi; \
Behdad Esfahbod2e025502017-10-27 10:23:01 -0600253 if test "x$(HOTDOC)" = x; then :; else \
254 $(foreach project, $(HOTDOC_PROJECTS),echo "/$(call HOTDOC_TARGET,$(project))"; \
255 echo "/$(shell $(call HOTDOC_PROJECT_COMMAND,$(project)) --get-conf-path output)" ; \
256 echo "/$(shell $(call HOTDOC_PROJECT_COMMAND,$(project)) --get-private-folder)" ; \
257 ) \
258 for x in \
259 .hotdoc.d \
260 ; do echo "/$$x"; done; \
261 fi; \
Behdad Esfahbodbee74ef2012-01-27 02:14:08 -0500262 if test "x$(HELP_ID)" = x -o "x$(HELP_LINGUAS)" = x; then :; else \
Behdad Esfahbod6efe1ec2012-07-11 15:30:08 -0400263 for lc in $(HELP_LINGUAS); do \
264 for x in \
265 $(HELP_FILES) \
266 "$$lc.stamp" \
267 "$$lc.mo" \
Behdad Esfahbod36a661c2013-04-11 13:38:37 -0400268 ; do echo "/$$lc/$$x"; done; \
Behdad Esfahbod6efe1ec2012-07-11 15:30:08 -0400269 done; \
Behdad Esfahbodbee74ef2012-01-27 02:14:08 -0500270 fi; \
271 if test "x$(gsettings_SCHEMAS)" = x; then :; else \
272 for x in \
273 $(gsettings_SCHEMAS:.xml=.valid) \
274 $(gsettings__enum_file) \
Behdad Esfahbod36a661c2013-04-11 13:38:37 -0400275 ; do echo "/$$x"; done; \
Behdad Esfahbodbee74ef2012-01-27 02:14:08 -0500276 fi; \
Behdad Esfahbodd1466782015-02-26 13:52:50 -0800277 if test "x$(appdata_XML)" = x; then :; else \
278 for x in \
279 $(appdata_XML:.xml=.valid) \
280 ; do echo "/$$x"; done; \
281 fi; \
282 if test "x$(appstream_XML)" = x; then :; else \
283 for x in \
284 $(appstream_XML:.xml=.valid) \
285 ; do echo "/$$x"; done; \
286 fi; \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500287 if test -f $(srcdir)/po/Makefile.in.in; then \
288 for x in \
Behdad Esfahbod2e025502017-10-27 10:23:01 -0600289 ABOUT-NLS \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500290 po/Makefile.in.in \
Behdad Esfahbod72225272013-08-06 15:19:23 -0400291 po/Makefile.in.in~ \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500292 po/Makefile.in \
293 po/Makefile \
Behdad Esfahbod72225272013-08-06 15:19:23 -0400294 po/Makevars.template \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500295 po/POTFILES \
Behdad Esfahbod72225272013-08-06 15:19:23 -0400296 po/Rules-quot \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500297 po/stamp-it \
Behdad Esfahbod2e025502017-10-27 10:23:01 -0600298 po/stamp-po \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500299 po/.intltool-merge-cache \
300 "po/*.gmo" \
Behdad Esfahbod72225272013-08-06 15:19:23 -0400301 "po/*.header" \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500302 "po/*.mo" \
Behdad Esfahbod72225272013-08-06 15:19:23 -0400303 "po/*.sed" \
304 "po/*.sin" \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500305 po/$(GETTEXT_PACKAGE).pot \
306 intltool-extract.in \
307 intltool-merge.in \
308 intltool-update.in \
Behdad Esfahbod36a661c2013-04-11 13:38:37 -0400309 ; do echo "/$$x"; done; \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500310 fi; \
311 if test -f $(srcdir)/configure; then \
312 for x in \
313 autom4te.cache \
314 configure \
315 config.h \
316 stamp-h1 \
317 libtool \
318 config.lt \
Behdad Esfahbod36a661c2013-04-11 13:38:37 -0400319 ; do echo "/$$x"; done; \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500320 fi; \
Behdad Esfahbod6efe1ec2012-07-11 15:30:08 -0400321 if test "x$(DEJATOOL)" = x; then :; else \
322 for x in \
323 $(DEJATOOL) \
Behdad Esfahbod36a661c2013-04-11 13:38:37 -0400324 ; do echo "/$$x.sum"; echo "/$$x.log"; done; \
Behdad Esfahbod6efe1ec2012-07-11 15:30:08 -0400325 echo /site.exp; \
326 fi; \
Behdad Esfahbod36a661c2013-04-11 13:38:37 -0400327 if test "x$(am__dirstamp)" = x; then :; else \
328 echo "$(am__dirstamp)"; \
329 fi; \
Behdad Esfahbod2e025502017-10-27 10:23:01 -0600330 if test "x$(findstring libtool,$(LTCOMPILE))" = x -a "x$(findstring libtool,$(LTCXXCOMPILE))" = x -a "x$(GTKDOC_RUN)" = x; then :; else \
Behdad Esfahbod36a661c2013-04-11 13:38:37 -0400331 for x in \
332 "*.lo" \
333 ".libs" "_libs" \
334 ; do echo "$$x"; done; \
335 fi; \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500336 for x in \
337 .gitignore \
338 $(GITIGNOREFILES) \
339 $(CLEANFILES) \
Behdad Esfahbod6efe1ec2012-07-11 15:30:08 -0400340 $(PROGRAMS) $(check_PROGRAMS) $(EXTRA_PROGRAMS) \
341 $(LIBRARIES) $(check_LIBRARIES) $(EXTRA_LIBRARIES) \
342 $(LTLIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LTLIBRARIES) \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500343 so_locations \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500344 $(MOSTLYCLEANFILES) \
Behdad Esfahboddddf9902013-08-26 17:58:25 -0400345 $(TEST_LOGS) \
346 $(TEST_LOGS:.log=.trs) \
347 $(TEST_SUITE_LOG) \
Behdad Esfahbodd1466782015-02-26 13:52:50 -0800348 $(TESTS:=.test) \
349 "*.gcda" \
350 "*.gcno" \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500351 $(DISTCLEANFILES) \
352 $(am__CONFIG_DISTCLEAN_FILES) \
353 $(CONFIG_CLEAN_FILES) \
354 TAGS ID GTAGS GRTAGS GSYMS GPATH tags \
355 "*.tab.c" \
356 $(MAINTAINERCLEANFILES) \
357 $(BUILT_SOURCES) \
Behdad Esfahboddddf9902013-08-26 17:58:25 -0400358 $(patsubst %.vala,%.c,$(filter %.vala,$(SOURCES))) \
359 $(filter %_vala.stamp,$(DIST_COMMON)) \
360 $(filter %.vapi,$(DIST_COMMON)) \
Behdad Esfahbodd1466782015-02-26 13:52:50 -0800361 $(filter $(addprefix %,$(notdir $(patsubst %.vapi,%.h,$(filter %.vapi,$(DIST_COMMON))))),$(DIST_COMMON)) \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500362 Makefile \
363 Makefile.in \
364 "*.orig" \
365 "*.rej" \
366 "*.bak" \
367 "*~" \
368 ".*.sw[nop]" \
Behdad Esfahbodbee74ef2012-01-27 02:14:08 -0500369 ".dirstamp" \
Behdad Esfahbod36a661c2013-04-11 13:38:37 -0400370 ; do echo "/$$x"; done; \
Behdad Esfahbodd1466782015-02-26 13:52:50 -0800371 for x in \
372 "*.$(OBJEXT)" \
373 $(DEPDIR) \
374 ; do echo "$$x"; done; \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500375 } | \
376 sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \
377 sed 's@/[.]/@/@g' | \
378 LC_ALL=C sort | uniq > $@.tmp && \
379 mv $@.tmp $@;
380
381all: $(srcdir)/.gitignore gitignore-recurse-maybe
Behdad Esfahbod6efe1ec2012-07-11 15:30:08 -0400382gitignore: $(srcdir)/.gitignore gitignore-recurse
383
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500384gitignore-recurse-maybe:
Behdad Esfahbodbee74ef2012-01-27 02:14:08 -0500385 @for subdir in $(DIST_SUBDIRS); do \
386 case " $(SUBDIRS) " in \
387 *" $$subdir "*) :;; \
Behdad Esfahbod72225272013-08-06 15:19:23 -0400388 *) test "$$subdir" = . -o -e "$$subdir/.git" || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) gitignore || echo "Skipping $$subdir");; \
Behdad Esfahbodbee74ef2012-01-27 02:14:08 -0500389 esac; \
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500390 done
Behdad Esfahbod6efe1ec2012-07-11 15:30:08 -0400391gitignore-recurse:
392 @for subdir in $(DIST_SUBDIRS); do \
Behdad Esfahbod72225272013-08-06 15:19:23 -0400393 test "$$subdir" = . -o -e "$$subdir/.git" || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) gitignore || echo "Skipping $$subdir"); \
Behdad Esfahbod6efe1ec2012-07-11 15:30:08 -0400394 done
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500395
396maintainer-clean: gitignore-clean
397gitignore-clean:
398 -rm -f $(srcdir)/.gitignore
399
400.PHONY: gitignore-clean gitignore gitignore-recurse gitignore-recurse-maybe