scc

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

0107-inference.sh (348B)


      1 #!/bin/sh
      2 
      3 trap 'rm -f $tmp1 f f.?' EXIT
      4 trap 'exit $?' HUP INT TERM
      5 
      6 tmp1=tmp1.$$
      7 
      8 cat >f.c <<'EOF'
      9 int
     10 main(void)
     11 {
     12 	return 0;
     13 }
     14 EOF
     15 
     16 touch -d '1970-01-01 00:00:01' f.h
     17 touch -d '1970-01-01 00:00:03' f
     18 touch -d '1970-01-01 00:00:04' f.c
     19 
     20 $EXEC scc make -f- <<'EOF' > $tmp1 2>&1
     21 f: f.h
     22 
     23 f.h:
     24 	touch $@
     25 EOF
     26 
     27 diff $tmp1 - <<EOF
     28 c99 -O  -o f f.c
     29 EOF