Merge branch 'msvc'
[platform/upstream/automake.git] / lib / am / distdir.am
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
3 ## 2010 Free Software Foundation, Inc.
4
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 2, or (at your option)
8 ## any later version.
9
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ## GNU General Public License for more details.
14
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 ## DIST_COMMON comes first so that README can be the very first file.
19 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
20
21 if %?TOPDIR_P%
22 distdir = $(PACKAGE)-$(VERSION)
23 top_distdir = $(distdir)
24
25 am__remove_distdir = \
26   { test ! -d "$(distdir)" \
27     || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
28          && rm -fr "$(distdir)"; }; }
29 am__post_remove_distdir = $(am__remove_distdir)
30 endif %?TOPDIR_P%
31
32 if %?SUBDIRS%
33 ## computes a relative pathname RELDIR such that DIR1/RELDIR = DIR2.
34 ## Input:
35 ## - DIR1            relative pathname, relative to the current directory
36 ## - DIR2            relative pathname, relative to the current directory
37 ## Output:
38 ## - reldir          relative pathname of DIR2, relative to DIR1
39 am__relativize = \
40   dir0=`pwd`; \
41   sed_first='s,^\([^/]*\)/.*$$,\1,'; \
42   sed_rest='s,^[^/]*/*,,'; \
43   sed_last='s,^.*/\([^/]*\)$$,\1,'; \
44   sed_butlast='s,/*[^/]*$$,,'; \
45   while test -n "$$dir1"; do \
46     first=`echo "$$dir1" | sed -e "$$sed_first"`; \
47     if test "$$first" != "."; then \
48       if test "$$first" = ".."; then \
49         dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
50         dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
51       else \
52         first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
53         if test "$$first2" = "$$first"; then \
54           dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
55         else \
56           dir2="../$$dir2"; \
57         fi; \
58         dir0="$$dir0"/"$$first"; \
59       fi; \
60     fi; \
61     dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
62   done; \
63   reldir="$$dir2"
64 endif %?SUBDIRS%
65
66 .PHONY: distdir
67 if %?SUBDIRS%
68 AM_RECURSIVE_TARGETS += distdir
69 endif %?SUBDIRS%
70
71 distdir: $(DISTFILES)
72 ##
73 ## For Gnits users, this is pretty handy.  Look at 15 lines
74 ## in case some explanatory text is desirable.
75 ##
76 if %?TOPDIR_P%
77 if  %?CK-NEWS%
78         @case `sed 15q $(srcdir)/NEWS` in \
79         *"$(VERSION)"*) : ;; \
80         *) \
81           echo "NEWS not updated; not releasing" 1>&2; \
82           exit 1;; \
83         esac
84 endif  %?CK-NEWS%
85 endif %?TOPDIR_P%
86 ##
87 ## `missing help2man' may have created some bogus man pages.  Ensure they
88 ## are not distributed.
89 ##
90 if %?INSTALL-MAN%
91 if %?HAVE-MANS%
92         @list='$(MANS)'; if test -n "$$list"; then \
93           list=`for p in $$list; do \
94             if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
95 ## Note that we check existing man pages here only.  If there are man pages
96 ## which are not distributed, and may be generated only conditionally, then
97 ## we should not error out because of them.  This could be refined to take
98 ## into account only dist_*_MANS, but then we'd be missing out on those
99 ## the user distributes with EXTRA_DIST.
100             if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
101           if test -n "$$list" && \
102             grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
103             echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
104             grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
105             echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
106             echo "       typically \`make maintainer-clean' will remove them" >&2; \
107             exit 1; \
108           else :; fi; \
109         else :; fi
110 endif %?HAVE-MANS%
111 endif %?INSTALL-MAN%
112 ##
113 ## Only for the top dir.
114 ##
115 if %?TOPDIR_P%
116         $(am__remove_distdir)
117         test -d "$(distdir)" || mkdir "$(distdir)"
118 endif %?TOPDIR_P%
119 ##
120 ##
121         @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
122         topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
123 ##
124 ## Yet another hack to support SUN make.
125 ##
126 ## Let's assume `foo' appears in DISTFILES and is not a built file.
127 ## When building with VPATH=$(srcdir), SUN make and OSF1/Tru64 will
128 ## rewrite `foo' as `$(srcdir)/foo'.  An attempt to install the file
129 ## with
130 ##    cp $file $(distdir)/$file
131 ## will thus install $(srcdir)/foo as $(distdir)/$(srcdir)/foo
132 ## instead of $(distdir)/foo.
133 ##
134 ## So let's strip this leading $(srcdir)/ when it exists.  (As far we
135 ## know, only SUN make and OSF1/Tru64 make add it.)  Searching whether
136 ## the file is to be found in the source or build directory will be
137 ## done later.
138 ##
139 ## In case we are _not_ using SUN or OSF1/Tru64 make, how can we be sure
140 ## we are not stripping a legitimate filename that starts with the
141 ## same pattern as $(srcdir)?
142 ## Well, it can't happen without the Makefile author distributing
143 ## something out of the distribution (which is bad).   As an example,
144 ## consider `EXTRA_DIST = ../bar'.  This is an issue if $srcdir is `..',
145 ## however getting this value for srcdir is impossible: `EXTRA_DIST = ../bar'
146 ## implies we are in a subdirectory (so `../bar' is within the package),
147 ## hence `$srcdir' is something like `../../subdir'.
148 ##
149 ## There is more to say about files which are above the current directory,
150 ## like `../bar' in the previous example.  The OSF1/Tru64 make
151 ## implementation can simplify filenames resulting from a VPATH lookup.
152 ## For instance if `VPATH = ../../subdir' and `../bar' is found in that
153 ## VPATH directory, then occurrences of `../bar' will be replaced by
154 ## `../../bar' (instead of `../../subdir/../bar').  This obviously defeats
155 ## any attempt to strip a leading $srcdir.  Presently we have no workaround
156 ## for this.  We avoid this issue by writing `EXTRA_DIST = $(srcdir)/../bar'
157 ## instead of `EXTRA_DIST = ../bar'.  This prefixing is needed only for files
158 ## above the current directory.  Fortunately, apart from auxdir files which
159 ## can be located in .. or ../.., this situation hardly occurs in practice.
160 ##
161 ## Also rewrite $(top_srcdir) (which sometimes appears in DISTFILES, and can
162 ## be absolute) by $(top_builddir) (which is always relative).  $(srcdir) will
163 ## be prepended later.
164         list='$(DISTFILES)'; \
165           dist_files=`for file in $$list; do echo $$file; done | \
166           sed -e "s|^$$srcdirstrip/||;t" \
167               -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
168 ## (The second `t' command clears the flag for the next round.)
169 ##
170 ## Make the subdirectories for the files.
171 ##
172         case $$dist_files in \
173           */*) $(MKDIR_P) `echo "$$dist_files" | \
174                            sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
175                            sort -u` ;; \
176         esac; \
177 ##
178 ##
179         for file in $$dist_files; do \
180 ##
181 ## Always look for the file in the build directory first.  That way
182 ## for something like yacc output we will correctly pick up the latest
183 ## version.  Also check for directories in the build directory first,
184 ## so one can ship generated directories.
185 ##
186           if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
187 ##
188 ## Use cp, not ln.  There are situations in which "ln" can fail.  For
189 ## instance a file to distribute could actually be a cross-filesystem
190 ## symlink -- this can easily happen if "gettextize" was run on the
191 ## distribution.
192 ##
193           if test -d $$d/$$file; then \
194 ## Don't mention $$file in the destination argument, since this fails if
195 ## the destination directory already exists.  Also, use `-R' and not `-r'.
196 ## `-r' is almost always incorrect.
197 ##
198 ## If a directory exists both in `.' and $(srcdir), then
199 ## We copy the files from $(srcdir) first and then install those from
200 ## `.'.  This can help people who distribute directories made of
201 ## source files _and_ generated files.  It is also important when the
202 ## directory exists only in $(srcdir), because some vendor Make (such
203 ## as Tru64) will magically create an empty directory in `.'
204             dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
205 ## If the destination directory already exists, it may contain read-only
206 ## files, e.g., during `make distcheck'.
207             if test -d "$(distdir)/$$file"; then \
208               find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
209             fi; \
210             if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
211               cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
212               find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
213             fi; \
214             cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
215           else \
216 ## Test for file existence because sometimes a file gets included in
217 ## DISTFILES twice.  For example this happens when a single source
218 ## file is used in building more than one program.
219             test -f "$(distdir)/$$file" \
220             || cp -p $$d/$$file "$(distdir)/$$file" \
221             || exit 1; \
222           fi; \
223         done
224 ##
225 ## Test for directory existence here because previous automake
226 ## invocation might have created some directories.  Note that we
227 ## explicitly set distdir for the subdir make; that lets us mix-n-match
228 ## many automake-using packages into one large package, and have "dist"
229 ## at the top level do the right thing.  If we're in the topmost
230 ## directory, then we use `distdir' instead of `top_distdir'; this lets
231 ## us work correctly with an enclosing package.
232 ##
233 ## Split the loop for the directory creation and the one for recursion,
234 ## so that with GNU make -n, only the latter is executed.
235 if %?SUBDIRS%
236         @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
237           if test "$$subdir" = .; then :; else \
238             test -d "$(distdir)/$$subdir" \
239             || $(MKDIR_P) "$(distdir)/$$subdir" \
240             || exit 1; \
241           fi; \
242         done
243         @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
244           if test "$$subdir" = .; then :; else \
245             dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
246             $(am__relativize); \
247             new_distdir=$$reldir; \
248             dir1=$$subdir; dir2="$(top_distdir)"; \
249             $(am__relativize); \
250             new_top_distdir=$$reldir; \
251             echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
252             echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
253             ($(am__cd) $$subdir && \
254               $(MAKE) $(AM_MAKEFLAGS) \
255                 top_distdir="$$new_top_distdir" \
256                 distdir="$$new_distdir" \
257 ## Disable am__remove_distdir so that sub-packages do not clear a
258 ## directory we have already cleared and might even have populated
259 ## (e.g. shared AUX dir in the sub-package).
260                 am__remove_distdir=: \
261 ## Disable filename length check:
262                 am__skip_length_check=: \
263 ## No need to fix modes more than once:
264                 am__skip_mode_fix=: \
265                 distdir) \
266               || exit 1; \
267           fi; \
268         done
269 endif %?SUBDIRS%
270 ##
271 ## We might have to perform some last second updates, such as updating
272 ## info files.
273 ## We must explicitly set distdir and top_distdir for these sub-makes.
274 ##
275 if %?DIST-TARGETS%
276         $(MAKE) $(AM_MAKEFLAGS) \
277           top_distdir="$(top_distdir)" distdir="$(distdir)" \
278           %DIST-TARGETS%
279 endif %?DIST-TARGETS%
280 ##
281 ## This complex find command will try to avoid changing the modes of
282 ## links into the source tree, in case they're hard-linked.
283 ##
284 ## Ignore return result from chmod, because it might give an error
285 ## if we chmod a symlink.
286 ##
287 ## Another nastiness: if the file is unreadable by us, we make it
288 ## readable regardless of the number of links to it.  This only
289 ## happens in perverse cases.
290 ##
291 ## We use $(install_sh) because that is a known-portable way to modify
292 ## the file in place in the source tree.
293 ##
294 ## If we are being invoked recursively, then there is no need to walk
295 ## the whole subtree again.  This is a complexity reduction for a deep
296 ## hierarchy of subpackages.
297 ##
298 if %?TOPDIR_P%
299         -test -n "$(am__skip_mode_fix)" \
300         || find "$(distdir)" -type d ! -perm -755 \
301                 -exec chmod u+rwx,go+rx {} \; -o \
302           ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
303           ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
304           ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
305         || chmod -R a+r "$(distdir)"
306 if %?FILENAME_FILTER%
307         @if test -z "$(am__skip_length_check)" && find "$(distdir)" -type f -print | \
308           grep '^%FILENAME_FILTER%' 1>&2; then \
309           echo 'error: the above filenames are too long' 1>&2; \
310           exit 1; \
311         else :; fi
312 endif %?FILENAME_FILTER%
313 endif %?TOPDIR_P%
314
315
316
317 ## --------------------------------------- ##
318 ## Building various distribution flavors.  ##
319 ## --------------------------------------- ##
320
321 ## Note that we don't use GNU tar's `-z' option.  One reason (but not
322 ## the only reason) is that some versions of tar (e.g., OSF1)
323 ## interpret `-z' differently.
324 ##
325 ## The -o option of GNU tar used to exclude empty directories.  This
326 ## behavior was fixed in tar 1.12 (released on 1997-04-25).  But older
327 ## versions of tar are still used (for instance NetBSD 1.6.1 ships
328 ## with tar 1.11.2).  We do not do anything specific w.r.t. this
329 ## incompatibility since packages where empty directories need to be
330 ## present in the archive are really unusual.
331 ##
332 ## We order DIST_TARGETS by expected duration of the compressors,
333 ## slowest first, for better parallelism in `make dist'.  Do not
334 ## reorder DIST_ARCHIVES, users may expect gzip to be first.
335
336 if %?TOPDIR_P%
337
338 ?GZIP?DIST_ARCHIVES += $(distdir).tar.gz
339 GZIP_ENV = --best
340 .PHONY: dist-gzip
341 dist-gzip: distdir
342         tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
343         $(am__post_remove_distdir)
344
345 ?BZIP2?DIST_ARCHIVES += $(distdir).tar.bz2
346 .PHONY: dist-bzip2
347 dist-bzip2: distdir
348         tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
349         $(am__post_remove_distdir)
350
351 ?LZIP?DIST_ARCHIVES += $(distdir).tar.lz
352 .PHONY: dist-lzip
353 dist-lzip: distdir
354         tardir=$(distdir) && $(am__tar) | lzip -9 -c >$(distdir).tar.lz
355         $(am__post_remove_distdir)
356
357 ?LZMA?DIST_ARCHIVES += $(distdir).tar.lzma
358 .PHONY: dist-lzma
359 dist-lzma: distdir
360         tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
361         $(am__post_remove_distdir)
362
363 ?XZ?DIST_ARCHIVES += $(distdir).tar.xz
364 .PHONY: dist-xz
365 dist-xz: distdir
366         tardir=$(distdir) && $(am__tar) | xz -9 -c >$(distdir).tar.xz
367         $(am__post_remove_distdir)
368
369 ?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z
370 .PHONY: dist-tarZ
371 dist-tarZ: distdir
372         tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
373         $(am__post_remove_distdir)
374
375 ?SHAR?DIST_ARCHIVES += $(distdir).shar.gz
376 .PHONY: dist-shar
377 dist-shar: distdir
378         shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
379         $(am__post_remove_distdir)
380
381 ?ZIP?DIST_ARCHIVES += $(distdir).zip
382 .PHONY: dist-zip
383 dist-zip: distdir
384         -rm -f $(distdir).zip
385         zip -rq $(distdir).zip $(distdir)
386         $(am__post_remove_distdir)
387
388 ?LZMA?DIST_TARGETS += dist-lzma
389 ?LZIP?DIST_TARGETS += dist-lzip
390 ?XZ?DIST_TARGETS += dist-xz
391 ?SHAR?DIST_TARGETS += dist-shar
392 ?BZIP2?DIST_TARGETS += dist-bzip2
393 ?GZIP?DIST_TARGETS += dist-gzip
394 ?ZIP?DIST_TARGETS += dist-zip
395 ?COMPRESS?DIST_TARGETS += dist-tarZ
396
397 endif %?TOPDIR_P%
398
399
400
401 ## ------------------------------------------------- ##
402 ## Building all the requested distribution flavors.  ##
403 ## ------------------------------------------------- ##
404
405 ## Currently we cannot use if/endif inside a rule.  The file_contents
406 ## parser needs work.
407
408 if %?TOPDIR_P%
409
410 .PHONY: dist dist-all
411 if %?SUBDIRS%
412 AM_RECURSIVE_TARGETS += dist dist-all
413 endif %?SUBDIRS%
414
415 dist dist-all:
416         $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
417         $(am__post_remove_distdir)
418
419 endif %?TOPDIR_P%
420
421
422 ## ------------------------- ##
423 ## Checking a distribution.  ##
424 ## ------------------------- ##
425
426
427 if %?TOPDIR_P%
428 if %?SUBDIRS%
429 AM_RECURSIVE_TARGETS += distcheck
430 endif %?SUBDIRS%
431
432 # This target untars the dist file and tries a VPATH configuration.  Then
433 # it guarantees that the distribution is self-contained by making another
434 # tarfile.
435 .PHONY: distcheck
436 distcheck: dist
437         case '$(DIST_ARCHIVES)' in \
438         *.tar.gz*) \
439           GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
440         *.tar.bz2*) \
441           bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
442         *.tar.lzma*) \
443           lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
444         *.tar.lz*) \
445           lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
446         *.tar.xz*) \
447           xz -dc $(distdir).tar.xz | $(am__untar) ;;\
448         *.tar.Z*) \
449           uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
450         *.shar.gz*) \
451           GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
452         *.zip*) \
453           unzip $(distdir).zip ;;\
454         esac
455 ## Make the new source tree read-only.  Distributions ought to work in
456 ## this case.  However, make the top-level directory writable so we
457 ## can make our new subdirs.
458         chmod -R a-w $(distdir); chmod a+w $(distdir)
459         mkdir $(distdir)/_build
460         mkdir $(distdir)/_inst
461 ## Undo the write access.
462         chmod a-w $(distdir)
463 ## With GNU make, the following command will be executed even with `make -n',
464 ## due to the presence of `$(MAKE)'.  That is normally all well (and `$(MAKE)'
465 ## is necessary for things like parallel distcheck), but here we don't want
466 ## execution.  To avoid MAKEFLAGS parsing hassles, use a witness file that a
467 ## non-`-n' run would have just created.
468         test -d $(distdir)/_build || exit 0; \
469 ## Compute the absolute path of `_inst'.  Strip any leading DOS drive
470 ## to allow DESTDIR installations.  Otherwise "$(DESTDIR)$(prefix)" would
471 ## expand to "c:/temp/am-dc-5668/c:/src/package/package-1.0/_inst".
472         dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
473 ## We will attempt a DESTDIR install in $dc_destdir.  We don't
474 ## create this directory under $dc_install_base, because it would
475 ## create very long directory names.
476           && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
477 ?DISTCHECK-HOOK?          && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
478 ## Parallel BSD make may not start a new shell for each command in a recipe,
479 ## so be sure to `cd' back to the original directory after this.
480           && am__cwd=`pwd` \
481           && $(am__cd) $(distdir)/_build \
482           && ../configure --srcdir=.. --prefix="$$dc_install_base" \
483 ?GETTEXT?           --with-included-gettext \
484 ## Additional flags for configure.  Keep this last in the configure
485 ## invocation so the user can override previous options.
486             $(DISTCHECK_CONFIGURE_FLAGS) \
487           && $(MAKE) $(AM_MAKEFLAGS) \
488           && $(MAKE) $(AM_MAKEFLAGS) dvi \
489           && $(MAKE) $(AM_MAKEFLAGS) check \
490           && $(MAKE) $(AM_MAKEFLAGS) install \
491           && $(MAKE) $(AM_MAKEFLAGS) installcheck \
492           && $(MAKE) $(AM_MAKEFLAGS) uninstall \
493           && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
494                 distuninstallcheck \
495 ## Make sure the package has proper DESTDIR support (we could not test this
496 ## in the previous install/installcheck/uninstall test, because it's reasonable
497 ## for installcheck to fail in a DESTDIR install).
498 ## We make the `$dc_install_base' read-only because this is where files
499 ## with missing DESTDIR support are likely to be installed.
500           && chmod -R a-w "$$dc_install_base" \
501 ## The logic here is quite convoluted because we must clean $dc_destdir
502 ## whatever happens (it won't be erased by the next run of distcheck like
503 ## $(distdir) is).
504           && ({ \
505 ## Build the directory, so we can cd into it even if `make install'
506 ## didn't create it.  Use mkdir, not $(MKDIR_P) because we want to
507 ## fail if the directory already exists (PR/413).
508                (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
509                && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
510                && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
511                && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
512                     distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
513               } || { rm -rf "$$dc_destdir"; exit 1; }) \
514           && rm -rf "$$dc_destdir" \
515           && $(MAKE) $(AM_MAKEFLAGS) dist \
516 ## Make sure to remove the dists we created in the test build directory.
517           && rm -rf $(DIST_ARCHIVES) \
518           && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
519 ## Cater to parallel BSD make (see above).
520           && cd "$$am__cwd" \
521           || exit 1
522         $(am__post_remove_distdir)
523         @(echo "$(distdir) archives ready for distribution: "; \
524           list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
525           sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
526
527 ## Define distuninstallcheck_listfiles and distuninstallcheck separately
528 ## from distcheck, so that they can be overridden by the user.
529 .PHONY: distuninstallcheck
530 distuninstallcheck_listfiles = find . -type f -print
531 distuninstallcheck:
532 ## We use -le 1 because the `dir' file (created by install-info)
533 ## might still exist after uninstall.
534         @$(am__cd) '$(distuninstallcheck_dir)' \
535         && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
536            || { echo "ERROR: files left after uninstall:" ; \
537                 if test -n "$(DESTDIR)"; then \
538                   echo "  (check DESTDIR support)"; \
539                 fi ; \
540                 $(distuninstallcheck_listfiles) ; \
541                 exit 1; } >&2
542
543 ## Define distcleancheck_listfiles and distcleancheck separately
544 ## from distcheck, so that they can be overridden by the user.
545 .PHONY: distcleancheck
546 distcleancheck_listfiles = find . -type f -print
547 distcleancheck: distclean
548         @if test '$(srcdir)' = . ; then \
549           echo "ERROR: distcleancheck can only run from a VPATH build" ; \
550           exit 1 ; \
551         fi
552         @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
553           || { echo "ERROR: files left in build directory after distclean:" ; \
554                $(distcleancheck_listfiles) ; \
555                exit 1; } >&2
556 endif %?TOPDIR_P%