1#!/bin/sh 2 3D=.. 4sed 's/^T(//;s/,//;s/)//' functions.h | while read N T 5do 6 [ "$T" ] || continue 7 8 [ -e $D/$N.c ] || { 9 cp template/$T.c $D/$N.c || continue 10 ND=`echo $N |sed 's/l$//'` 11 12 H='' 13 for i in crlibm/$N.h ucb/$N.h sanity/$N.h 14 do 15 [ -e $D/$i ] && H="$H#include \"$i\"\\n" 16 done 17 DH='' 18 for i in crlibm/$ND.h ucb/$ND.h sanity/$ND.h 19 do 20 [ -e $D/$i ] && DH="$DH#include \"$i\"\\n" 21 done 22 23 sed -i "s/___/$N/g;s,DHEADERS,$DH,;s,HEADERS,$H," $D/$N.c 24 } 25done 26