mkbuild

mk based build system
git clone git://git.2f30.org/mkbuild.git
Log | Files | Refs | LICENSE

mk.install (1904B)


      1 install:QV: install_bin install_lib install_man install_other \
      2 			install_dirs install_symlinks $INSTALL_EXTRA
      3 	if test "$INSTALL_PERMISSIONS" != ""; then
      4 		eval `echo $INSTALL_PERMISSIONS | tr ' ' '\n' | paste -d ' ' - - | \
      5 			awk '{ printf("echo \"CHMOD %s ${ROOT}${PREFIX}%s\"; \
      6 				chmod %s ${ROOT}${PREFIX}%s;\n", $1, $2, $1, $2) }'`
      7 	fi
      8 
      9 install_bin:QV: all
     10 	for f in $INSTALL_BIN; do
     11 		$INSTALL -d -m 755 ${ROOT}$BINDIR
     12 		echo INSTALL ${ROOT}$BINDIR/`basename $f`
     13 		$INSTALL -m 755 $f ${ROOT}$BINDIR/`basename $f`
     14 		type=`file -b $f | cut -d ' ' -f 1`
     15 		if test "$type" = "ELF"; then
     16 			$STRIP ${ROOT}$BINDIR/`basename $f`
     17 		fi
     18 	done
     19 
     20 install_lib:QV: all
     21 	for f in $INSTALL_LIB; do
     22 		$INSTALL -d -m 755 ${ROOT}$LIBDIR
     23 		echo INSTALL ${ROOT}$LIBDIR/`basename $f`
     24 		$INSTALL -m 644 $f ${ROOT}$LIBDIR/`basename $f`
     25 	done
     26 
     27 install_dirs:QV: all
     28 	for f in $INSTALL_DIRS; do
     29 		echo MKDIR ${ROOT}${PREFIX}$f
     30 		$INSTALL -d -m 755 ${ROOT}${PREFIX}$f
     31 	done
     32 
     33 install_man:QV: all
     34 	for i in 1 1b 2 3 4 5 6 7 8 9; do
     35 		a=`echo '\$INSTALL_MAN'$i`
     36 		a=`eval echo $a`
     37 		for f in $a; do
     38 			$INSTALL -d -m 755 ${ROOT}$MANDIR/man$i
     39 			echo INSTALL ${ROOT}$MANDIR/man$i/`basename $f`
     40 			$INSTALL -m 644 $f ${ROOT}$MANDIR/man$i/`basename $f`
     41 		done
     42 	done
     43 
     44 install_other:QV: all
     45 	for i in 1 2 3 4 5 6 7 8; do
     46 		a=`echo '\$INSTALL_OTHER'$i`
     47 		a=`eval echo $a`
     48 		d=`echo '\$INSTALL_OTHER'${i}'_DIR'`
     49 		d=`eval echo $d`
     50 		p=`echo '\$INSTALL_OTHER'${i}'_PERMS'`
     51 		p=`eval echo $p`
     52 		test "$p" = "" && p=644
     53 		$INSTALL -d -m 755 ${ROOT}$d
     54 		for f in $a; do
     55 			echo INSTALL ${ROOT}${PREFIX}$d/`basename $f`
     56 			$INSTALL -m $p $f ${ROOT}${PREFIX}$d/`basename $f`
     57 		done
     58 	done
     59 
     60 install_symlinks:QV: all
     61 	if test "$INSTALL_SYMLINK" != ""; then
     62 		eval `echo $INSTALL_SYMLINK | tr ' ' '\n' | paste -d ' ' - - | \
     63 			awk '{ printf("echo \"LN %s ${ROOT}${PREFIX}%s\"; \
     64 				ln -sf %s ${ROOT}${PREFIX}%s;\n", $1, $2, $1, $2) }'`
     65 	fi