Blame src/math/gen/gentests.sh

nsz f9d179
#!/bin/sh
nsz f9d179
nsz f9d179
D=..
nsz f9d179
sed 's/^T(//;s/,//;s/)//' functions.h | while read N T
nsz f9d179
do
nsz cb9f87
	[ "$T" ] || continue
nsz cb9f87
nsz 21dd45
	[ -e $D/$N.c ] || {
nsz f9d179
		cp template/$T.c $D/$N.c || continue
nsz f9d179
		ND=`echo $N |sed 's/l$//'`
nsz f9d179
nsz f9d179
		H=''
nsz f9d179
		for i in crlibm/$N.h ucb/$N.h sanity/$N.h
nsz f9d179
		do
nsz 4282b0
			[ -e $D/$i ] && H="$H#include \"$i\"\\n"
nsz f9d179
		done
nsz f9d179
		DH=''
nsz f9d179
		for i in crlibm/$ND.h ucb/$ND.h sanity/$ND.h
nsz f9d179
		do
nsz 4282b0
			[ -e $D/$i ] && DH="$DH#include \"$i\"\\n"
nsz f9d179
		done
nsz f9d179
nsz 4282b0
		sed -i "s/___/$N/g;s,DHEADERS,$DH,;s,HEADERS,$H," $D/$N.c
nsz 21dd45
	}
nsz f9d179
done