Permalink
Browse files

init lru jni

  • Loading branch information...
1 parent febdce2 commit 55295e20b587a81b795a05bed3ec73092f9015d9 @believe3301 committed Sep 10, 2012
Showing with 15 additions and 2 deletions.
  1. +15 −2 Makefile
  2. 0 binding/lru_jni.c
  3. 0 binding/lru_jni.h
View
@@ -7,6 +7,9 @@ LIB_OBJS = \
./hash.o\
./lru.o
+LIB_JNI_OBJS = \
+ ./binding/lru_jni.o
+
TESTAPP_OBJS = \
./test/test.o
@@ -15,6 +18,8 @@ BENCH_OBJS = \
LIBRARY = liblru.so
+LIBRARY_JNI = liblrujni.so
+
TESTAPP = testapp
BENCH = bench
@@ -39,10 +44,18 @@ $(BENCH): $(LIB_OBJS) $(BENCH_OBJS)
$(BENCH_OBJS): %.o: %.c
$(CC) $(CFLAGS) -I. $^ -c -o $@
+jni: $(LIBRARY_JNI)
+
+$(LIBRARY_JNI): $(LIB_OBJS) $(LIB_JNI_OBJS)
+ $(CC) -fPIC -shared $^ -o $@
+
+$(LIB_JNI_OBJS): %.o: %.c
+ $(CC) -fPIC $(CFLAGS) -I. $^ -c -o $@
+
test: $(TESTAPP) $(BENCH)
./$(TESTAPP)
./$(BENCH)
clean:
- -rm -f $(LIB_OBJS) $(TESTAPP_OBJS) $(BENCH_OBJS)
- -rm -f $(LIBRARY) $(TESTAPP) $(BENCH)
+ -rm -f $(LIB_OBJS) $(TESTAPP_OBJS) $(BENCH_OBJS) $(LIB_JNI_OBJS)
+ -rm -f $(LIBRARY) $(LIBRARY_JNI) $(TESTAPP) $(BENCH)
View
No changes.
View
No changes.

0 comments on commit 55295e2

Please sign in to comment.