MENU_RES=../src/sch-rnd/menu-default.lht
ROOT=..

all: user/05_ui/keytree.svg user/05_ui/keytree.txt keys.html
	ROOT="" ./Autostyle.sh *.html
	ROOT="../" ./Autostyle.sh tutorial/index.html user/index.html
#	./datasheet.sh

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

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

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


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

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

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

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

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

clean:
	cd design && $(MAKE) clean
	cd developer && $(MAKE) clean
	cd examples && $(MAKE) clean
	cd man && $(MAKE) clean
	cd tutorial && $(MAKE) clean
	cd user && $(MAKE) clean

distclean:
	cd design && $(MAKE) distclean
	cd developer && $(MAKE) distclean
	cd examples && $(MAKE) distclean
	cd man && $(MAKE) distclean
	cd tutorial && $(MAKE) distclean
	cd user && $(MAKE) distclean
