TOP=.
include $(TOP)/Makeconf

ifeq ($(MPATH),$(OPATH))
  LOADPATH = $(MPATH)//:
else
  LOADPATH = $(MPATH)//:$(OPATH)//:
endif

all:
	@cd scripts && $(MAKE)

install:
	@cd scripts && $(MAKE) install
	@echo " "
	@echo "Installation complete."
	@echo " "
	@echo "To use, add the following to .octaverc:"
	@echo "   LOADPATH = [ '$(OPATH):$(MPATH)//:', LOADPATH ];"
	@echo "   EXEC_PATH = [ '$(XPATH):', EXEC_PATH ];"
	@echo " "
	@echo "To uninstall, remove the following:"
	@echo "   MPATH = $(MPATH)"
	@echo "   OPATH = $(OPATH)"
	@echo "   XPATH = $(XPATH)"
	@echo " "
	@echo "Some FIXES may be out of date.  Check the scripts in:"
	@echo "   $(MPATH)/FIXES"
	@echo "against those in your version of Octave."

index.html: makeweb.pl compat.dat licenses
	@./makeweb.pl

clean:
	-$(RM) octave-core index.html HTML/{summary,cat-*}.html
	@cd scripts && $(MAKE) clean

dist: clean
	tar czf ../matcompat-`date +%Y.%m.%d`.tar.gz -C .. matcompat

## Make the web distribution to upload to the net.  That means, clean
## out all the compiled files and HTML pages, build the tar ball, then
## rebuild the HTML pages ready for upload.
web: dist index.html
