# Don't edit Makefile!  Use conf-* for configuration.
#
# Generated by spac see http://untroubled.org/spac/

SHELL=/bin/sh

DEFAULT: all

all: libraries programs docs

clean: TARGETS
	rm -f `cat TARGETS`

clean-spac: clean AUTOFILES
	rm -f `cat AUTOFILES`

compile: conf-cc conf-bgincs
	( bgincs=`head -n 1 conf-bgincs`; \
	  echo '#!/bin/sh'; \
	  echo 'source=$$1; shift'; \
	  echo 'base=`echo "$$source" | sed -e s:\\\\.c$$::`'; \
	  echo exec `head -n 1 conf-cc` -I. "-I'$${bgincs}'" '-o $${base}.o -c $$source $${1+"$$@"}'; \
	) >compile
	chmod 755 compile

docs: qmail-qfilter.1.html

install: BIN conf-bin MAN conf-man
	bg-installer -v "`head -n 1 conf-bin`" <BIN
	bg-installer -c "`head -n 1 conf-bin`" <BIN
	bg-installer -v "`head -n 1 conf-man`" <MAN
	bg-installer -c "`head -n 1 conf-man`" <MAN

libraries: 

load: conf-ld conf-bglibs
	( bglibs=`head -n 1 conf-bglibs`; \
	  echo '#!/bin/sh';\
	  echo 'main="$$1"; shift';\
	  echo exec `head -n 1 conf-ld` -L. "-L'$${bglibs}'" '-o "$$main" "$$main.o" $${1+"$$@"}' -lbg-sysdeps; \
	) >load
	chmod 755 load

programs: qmail-qfilter

qmail-qfilter: load qmail-qfilter.o
	./load qmail-qfilter   

qmail-qfilter.1.html: qmail-qfilter.1
	man2html qmail-qfilter.1 >qmail-qfilter.1.html

qmail-qfilter.o: compile qmail-qfilter.c
	./compile qmail-qfilter.c

