RN rnmake  3.0.0
cppath.sh
1 #!/bin/sh
2 # Package: RN Makefile System Utility
3 # File: cppath.sh
4 # Desc: Copies path file to destination directory.
5 # Usage: cppath.sh <src> <dstdir>
6 #
7 # /*! \file */
8 # /*! \cond RNMAKE_DOXY*/
9 
10 src=$1
11 dstdir=$2
12 
13 if [ "$src" = "" ]
14 then
15  echo "rnmake: $0: error: no source file."
16  exit 2
17 fi
18 if [ "$dstdir" = "" ]
19 then
20  echo "rnmake: $0: error: no destination directory."
21  exit 2
22 fi
23 
24 if [ -d $src ]
25 then
26  d=$dstdir/$src
27  test -d $d || mkdir -p -m 775 $d
28 else
29  d=$dstdir/$(dirname $src)
30  test -d $d || mkdir -p -m 775 $d
31  cp -p $src $d/.
32 fi
33 
34 #/*! \endcond RNMAKE_DOXY */