PROGS=libcstrlen ARCH!=uname -m .if ${ARCH} == i386 PROGS+=asmstrlen .endif PROGS+=basestrlen strlen strlen2 # Generate random strings for testing but only during testing. STRLENS=01 02 03 04 05 06 07 08 11 16 20 27 32 40 49 53 64 99 .for ndx in ${STRLENS} STR[${ndx}]!=jot -r -c ${ndx} a z | rs -g 0 ${ndx} .endfor # Test increasing lengths of strings against each program. test: .for prog in ${PROGS} .for ndx in ${STRLENS} @rm -f ${prog}.${ndx} results.${ndx} @echo "Testing ${prog} strlen() == ${ndx}" .for iter in 1 2 3 4 5 6 7 8 9 10 @../${prog} ${STR[${ndx}]} | tr -s '\t' | cut -f 3 >> ${prog}.${ndx} .endfor .endfor @echo "" .endfor .for ndx in ${STRLENS} @ministat ${PROGS:C/$/.${ndx}/} > results.${ndx} .endfor clean: rm -f *.o *~ ${PROGS} *.core *.gmon *.[0-9]*