Edit

kc3-lang/automake/dist-subd-top.am

Branch :

  • Show log

    Commit

  • Author : Tom Tromey
    Date : 1996-01-02 02:20:18
    Hash : 3aba9acd
    Message : Many changes from Franc,ois

  • dist-subd-top.am
  • distdir = $(PACKAGE)-$(VERSION)
    dist: $(DISTFILES)
    	rm -rf $(distdir)
    	mkdir $(distdir)
    ## We need an absolute path for --output-dir.  Get that here.
    	distdir=`cd $(distdir) && pwd` \
    	  && cd $(srcdir) \
    	  && automake --include-deps --output-dir=$$distdir
    	@for file in $(DISTFILES); do		\
    ## Test for file existence because sometimes a file gets included in
    ## DISTFILES twice.  For example this happens when a single source
    ## file is used in building more than one program.  Also, there are
    ## situations in which "ln" can fail.  For instance a file to
    ## distribute could actually be a cross-filesystem symlink -- this can
    ## easily happen if "gettextize" was run on the distribution.
    	  test -f $(distdir)/$$file \
    	    || ln $(srcdir)/$$file $(distdir)/$$file \
    	    || cp -p $(srcdir)/$$file $(distdir)/$$file; \
    	done
    	for subdir in $(SUBDIRS); do		\
    ## Test for directory existence here because previous automake
    ## invocation might have created some directories.
    	  test -d $(distdir)/$$subdir		\
    	  || mkdir $(distdir)/$$subdir		\
    	  || exit 1;				\
    	  chmod 777 $(distdir)/$$subdir;	\
    	  (cd $$subdir && $(MAKE) $@) || exit 1; \
    	done
    ## Set "sublist" here because shells fail on "for dir in ; do".
    	@sublist="$(DIST_SUBDIRS)";		\
    	for dir in $$sublist; do		\
    	  echo copying directory $$dir;		\
    	  tar -chf - $$dir | (cd $(distdir) && tar -xBpf -); \
    	done
    	chmod -R a+r $(distdir)
    	tar -chozf $(distdir).tar.gz $(distdir)
    	rm -rf $(distdir)