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


all: rfc2104.elc imap.elc nnimap.elc nnimap.info

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

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

nnimap.elc: rfc2104.elc imap.elc nnimap.el
	$(ELCC) $(GNUS) -l rfc2104.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 imap.elc nnimap.elc rfc2104.elc nnimap.info nnimap.html

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