# Makefile for the JNI test # $Author: cwj $ # $Revision: 1.1 $ # $Date: 2007/05/21 00:35:15 $ JNIINCLUDES=-I/usr/local/java/include -I/usr/local/java/include/linux default: runarraytest .PRECIOUS: %.class %.so out.txt: ArrayTester.class libintegerarray.so env LD_LIBRARY_PATH=. java ArrayTester 2>&1 | tee $@ runarraytest: ArrayTester.class libintegerarray.so env LD_LIBRARY_PATH=. java ArrayTester runtimertest: ArrayTester.class libintegerarray.so libtimer.so env LD_LIBRARY_PATH=. java ArrayTester timerout.txt: libtimer.so ArrayTester.class libintegerarray.so env LD_LIBRARY_PATH=. java ArrayTester 2>&1 | tee $@ 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 *~