go: hcm-icon.svg
	./install-package --deb-packages inkscape --rpm-packages inkscape --brew-packages inkscape
	inkscape hcm-icon.svg

linux-install: hcm-icon.svg
	../install-file --file hcm-icon.svg --directory /usr/local/lib/.
	mkdir -p ~/.local/share/applications
	# This doesn't work for Mate 1.18.0.
	# I'm hoping it will work for Cinnamon (tested, but it was coming up in an Other category)...
	# and perhaps Gnome and KDE will work (both untested).
	sed 's#^\(Exec=\).*$$#\1'"bash -c \"$$HOME/bin/hcm --gui\""'#' < hcm.desktop.in > hcm.desktop
	# The old way.
	# ../install-file --file hcm.desktop --directory ~/.local/share/applications/
	#
	# The new way.  I heard this works for Unity, and I'm hoping it'll work for others.
	# https://askubuntu.com/questions/375975/how-to-force-unity-reload-local-share-applications
	desktop-file-install --dir=${HOME}/.local/share/applications hcm.desktop

darwin-install: hcm-icon.svg
	../mactools/svg2icns hcm-icon.svg
	../install-file --file hcm-icon.svg --directory /usr/local/lib/.

hcm-icon.svg: hcm-icon.dot
	./install-package --deb-packages graphviz --rpm-packages graphviz --brew-packages graphviz
	dot -Tsvg hcm-icon.dot > hcm-icon.svg
	dot -Tpng hcm-icon.dot > hcm-icon.png

clean:
	rm -f hcm-icon.svg
	rm -f hcm-icon.png
	rm -f hcm.desktop
	rm -rf hcm-icon.ic*