1 distdir = $(PACKAGE)-$(VERSION)
5 (cd $(srcdir) && automake --include-deps --output-dir=$(distdir))
6 @for file in $(DISTFILES); do \
7 ## Test for file existence because sometimes a file gets included in
8 ## DISTFILES twice. For example this happens when a single source
9 ## file is used in building more than one program. Also, there are
10 ## situations in which "ln" can fail. For instance a file to
11 ## distribute could actually be a cross-filesystem symlink -- this can
12 ## easily happen if "gettextize" was run on the distribution.
13 test -f $(distdir)/$$file || { \
14 echo linking $$file; \
15 ln $(srcdir)/$$file $(distdir)/$$file; \
17 echo copying $$file instead; \
18 cp -p $(srcdir)/$$file $(distdir)/$$file; \
21 for subdir in $(SUBDIRS); do \
22 ## Test for directory existence here because previous automake
23 ## invocation might have created some directories.
24 test -d $(distdir)/$$subdir \
25 || mkdir $(distdir)/$$subdir \
27 chmod 777 $(distdir)/$$subdir; \
28 (cd $$subdir && $(MAKE) $@) || exit 1; \
30 ## Set "sublist" here because shells fail on "for dir in ; do".
31 @sublist="$(DIST_SUBDIRS)"; \
32 for dir in $$sublist; do \
33 echo copying directory $$dir; \
34 tar -chf - $$dir | (cd $(distdir) && tar -xBpf -); \
36 chmod -R a+r $(distdir)
37 tar -chozf $(distdir).tar.gz $(distdir)