GNUSDIR=
EMACS=emacs
ELCC=$(EMACS) -batch -q -no-site-file -no-init-file
GNUS=-eval '(if (not (string-match "$(GNUSDIR)" "")) \
                     (setq load-path (cons "$(GNUSDIR)" load-path)))'
VERSION=`date +%y%m%d-%H%M`


all: nnimap.elc nnimap.info

rfc2104.elc: rfc2104.el
	$(ELCC) $(GNUS) -f batch-byte-compile rfc2104.el

ssl.elc: ssl.el
	$(ELCC) $(GNUS) -l base64 -f batch-byte-compile ssl.el

utf7.elc: utf7.el
	$(ELCC) $(GNUS) -f batch-byte-compile utf7.el

imap.elc: rfc2104.elc ssl.elc utf7.elc imap.el
	$(ELCC) $(GNUS) -l base64 -l md5 -l rfc2104.elc -l utf7.elc -f batch-byte-compile imap.el

nnimap.elc: rfc2104.elc imap.elc nnimap.el
	$(ELCC) $(GNUS) -l base64 -l md5 -l rfc2104.elc -l utf7.elc -l imap.elc -f batch-byte-compile nnimap.el

nnimap.html: nnimap.texi
	texi2html -menu -monolithic nnimap.texi

nnimap.info: nnimap.texi
	makeinfo nnimap.texi

clean:
	rm -f rfc2104.elc ssl.elc utf7.elc imap.elc nnimap.elc nnimap.info nnimap.html

tar:
	cvs export -D now -d nnimap-$(VERSION) nnimap
	tar cvfz nnimap-$(VERSION).tar.gz nnimap-$(VERSION)
