리눅스 & 안드로이드2011. 1. 17. 23:57
CC=g++
JAVA_HOME=/usr/lib/jvm/java-6-openjdk
CFLAGS=-c -I$(JAVA_HOME)/include
LFLAGS=-shared
JAVA_FILES=JniFuncMain.java JniTest.java

all: java lib

java:
@echo
@echo Compiling Java codes: ${JAVA_FILES}
@javac ${JAVA_FILES}
@echo
@echo Generating header file for JNI
@javah JniTest

lib:
@echo
@echo Compiling the native codes
@$(CC) ${CFLAGS} jnifunc.cpp
@echo
@echo Building shared library: libjnifunc.so
@$(CC) ${LFLAGS} -o libjnifunc.so jnifunc.o

clean:
@rm -f *.o
@rm -f *.so
@rm -f *.class

Posted by 세월의돌