# Generated automatically from Makefile.in by configure.
#
#	Makefile for a Java project with native methods.
#

SHELL = /bin/sh

srcdir = .
top_srcdir = ..
top_builddir = ..

prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${prefix}/info
mandir = ${prefix}/man
includedir = ${prefix}/include
oldincludedir = /usr/include
configdir = ${sysconfdir}/sane.d

V_MAJOR = 1
V_MINOR = 0
DLL_PRELOAD = $(PRELOADABLE_BACKENDS)

MKDIR = $(top_srcdir)/mkinstalldirs
INSTALL = /bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
RANLIB = ranlib

CC = gcc
#	We'll need something in 'configure' for the Java includes.
INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include \
	-I${JDK_HOME}/include -I${JDK_HOME}/include/genunix

CPPFLAGS =  -D_GNU_SOURCE -DPATH_SANE_CONFIG_DIR=$(configdir) 	  -DPATH_SANE_DATA_DIR=$(datadir) 	  -DV_MAJOR=1 -DV_MINOR=0
CFLAGS = -g -O2 -W -Wall -DSCSIBUFFERSIZE=131072
LDFLAGS = 
DEFS = -DHAVE_CONFIG_H

LIBTOOL = ../libtool
MCOMP	= --mode=compile
MLINK	= --mode=link
MINST	= --mode=install

COMPILE = $(CC) -c $(CFLAGS) $(DEFS) $(INCLUDES) $(CPPFLAGS)



LIBSANE = -L`pwd`/../backend/libs -lsane

# Classes to compile.
CLASSES = SaneDevice.class SaneOption.class SaneRange.class Sane.class \
	SaneParameters.class ScanIt.class ImageCanvas.class \
	ImageCanvasClient.class

.SUFFIXES: .c .o .h .la .lo .java .class

.java.class:
	javac $<

.class.h:
	javah -jni $*

%.lo:	%.c
	@$(LIBTOOL) $(MCOMP) $(COMPILE) $<

# Don't delete any intermediate files.
.PRECIOUS: %.h %.lo

all: libsanej.la $(CLASSES) Test.class Jscanimage.class

libsanej.la: Sane.lo
	@$(LIBTOOL) $(MLINK) $(CC) -o $@ $(LDFLAGS) $^ \
		-rpath $(libdir) -version-info \
		$(V_MAJOR):$(V_MINOR):0 $(LIBSANE)

clean:
	rm -f *.class *.lo *.o *~ *.la *.bak
	rm -f Sane.h
	rm -rf .libs

#	Install library.  Don't know where to install .class files yet.

install:
	$(MKDIR) $(libdir) $(configdir)
	$(LIBTOOL) $(MINST) $(INSTALL_PROGRAM) libsanej.la \
		$(libdir)/libsanej.la || exit 1;
	@$(LIBTOOL) $(MINST) --finish $(libdir)


Sane.c: Sane.h
