# $OpenBSD: Makefile,v 1.1 2003/06/26 18:37:28 avsm Exp $ C_MODULES?= strlcpy strlcat getcwd memcpy fread memcpy declare sscanf CPP_MODULES?= snprintf sscanf C_STRLCPY= 1 2 3 4 5 6 C_STRLCAT= 1 2 3 4 5 C_GETCWD= 1 2 3 4 C_MEMCPY= 1 2 3 4 5 6 C_FREAD= 1 2 3 4 C_DECLARE= 1 2 3 4 5 6 7 8 9 10 11 12 13 C_SSCANF= 1 2 CPP_SNPRINTF= 1 2 3 4 5 CPP_SSCANF= 1 TCC= gcc TCFLAGS= -Wbounded -Wformat -pedantic TCXX= g++ TCXXFLAGS= ${TCFLAGS} REGRESS_TARGETS= ${C_TARGETS} ${CPP_TARGETS} .for i in ${C_MODULES} . for j in ${C_${i:U}} C_TARGETS+= ${i}-${j} ${i}-${j}: ${TCC} ${TCFLAGS} -o /dev/null ${i}-${j}.c 2>&1 | diff -u - ${.CURDIR}/${i}-${j}.c.exp . endfor .endfor .for i in ${CPP_MODULES} . for j in ${CPP_${i:U}} CPP_TARGETS+= ${i}-${j} ${i}-${j}: ${TCXX} ${TCXXFLAGS} -o /dev/null ${i}-${j}.cpp 2>&1 | grep -v 'misused' | diff -u - ${.CURDIR}/${i}-${j}.cpp.exp . endfor .endfor generate: .for i in ${C_TARGETS} -${TCC} ${TCFLAGS} -o /dev/null ${i}.c >${i}.c.exp 2>&1 .endfor .for i in ${CPP_TARGETS} -${TCXX} ${TCXXFLAGS} -o /dev/null ${i}.cpp >${i}.cpp.exp 2>&1 .endfor .PHONY: ${REGRESS_TARGETS} generate regress .include