MENU_RES=../src/menu.lht
# append this when plugins start to have menu files:  ../src_plugins/*/*-menu.lht

ROOT=..
LIBARCHDIR=$(LIBRND_LIBARCHDIR)

all: user/keys.html user/keytree.svg user/keytree.txt
	ROOT="" ./Autostyle.sh *.html

include ../Makefile.conf
include $(LIBRND_MAK)

SCCBOX = $(LIBRND_PREFIX)/$(LIBARCHDIR)/librnd4/scconfig/sccbox

user/keytree.svg: $(MENU_RES) $(KEYLIST)
	$(KEYLIST) --dot user/node_names.txt $(MENU_RES) > user/keytree.dot
	dot -Tsvg < user/keytree.dot >user/keytree.svg

user/keytree.txt: $(MENU_RES) $(KEYLIST)
	$(KEYLIST) --lst $(MENU_RES) > user/keytree.txt


user/keys.html: $(MENU_RES) $(KEYLIST)
	$(KEYLIST) $(MENU_RES) > user/keys.html

install_main:
	$(SCCBOX) $(HOW) *.html TODO $(DOCDIR)/

install:
	$(SCCBOX) mkdir -p "$(DOCDIR)"
	cd user && $(MAKE) install
	cd man && $(MAKE) install
	cd developer && $(MAKE) install
	cd resources && $(MAKE) install
	$(MAKE) install_main HOW="install -f -d"

linstall:
	cd user && $(MAKE) linstall
	cd man && $(MAKE) linstall
	cd developer && $(MAKE) linstall
	cd resources && $(MAKE) linstall
	$(MAKE) install_main HOW="install -f -l -d"

uninstall:
	cd user && $(MAKE) uninstall
	cd man && $(MAKE) uninstall
	cd developer && $(MAKE) uninstall
	cd resources && $(MAKE) uninstall
	$(MAKE) install_main HOW="install -f -u -d"

clean:
	cd user && $(MAKE) clean
	cd developer && $(MAKE) clean

distclean:
	cd user && $(MAKE) distclean
	cd developer && $(MAKE) distclean
