1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
SHELL=/bin/sh
.SUFFIXES:
.SUFFIXES: .c .o .pl .pm .pod .html .man
PERL = @PERL@
CC = @CC@
CFLAGS = @CFLAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
RM = rm -f
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = $(exec_prefix)/bin
infodir = $(prefix)/info
all::
@echo making $@ in `basename \`pwd\``
all:: test1.conf test2.conf
@echo making $@ in `basename \`pwd\``
test:: test1 test2 benchmark
test1 test2:: test1.conf test2.conf ../src/squidGuard requests
@echo $@..
@$(RM) squidGuard.log
@echo Database size:
@if [ $@ = test1 ];\
then\
wc -l blacklist/domains blacklist/urls;\
else\
wc -l blacklist/domains blacklist/urls blacklist/expressions;\
fi
@wc -l<requests | awk '{printf "Running $@ with %d requests..",$$1}'
@-cat requests | ../src/squidGuard -c $@.conf | grep -v Processing |grep -v done >$@.output; exit 0
@echo .Done
@echo @ac_n@ "Checking number of output lines..@ac_c@"
@test `wc -l<requests` -eq `wc -l<$@.output`
@echo .OK
@echo @ac_n@ "Checking the output against the expected..@ac_c@"
@-cmp -s $@.output $@.expected
@echo .OK
@lines=`wc -l<requests`;\
awk -F'[()]' '/ squidGuard.+started \([0-9]+\.[0-9]+\)$$/ {start=$$(NF-1)};\
/ squidGuard ready for requests \([0-9]+\.[0-9]+\)$$/ {ready=$$(NF-1)};\
/ squidGuard stopped \([0-9]+\.[0-9]+\)$$/ {stop=$$(NF-1)};\
END {printf "squidGuard initialization took %.3f seconds\n",ready-start;\
printf "squidGuard handled %d requests in %.3f seconds\n",\
'"$$lines"',stop-ready}' \
squidGuard.log
@echo ""
benchmark:: test1.conf ../src/squidGuard requests
@echo $@..
@$(RM) squidGuard.log
@echo Database size:
@wc -l blacklist/domains blacklist/urls
@wc -l<requests | awk '{printf "Running $@ test with %d requests..",$$1*100}'
@-i=100; while [ $$i -gt 0 ]; do cat requests; i=`expr $$i - 1`;done \
| ../src/squidGuard -c test1.conf>/dev/null; exit 0
@echo .Done
@lines=`wc -l<requests`;\
awk -F'[()]' '/ squidGuard.+started \([0-9]+\.[0-9]+\)$$/ {start=$$(NF-1)};\
/ squidGuard ready for requests \([0-9]+\.[0-9]+\)$$/ {ready=$$(NF-1)};\
/ squidGuard stopped \([0-9]+\.[0-9]+\)$$/ {stop=$$(NF-1)};\
END {printf "squidGuard initialization took %.3f seconds\n",ready-start;\
printf "squidGuard handled %d requests in %.3f seconds\n",\
'"$$lines"'*100,stop-ready}' \
squidGuard.log
../src/squidGuard:
@echo making $@ in `basename \`pwd\``
(cd ../src; make squidGuard)
update::
@echo making $@ in `basename \`pwd\``
clean::
@echo making $@ in `basename \`pwd\``
$(RM) *~ *.bak core *.log *.error
$(RM) blacklist/*~ blacklist/*.bak blacklist/core
$(RM) squidGuard.log squidGuard.log test1.output test2.output
realclean:: clean
@echo making $@ in `basename \`pwd\``
$(RM) TAGS *.orig
distclean:: realclean
@echo making $@ in `basename \`pwd\``
$(RM) Makefile test1.conf test2.conf
|