[go: up one dir, main page]

Menu

[2e2bd2]: / utils / mkbuild.sh  Maximize  Restore  History

Download this file

23 lines (18 with data), 556 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
error() {
rc=$1; shift
echo $* >&2
exit $rc
}
BUILDDIR=${1:-../build}
SOURCEDIR=${2:-$PWD}
[ ! -d "$SOURCEDIR" ] && error 1\
"Invalid source directory: \`$SOURCEDIR'"
[ -e "$BUILDDIR" ] && error 1\
"Build directory exists: \`$BUILDDIR'"
[ "$SOURCEDIR" -ef "$BUILDDIR" ] && error 1\
"Identical source and build directory: \`$SOURCEDIR' and \`$BUILDDIR'"
find $SOURCEDIR -type d -not -name CVS \
-printf $BUILDDIR/%P\\0 | xargs -0 mkdir -p
find $SOURCEDIR -type f -not -path \*/CVS/\* \
-printf "ln -s %p $BUILDDIR/%P\\n" | sh