scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

install (412B)


      1 #!/bin/sh
      2 
      3 set -e
      4 
      5 for i
      6 do
      7 	case "$i" in
      8 	-p)
      9 		proto=$2
     10 		shift 2
     11 		;;
     12 	-*)
     13 		echo 1=$1
     14 		echo usage: install -t prefix [-p proto] >&2
     15 		exit 1
     16 		;;
     17 	esac
     18 done
     19 
     20 prefix=$1
     21 
     22 while read type perm name
     23 do
     24 	case $type in
     25 	d)
     26 		mkdir -p ${prefix?}/$name
     27 		;;
     28 	f)
     29 		cp $name ${prefix?}/$name
     30 		;;
     31 	*)
     32 		echo install: wrong entry type >&2
     33 		exit 1
     34 		;;
     35 	esac
     36 
     37 	chmod $perm $prefix/$name
     38 done < ${proto:-scripts/proto}