# 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-autoresponder-mysql.1.html qmail-autoresponder.1.html

install: INSTHIER conf-bin conf-man
	bg-installer -v <INSTHIER
	bg-installer -c <INSTHIER

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}'" "-Wl,-R'$${bglibs}'" '-o "$$main" "$$main.o" $${1+"$$@"}' -lbg-sysdeps; \
	) >load
	chmod 755 load

main.o: compile main.c qmail-autoresponder.h
	./compile main.c

mysql: qmail-autoresponder-mysql

options.o: compile options.c qmail-autoresponder.h
	./compile options.c

programs: qmail-autoresponder

qmail-autoresponder: qmail-autoresponder.o load main.o options.o
	./load qmail-autoresponder main.o options.o -lbg 

qmail-autoresponder-mysql: qmail-autoresponder-mysql.o load main.o options.o
	./load qmail-autoresponder-mysql main.o options.o -lbg -L/usr/lib/mysql -L/usr/local/lib/mysql -lmysqlclient 

qmail-autoresponder-mysql.1.html: qmail-autoresponder-mysql.1
	man2html qmail-autoresponder-mysql.1 >qmail-autoresponder-mysql.1.html

qmail-autoresponder-mysql.o: compile qmail-autoresponder-mysql.c qmail-autoresponder.h
	./compile qmail-autoresponder-mysql.c

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

qmail-autoresponder.o: compile qmail-autoresponder.c qmail-autoresponder.h
	./compile qmail-autoresponder.c

