# pour configurer ca :
# mettre dans lispdir l'endrois ou vous voulez mettre dinel
# changer eventuelent /usr/bin/emacs par ce qui convient
lispdir = $(HOME)/lang/elisp/dino/
srcdir = .

SOURCE = dino-cnx.el dino-console-mode.el dino-entete-mode.el dino-gestion.el\
         dino-list-mode.el dino-msg-mode.el dino-poste-mode.el\
         dino.el tq2.el dino-pile.el dino-overlay.el dino-msg-gestion.el\
	 dino-dinorc2.el dino-dinorc-serveur.el dino-general.el dino-filtre.el

AUTOLOAD = dino-autoload.el

OTHERFILE = ChangeLog dino-compile.el Makefile README TODO VERSION $(AUTOLOAD) DOCS

OBJECT = $(AUTOLOAD) $(SOURCE:.el=.elc) 

EMACS = /usr/bin/emacs
FLAGS = -batch -q -no-site-file
VERSION = $(shell cat VERSION)

all: $(OBJECT)

world: clean
	$(EMACS) $(FLAGS) -l dino-compile.el --eval "(compile-all)"

install:
	if test ! \( $(PWD) -ef $(lispdir) \); \
	then mkdir -p $(lispdir); \
	     install -m 644 *.elc $(AUTOLOAD) $(lispdir); fi

$(AUTOLOAD): $(SOURCE)
	echo "" > $@
	echo "(provide 'dino-autoload)" >> $@
	$(EMACS) $(FLAGS) -l dino-compile.el --eval "(dino-make-autoload \"$@\")"


clean:
	rm -f *.elc *~ #*# 

TAGS: $(SOURCE) 
	etags $(SOURCE)

cvstags: $(AUTOLOAD) 
	cvs tag -c $(shell echo dino$(VERSION) | tr -- '$,.:;@' '------')

tar: $(AUTOLOAD)
	mkdir dino-$(VERSION);
	cp $(SOURCE) $(OTHERFILE) dino-$(VERSION);
	tar cvzf dino-$(VERSION).tar.gz dino-$(VERSION);
	rm -rf dino-$(VERSION)

.SUFFIXES:
.SUFFIXES: .el .elc

%.elc: %.el $(AUTOLOAD)
	rm -f $@;
	$(EMACS) $(FLAGS) -l dino-compile.el --eval "(byte-compile-file \"$<\")"

