# # blunder -- build a library that provides safe versions # of blunders like strncpy's not null-terminating # C strings. # LINTOPTS=-errchk -errfmt=simple -errsecurity -errtags -erroff=E_NAME_DEF_NOT_USED2,E_SEC_SHELL_WARN,E_SEC_STRCPY_WARN,E_GLOBAL_COULD_BE_STATIC2,E_INCONS_ARG_DECL2 all: blunder.so.1 bogon strlcpy blunder.so.1: blunder.c lint ${LINTOPTS} blunder.c cc -g -KPIC -xregs=no%appl -errshort=short -c blunder.c ld -G -z defs -o blunder.so.1 \ blunder.o -lc bogon: bogon.c cc -g -errshort=short -o bogon bogon.c strlcpy: strlcpy.c lint ${LINTOPTS} strlcpy.c cc -g -errshort=short -o strlcpy strlcpy.c test: blunder.so.1 bogon LD_PRELOAD=./blunder.so.1 bogon clean: rm -f blunder.so.1 bogon *.o core strlcpy rm -f /var/tmp/blunder_core.* tar: (cd ..; tar cvf blunder.tar ./blunder/blunder.so.1 \ ./blunder/blunder.1 blunder/bogon) mv ../blunder.tar .