scc

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

0003-append.sh (548B)


      1 #!/bin/sh
      2 
      3 set -e
      4 
      5 trap 'rm -f file* $tmp1' EXIT
      6 trap 'exit $?' HUP INT TERM
      7 
      8 tmp1=tmp1.$$
      9 
     10 ###########################################################################
     11 #Append generated files at once to an existing archive
     12 
     13 echo First > file-1
     14 echo Second > file-2
     15 echo Third > file-3
     16 
     17 cp master.a file.a
     18 $EXEC scc ar -qv file.a file-1 file-2 file-3
     19 
     20 $EXEC scc ar -t file.a file-1 file-2 file-3 > $tmp1
     21 diff -u $tmp1 - <<EOF
     22 file-1
     23 file-2
     24 file-3
     25 EOF
     26 
     27 $EXEC scc ar -p file.a file-1 file-2 file-3 > $tmp1
     28 diff -u $tmp1 - <<EOF
     29 First
     30 Second
     31 Third
     32 EOF