SUBDIRS := cluster sphere trapping
SRCDIR=$(PWD)
OBJDIR=$(SRCDIR)/objects
BUILDDIR=$(SRCDIR)/../build
DOCSDIR=$(SRCDIR)/../doc

all: $(SUBDIRS)

docs:
	cd $(DOCSDIR)/src; doxygen config.dox

$(SUBDIRS):
	$(MAKE) -C $@

clean:
	rm -f $(OBJDIR)/*.o

wipe:
	rm -f $(BUILDDIR)/cluster/*
	rm -f $(BUILDDIR)/sphere/*
	rm -f $(BUILDDIR)/trapping/*
	rm -f $(OBJDIR)/*.o
	if [ -d $(DOCSDIR)/build/html ]; then rm -r $(DOCSDIR)/build/html; fi
	if [ -d $(DOCSDIR)/build/latex ]; then rm -r $(DOCSDIR)/build/latex; fi

.PHONY: all $(SUBDIRS)
