# Makefile for the JNI test # $Author: richard $ # $Revision: 1.3 $ # $Date: 2005/05/22 06:29:50 $ JNIINCLUDES=-I/usr/local/java/include -I/usr/local/java/include/linux default: run .PRECIOUS: %.class %.so out.txt: ArrayTester.class libintegerarray.so libtimer.so env LD_LIBRARY_PATH=. java ArrayTester 2>&1 | tee $@ run: ArrayTester.class libintegerarray.so libtimer.so env LD_LIBRARY_PATH=. java ArrayTester libintegerarray.so: integer_array.c IntegerArray.h gcc -Wall -shared $(JNIINCLUDES) $< -o $@ libtimer.so: timer.c Timer.h gcc -Wall -shared $(JNIINCLUDES) $< -o $@ ArrayTester.class: IntegerArray.class %.class: %.java javac $< # We need the touch here because javah doesn't set the timestamp # on the generated .h file if it hasn't changed. This is just # one of those tricky things that requires care in Makefiles. %.h: %.class javah -jni $* touch $@ clean: rm -f *.h *.class *.so out.txt *~