scc

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

0002-append.sh (540B)


      1 #!/bin/sh
      2 
      3 set -e
      4 
      5 tmp1=`mktemp`
      6 tmp2=`mktemp`
      7 
      8 trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3 15
      9 
     10 ###########################################################################
     11 #Append generated files one by one to an empty file
     12 
     13 echo First > file1
     14 echo Second > file2
     15 echo Third > file3
     16 
     17 rm -f file.a
     18 scc-ar -qv file.a file1
     19 scc-ar -qv file.a file2
     20 scc-ar -qv file.a file3
     21 scc-ar -t file.a > $tmp1
     22 
     23 cat <<EOF > $tmp2
     24 file1
     25 file2
     26 file3
     27 EOF
     28 
     29 cmp $tmp1 $tmp2
     30 
     31 scc-ar -p file.a > $tmp1
     32 
     33 cat <<EOF > $tmp2
     34 First
     35 Second
     36 Third
     37 EOF
     38 
     39 cmp $tmp1 $tmp2