Makefile revision 276486
1# $FreeBSD: stable/10/tools/regression/filemon/Makefile 276486 2014-12-31 23:25:37Z ngie $ 2 3.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" 4BI_BITS= 5.endif 6 7_BINS= \ 8 filemontest \ 9 timed-forkb \ 10 sizeof_long 11 12BINS= ${_BINS} 13.if defined(BI_BITS) 14BINS+= ${_BINS:C/$/32/g} 15.endif 16 17bins: ${BINS} 18all: bins 19 20MAN= 21 22WARNS?= 6 23CFLAGS+= -I${.CURDIR}/../../../sys 24 25# Should be "WITHOUT_CTF=" below, but stupid infastrurture fails: 26# "/usr/share/mk/bsd.own.mk", line 489: WITH_CTF and WITHOUT_CTF can't both be set. 27WITHOUT_CDDL= 28 29CLEANFILES+= ${BINS} 30 31 32.for f32 in ${BINS} 33${f32}32: ${f32}.c 34 ${CC} -m32 -DBIT=\"32\" -o ${.TARGET} ${CFLAGS} ${.ALLSRC} 35.endfor 36 37tests: 38 kldstat | grep filemon 39 @echo "" 40 ${MAKE} test01 41 ${MAKE} test02 42.if defined(BI_BITS) 43 ${MAKE} test32 44.endif 45 @echo "filemon(4) tests passed." 46 47# Cannot use .OBJDIR -- 'filemontest' expects 'test_script.sh' in . 48test01: ${BINS:Mfilemontest*} ${BINS:Msizeof_long*} clean-test 49.for BIN in ${BINS:Mfilemontest} 50 cd ${.CURDIR} ; \ 51 for A in 1 2 3 4 5 6 7 8 9 0; do \ 52 for B in 1 2 3 4 5 6 7 8 9 0; do \ 53 for C in 1 2 3 4 5 6 7 8 9 0; do \ 54 test -x ${BIN} && ${.OBJDIR}/${BIN} ;\ 55 done ;\ 56 done ;\ 57 done 58 @cd ${.CURDIR} ; set +e ; egrep '(Start|Stop) .*\.' filemon_log.* | \ 59 grep -q -v '\.[0-9][0-9][0-9][0-9][0-9][0-9]$$' || printf "Time stamp format OK\n\n" 60.endfor 61 @cd ${.CURDIR} ; set +e ; for F in filemon_log.* ; do \ 62 tail -1 $$F | grep -q '# Bye bye' || echo "$$F missing filemon bye-bye" ; \ 63 NL=`wc -l $$F | awk '{print $$1}'` ; \ 64 if [ "$${NL}" != 97 ]; then echo "$$F BAD, contains $${NL} lines" ; exit 1 ; fi ; done 65 66test02: ${BINS:Mtimed-forkb*} 67 @echo "Without filemon(4) active:" 68 ./timed-forkb 69 @echo "With filemon(4) active:" 70 script -f typescript-timed-forkb ./timed-forkb 71 ls -l typescript-timed-forkb.filemon 72 73test32: ${BINS:M*32*} 74 script -f typescript.${.TARGET} ./sizeof_long32 >/dev/null 75 @tail -1 typescript.test32.filemon | grep -q '# Bye bye' || (echo '32-bit comapt filemon Missing "bye-bye"' ; exit 1) 76 @egrep -q '^X [0-9]+ 0$$' typescript.test32.filemon || (echo "32-bit binary exit ERROR" ; exit 1) 77 @printf "filemon(4) 32bit FreeBSD support passed.\n\n" 78 79CLEANFILES+= typescript-timed-forkb typescript-timed-forkb.filemon 80 81clean-test: 82 cd ${.CURDIR} ; rm -f filemon_log*.* 83 84clean-tests: clean-test 85 86.include <bsd.prog.mk> 87