## Makefile (Java Native Interface for GLPK)
##
## Top level Makefile. All makes should be done from here since this 
## takes care of the dependencies between the c and the java code
## (as well as the sample code).
##
## ---------------------------------------------------------------------
## Copyright (C) 2003 Andrew Makhorin <mao@mai2.rcnet.ru>, Department
## for Applied Informatics, Moscow Aviation Institute, Moscow, Russia.
## All rights reserved.
##
## Author: Yuri Victorovich, Software Engineer, yuri@gjt.org.
## Author: Chris Rosebrugh, cpr@pobox.com
##         - added user-installable print and fault hooks.
##           See java/GlpkHookIFC.java
##        
## This file is a part of GLPK (GNU Linear Programming Kit).
##  
## GLPK 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.
##  
## GLPK 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 GLPK; see the file COPYING. If not, write to the Free
## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
## 02111-1307, USA.
## --------------------------------------------------------------------


all: glpk.jar libglpk_jni.so

glpk.jar:
	(cd java; make)

libglpk_jni.so: glpk.jar
	(cd c; make)

install: all
	cp c/libglpk_jni.so $(JAVA_HOME)/jre/lib/i386/
	cp java/glpk.jar $(JAVA_HOME)/jre/lib/ext/

uninstall:
	rm $(JAVA_HOME)/jre/lib/i386/libglpk_jni.so
	rm $(JAVA_HOME)/jre/lib/ext/glpk.jar

sample: all
	(cd sample; make test) 

clean:
	(cd c; make clean)
	(cd java; make clean)
	(cd sample; make clean)
