PACKAGE = tree-widget
VERSION = 2.00

prefix = $(DESTDIR)/usr
datadir = ${prefix}/share
lispdir = ${datadir}/emacs/site-lisp

DOC =
EL = tree-widget.el dir-tree.el tree-widget-examples.el
ELC = $(patsubst %.el, %.elc, $(EL))
LPATH = lpath.el

MKDIR = mkdir
TAR   = tar
CP    = cp -p
RM    = rm -f
EMACS = emacs
ELCC  = $(EMACS) -batch -q -no-site-file -l $(LPATH)

.PHONY : all compile-elc
all: compile-elc

compile-elc: $(ELC)

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

install:
	if [ ! -d $(lispdir) ]; then \
	  $(MKDIR) -p $(lispdir); \
	fi
	$(CP) $(EL) $(ELC) $(lispdir)
	$(CP) -a -x tree-widget-themes $(lispdir)/

## Clean
#
clean:
	$(RM) *.elc *~
distclean: distclean
	$(RM) -r $(DISTDIR)
	$(RM) $(DISTDIR).tar.gz

