Edit

kc3-lang/automake/lib/symlink-tree

Branch :

  • Show log

    Commit

  • Author : Alexandre Duret-Lutz
    Date : 2003-07-23 21:04:17
    Hash : 36fd44a7
    Message : * automake.in (handle_multilib): Register all-multi. (file_contents_internal): Insert n when concatenating actions from "factored" rules. * lib/config-ml.in: New file, from GCC, including a patch from Ralf Corsepius (see GCC's PR 11526). * lib/symlink-tree.in: New file, from GCC. * lib/Makefile.am (dist_script_DATA): Add config-ml.in and symlink-tree. * lib/am/clean.am (distclean-generic): Do not delete Makefile here... (distclean, maintainer-clean): ... do it here. * lib/am/depend.am (distclean-depend): Likewise, replace by (distclean, maintainer-clean): ... these. * lib/am/multilib.am (all-recursive, install-recursive, mostlyclean-recursive, clean-recursive, distclean-recursive, maintainer-clean-recursive): Remove these rules. (mostlyclean-am, clean-am, distclean-am, maintainer-clean-am): Replace by ... (mostlyclean, clean, distclean, maintainer-clean): ... these. (all-am): Remove, done in handle_multilib. (install-am): Replace by ... (install-exec-am): ... this. * tests/Makefile.am (TESTS): Add multlib.test. * tests/multlib.test: New file, based on a test case by Ralf Corsepius

  • lib/symlink-tree
  • #!/bin/sh
    # Create a symlink tree.
    #
    # Syntax: symlink-tree srcdir "ignore1 ignore2 ..."
    #
    # where srcdir is the directory to create a symlink tree to,
    # and "ignoreN" is a list of files/directories to ignore.
    
    prog=$0
    srcdir=$1
    ignore="$2"
    
    if test $# -lt 1; then
      echo "symlink-tree error:  Usage: symlink-tree srcdir \"ignore1 ignore2 ...\""
      exit 1
    fi
    
    ignore_additional=". .. CVS"
    
    # If we were invoked with a relative path name, adjust ${prog} to work
    # in subdirs.
    case ${prog} in
    /* | [A-Za-z]:[\\/]*) ;;
    *) prog=../${prog} ;;
    esac
    
    # Set newsrcdir to something subdirectories can use.
    case ${srcdir} in
    /* | [A-Za-z]:[\\/]*) newsrcdir=${srcdir} ;;
    *) newsrcdir=../${srcdir} ;;
    esac
    
    for f in `ls -a ${srcdir}`; do
      if [ -d ${srcdir}/$f ]; then
        found=
        for i in ${ignore} ${ignore_additional}; do
          if [ "$f" = "$i" ]; then
    	found=yes
          fi
        done
        if [ -z "${found}" ]; then
          echo "$f		..working in"
          if [ -d $f ]; then true; else mkdir $f; fi
          (cd $f; ${prog} ${newsrcdir}/$f "${ignore}")
        fi
      else
        echo "$f		..linked"
        rm -f $f
        ln -s ${srcdir}/$f .
      fi
    done
    
    exit 0