# 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=2.8.2
apiversion=2.8

top_srcdir=.
srcdir=.

# Directories for configure.  Will remove the redundant ones when we know where
# to install the files.
prefix=/usr/local
exec_prefix=${prefix}
datadir=${prefix}/share
bindir=${exec_prefix}/bin
includedir=${prefix}/include
infodir=${prefix}/info
libdir=${exec_prefix}/lib
libexecdir=${exec_prefix}/libexec
localstatedir=${prefix}/var
mandir=${prefix}/man
sharedstatedir=${prefix}/com

INSTALL=/bin/install -c

# Set Java related stuff
JAVADOC = javadoc
JAVAC = /opt/sun-jdk-1.4.2.06/bin/javac
JAVA = @JAVA@
JAR = /opt/sun-jdk-1.4.2.06/bin/jar

DOCBOOK = /home/jeff/bin/db2html


all: distro 

distro:
	$(MAKE) -C src all

# Install targets
install: native_install
	$(INSTALL) -s -m644 lib/libgladejava$(apiversion).so.$(version) $(DESTDIR)$(libdir)/
	ln -s -f libgladejava$(apiversion).so.$(version) $(DESTDIR)$(libdir)/libgladejava$(apiversion).so
	$(INSTALL) -m644 lib/glade$(apiversion)-$(version).jar $(DESTDIR)$(datadir)/java
	ln -s -f glade$(apiversion)-$(version).jar $(DESTDIR)$(datadir)/java/glade$(apiversion).jar
	-for f in $(DOCUMENTS); do $(INSTALL) -m644 $(JG_DOC_DIR)/$$f $(DESTDIR)$(datadir)/doc/libglade$(apiversion)-java || exit 1 ; done
	$(INSTALL) -m644 glade-java.pc $(DESTDIR)$(libdir)/pkgconfig/

native_install:
	$(INSTALL) -s -m644 lib/libgladejar$(apiversion).so.$(version) $(DESTDIR)$(libdir)/
	@ln -s -f libgladejar$(apiversion).so.$(version) $(DESTDIR)$(libdir)/libgladejar$(apiversion).so

# Uninstall targets
uninstall: native_uninstall
	rm -f $(libdir)/libgladejava$(apiversion).so.$(version)
	rm -f $(libdir)/libgladejava$(apiversion).so
	rm -f $(datadir)/java-gnome/glade$(apiversion)-$(version).jar
	rm -f $(datadir)/java-gnome/glade$(apiversion).jar
	rm -rf $(datadir)/java-gnome
	rm -rf $(datadir)/doc/java-gnome-$(apiversion)

native_uninstall:
	rm -f $(libdir)/libgladejar$(apiversion).so.$(version)
	rm -f $(libdir)/libgladejar$(apiversion).so

