scc

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

mkdep (312B)


      1 #!/bin/sh
      2 
      3 set -e
      4 
      5 (echo '/^#deps/+;$c'
      6 
      7 for i in `find . -name '*.c'`
      8 do
      9 	file=`basename $i | sed 's/\.c$/.o/'`
     10 	dir=`dirname $i`
     11 
     12 	sed -n "/^#include / {
     13 		s///
     14 		s@\"\(.*\)\"@$dir/$file: $dir/\1@p
     15 		s@<\(scc/.*\)>@$dir/$file: \$(INCDIR)/scc/\1@p
     16 	}" $i
     17 done | LC_ALL=C sort -s
     18 
     19 echo .
     20 echo w) | ed -s deps.mk