0003-append.sh - scc - simple c99 compiler
 (HTM) git clone git://git.simple-cc.org/scc
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
 (DIR) README
 (DIR) LICENSE
       ---
       0003-append.sh (582B)
       ---
            1 #!/bin/sh
            2 
            3 set -e
            4 
            5 tmp1=`mktemp`
            6 tmp2=`mktemp`
            7 
            8 trap "rm -f file* f1 f2 f3 $tmp1 $tmp2" 0 2 3 15
            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 
           22 cat <<EOF > $tmp2
           23 file-1
           24 file-2
           25 file-3
           26 EOF
           27 
           28 cmp $tmp1 $tmp2
           29 
           30 $EXEC scc ar -p file.a file-1 file-2 file-3 > $tmp1
           31 
           32 cat <<EOF > $tmp2
           33 First
           34 Second
           35 Third
           36 EOF
           37 
           38 cmp $tmp1 $tmp2