SHELL=/bin/sh
.SUFFIXES:
.SUFFIXES: .c .o .pl .pm .pod .html .man

CC = @CC@
CFLAGS = @CFLAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
PERL = @PERL@
MKDIR = @top_srcdir@/mkinstalldirs

RM = rm -f

prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = $(exec_prefix)/bin
infodir = $(prefix)/info

all::
	@echo making $@ in `basename \`pwd\``

update::
	@echo making $@ in `basename \`pwd\``

update:: squidGuard.cgi.in dest/blacklists.tar.gz

squidGuard.cgi.in: @CGIFILE@
	@echo making $@ in `basename \`pwd\``
	cp -p $? $@
	$(PERL) -0777 -pi -e 's;^#!\s?/\S*perl;#! \100PERL\100;;s;\.(ost\.eltele|teledanmark)\.no;your-domain;;s;blacklist\\\@squidguard.org;operator\\\@your-domain;;' $@

dest/blacklists.tar.gz:: @BLACKLISTS@
	@echo making $@ in `basename \`pwd\``
	cp -p $? $@
	chmod 660 $@

clean::
	@echo making $@ in `basename \`pwd\``
	$(RM) *~ *.bak core *.log *.error
	$(RM) dest/*~ dest/*.bak dest/core
	$(RM) dest/financial/*~ dest/financial/*.bak dest/financial/core

realclean:: clean
	@echo making $@ in `basename \`pwd\``
	$(RM) TAGS *.orig

distclean:: realclean
	@echo making $@ in `basename \`pwd\``
	$(RM) Makefile sample.conf squidGuard.cgi squidGuard-simple.cgi
