# Makefile.in for sawfish's themes
# $Id: Makefile.in,v 1.20 2001/01/20 02:40:29 jsh Exp $
#
# Copyright (C) 1999 John Harper <john@dcs.warwick.ac.uk>
#
# This file is part of sawfish.
#
# sawfish is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# sawfish is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with sawfish; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

include ../Makedefs

top_builddir=..
top_srcdir=@top_srcdir@
srcdir=@srcdir@

themedir := ${sawfishdir}/themes

# also in lisp/Makefile.in
sawfish_prog = $(rep_LIBTOOL) --mode=execute -dlopen ../src/gradient.la \
		../src/sawfish --batch --no-rc
COMPILE_ENV = SAWFISHLISPDIR=../lisp \
	      SAWFISHEXECDIR=$(top_builddir)/src/.libs \
	      SAWFISHDOCFILE=../DOC \
	      SAWFISH_USER_LISP_DIR=

THEMES := StyleTab absolute-e Crux microGUI mxflat Elberg-tabbed Zami-like candido gradient-tabbed

all :
	for d in $(THEMES); do \
		( tar --help|grep -q sort= && rbopts=--sort=name ; \
	          tar --help|grep -q 'GNU tar' && rbopts="$$rbopts --format=gnu --mtime @1" ; \
		  cd $(srcdir) && LC_ALL=C tar $$rbopts -c $$d/* | gzip -n9 > $$d.tar.gz ) ; \
	done

install : all installdirs
	for d in $(THEMES); do \
	  rm -rf $(DESTDIR)$(themedir)/$$d; \
	  $(INSTALL_DATA) $$d.tar.gz $(DESTDIR)$(themedir)/$$d.tar.gz; \
	done
	@# Don't use tar for StyleTab. It's not compression, but tar
	@# itself slows in librep.
	cd $(DESTDIR)$(themedir) && tar xf StyleTab.tar.gz && rm StyleTab.tar.gz

installdirs : $(top_srcdir)/mkinstalldirs
	$(SHELL) $< $(DESTDIR)$(themedir)

uninstall :
	for d in $(THEMES); do \
	  rm -rf $(DESTDIR)$(themedir)/$$d.tar.gz; \
	done
	rm -rf $(DESTDIR)$(themedir)/StyleTab

clean :
	for d in $(THEMES); do \
	  rm -f $(srcdir)$$d/*.jlc $(srcdir)/$$d/*~; \
	done
	rm -f *.jlc *.jld *~ *.gz

distclean : clean
	rm -f Makefile

.PHONY : all lisp install uninstall clean
