PACKAGE = @PACKAGE_TARNAME@
VERSION = @PACKAGE_VERSION@
prefix = @prefix@
datarootdir = @datarootdir@
datadir = @datadir@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

distdir = $(PACKAGE)-$(VERSION)
FILES = README Makefile.in configure.ac configure install-sh index.theme ChangeLog COPYING

ICON_SIZES = 16x16 22x22 24x24 32x32 36x36 48x48 64x64 72x72 96x96 \
  128x128 192x192 scalable
ICON_CONTEXTS = actions animations apps categories devices emblems emotes filesystems intl mimetypes places status stock
STOCK_SUBS = chart code data form image io media navigation net object table text

all:
	@:

install:
	mkdir -p $(DESTDIR)$(datadir)/icons/hicolor
	$(INSTALL_DATA) index.theme $(DESTDIR)$(datadir)/icons/hicolor
	for dir in $(ICON_SIZES); do \
	  for ctxt in $(ICON_CONTEXTS); do \
	    mkdir -p $(DESTDIR)$(datadir)/icons/hicolor/$$dir/$$ctxt; \
	    if [ "$$ctxt" = "stock" ]; then \
	      for sub in $(STOCK_SUBS); do \
	        mkdir -p $(DESTDIR)$(datadir)/icons/hicolor/$$dir/$$ctxt/$$sub; \
	      done \
	    fi \
	  done \
	done

dist:
	rm -rf $(distdir)
	mkdir $(distdir)
	cp $(FILES) $(distdir)
	tar czvf $(distdir).tar.gz $(distdir)
	rm -rf $(distdir)

tag:
	cvs tag DEFAULT_ICON_THEME_`echo $(VERSION)|sed "s/\./_/"`

# cause rebuilds
Makefile: Makefile.in config.status
	./config.status Makefile
configure: configure.ac
	autoconf
config.status: configure
	./config.status --recheck

.PHONY: all install dist tag

