ifeq ($(filter else-if,$(.FEATURES)),)
$(error GNU Make 3.81 or latter needed. Please, update your software.)
	exit 1
endif

.PHONY: all install clean distclean dist ctan

PKGNAME=latex-make

all:
	$(MAKE) -C src doc

install: all
	$(MAKE) -C src $@

clean distclean:
	-$(MAKE) -C examples $@
	-$(MAKE) -C MacOSX $@
	-$(MAKE) -C ctan $@
	$(MAKE) -C src $@

VERSION=$(shell cat VERSION)

dist:
	if [ "$$(svn st)" != "" ] ;then svn st ; exit 1 ; fi
	svn export . $(PKGNAME)-$(VERSION)
	tar cvzf $(PKGNAME)-$(VERSION).tar.gz $(PKGNAME)-$(VERSION)
	rm -rf $(PKGNAME)-$(VERSION)
	$(MAKE) ctan

ctan:
	$(MAKE) -C ctan
