# This file is part of Java-GNOME.
#
# Java-GNOME 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.
#
# Java-GNOME 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 Java-GNOME; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#


version=@version@
apiversion=@apiversion@
vteversion=@version@
vteapiversion=@apiversion@

top_srcdir=@top_srcdir@
srcdir=@srcdir@

# Directories for configure.  Will remove the redundant ones when we know where
# to install the files.
prefix=@prefix@
exec_prefix=@exec_prefix@
datadir=@datadir@
bindir=@bindir@
includedir=@includedir@
infodir=@infodir@
libdir=@libdir@
libexecdir=@libexecdir@
localstatedir=@localstatedir@
mandir=@mandir@
sharedstatedir=@sharedstatedir@

INSTALL=@INSTALL@

# Set Java related stuff
JAVADOC = @JAVADOC@
JAVAC = @JAVAC@
JAVA = @JAVA@
JAR = @JAR@

DOCBOOK = @DOCBOOK@



all: distro 

distro:
	$(MAKE) -C src all

# Install targets
install: @GCJ_INSTALL_TARGETS@
	$(INSTALL) -s -m644 lib/libgnomevtejava$(vteapiversion).so.$(vteversion) $(DESTDIR)$(libdir)/
	ln -s -f libgnomevtejava$(vteapiversion).so.$(vteversion) $(DESTDIR)$(libdir)/libgnomevtejava$(vteapiversion).so
	$(INSTALL) -m644 lib/gnomevte$(vteapiversion)-$(vteversion).jar $(DESTDIR)$(datadir)/java
	ln -s -f gnomevte$(vteapiversion)-$(vteversion).jar $(DESTDIR)$(datadir)/java/gnomevte$(vteapiversion).jar
	-for f in $(DOCUMENTS); do $(INSTALL) -m644 $(JG_DOC_DIR)/$$f $(DESTDIR)$(datadir)/doc/java-gnome-$(apiversion) || exit 1; done
	$(INSTALL) -m644 vte-java.pc $(DESTDIR)$(libdir)/pkgconfig/


native_install:
	$(INSTALL) -s -m644 lib/libgnomevtejar$(vteapiversion).so.$(vteversion) $(DESTDIR)$(libdir)/
	@ln -s -f libgnomevtejar$(vteapiversion).so.$(vteversion) $(DESTDIR)$(libdir)/libgnomevtejar$(vteapiversion).so

# Uninstall targets
uninstall: @GCJ_UNINSTALL_TARGETS@
	rm -f $(libdir)/libgnomevtejava$(vteapiversion).so.$(vteversion)
	rm -f $(libdir)/libgnomevtejava$(vteapiversion).so
	rm -f $(datadir)/java/gnomevte$(vteapiversion)-$(vteversion).jar
	rm -f $(datadir)/java/gnomevte$(vteapiversion).jar
	rm -rf $(datadir)/doc/java-gnome-$(apiversion)

native_uninstall:
	rm -f $(libdir)/libgnomevtejar$(vteapiversion).so.$(vteversion)
	rm -f $(libdir)/libgnomevtejar$(vteapiversion).so



