runit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

compile (671B)


      1 #!/bin/sh
      2 set -e
      3 
      4 umask 022
      5 test -d package || sh -cx '! : Wrong working directory.'
      6 test -d src || sh -cx '! : Wrong working directory.'
      7 
      8 here=`env - PATH=$PATH pwd`
      9 
     10 mkdir -p compile command
     11 test -r compile/home || echo $here >compile/home
     12 test -h compile/src || ln -s $here/src compile/src
     13 
     14 echo 'Linking ./src/* into ./compile...'
     15 for i in `ls src`; do
     16   test -h compile/$i || ln -s src/$i compile/$i
     17 done
     18 
     19 echo 'Compiling everything in ./compile...'
     20 sh -cxe 'cd compile; exec make'
     21 
     22 echo 'Copying commands into ./command...'
     23 for i in `cat package/commands`; do
     24   rm -f command/$i'{new}'
     25   cp -p compile/$i command/$i'{new}'
     26   mv -f command/$i'{new}' command/$i
     27 done