diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..01934f1 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +CC = gcc + +BUILD_DIR = build +OBJECTS_DIR = $(BUILD_DIR)/objects +JNI_HEADERS_DIR = $(BUILD_DIR)/jni-headers +JNI_SOURCES_DIR = src/jni +INCLUDE = -I $(JAVA_HOME)/include -I $(JAVA_HOME)/include/linux + +LIBS = -llz4 -lxxhash +JNI_PREFIX = net_jpountz_ + +default: all move_objects generate_so + +all: + $(CC) -fPIC -I $(JNI_HEADERS_DIR) \ + $(INCLUDE) \ + $(LIBS) \ + -c $(JNI_SOURCES_DIR)/$(JNI_PREFIX)lz4_LZ4JNI.c + + $(CC) -fPIC -I $(JNI_HEADERS_DIR) \ + $(INCLUDE) \ + $(LIBS) \ + -c $(JNI_SOURCES_DIR)/$(JNI_PREFIX)xxhash_XXHashJNI.c + +move_objects: + mv *.o $(OBJECTS_DIR) + +generate_so: + gcc -fPIC -shared \ + $(OBJECTS_DIR)/*.o \ + $(LIB_DIR)/liblz4.so \ + $(LIB_DIR)/libxxhash.so \ + -o $(BUILD_DIR)/jni/net/jpountz/util/$(PLATFORM)/$(ARCH)/liblz4-java.so diff --git a/build.xml b/build.xml index 1d4cff5..13d8ce3 100644 --- a/build.xml +++ b/build.xml @@ -13,7 +13,6 @@ --> @@ -78,13 +77,6 @@ - - - - - - @@ -184,27 +176,13 @@ - + - - - - - - - - - - - - - + + + +