diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2014-11-01 20:00:48 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2014-11-01 20:14:40 -0700 |
commit | 4cb6d87b7da8b852ed8ead5aebde99b1ea6abda7 (patch) | |
tree | 79ef269685a5fce60feaf7749a46b867d25279de /scripts | |
parent | fe4c7d9583a3c06df08a7f013a901fd6a3456bfd (diff) | |
download | riscv-gnu-toolchain-4cb6d87b7da8b852ed8ead5aebde99b1ea6abda7.zip riscv-gnu-toolchain-4cb6d87b7da8b852ed8ead5aebde99b1ea6abda7.tar.gz riscv-gnu-toolchain-4cb6d87b7da8b852ed8ead5aebde99b1ea6abda7.tar.bz2 |
Use symlinks instead of hard links
This allows the build dir to be on a different file system than the source
dir, and it also enables proper operation of e.g. git checkout/stash.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/cp_s | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/cp_s b/scripts/cp_s new file mode 100755 index 0000000..babc5e5 --- /dev/null +++ b/scripts/cp_s @@ -0,0 +1,19 @@ +#!/bin/bash +# This script emulates the cp -s command, which Mac OS doesn't support. + +set -e + +pushd $1 > /dev/null +SRCDIR=`pwd` +DIRS=`find . -type d` +FILES=`find . -type f` +popd > /dev/null + +pushd $2 > /dev/null +for i in $DIRS; do + mkdir -p $i +done +for i in $FILES; do + ln -f -s $SRCDIR/$i $i +done +popd > /dev/null |