Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
68 lines (56 sloc) 2.27 KB
# Makefile for the native SQLite JDBC Driver
# No auto-goop. Just try typing 'make'. You should get two interesting files:
# build/sqlitejdbc-vXXX-native.jar
# To combine these, type:
# cd build
# mv LIBNAME linux-x86.lib (or win-x86.lib, freebsd-ppc.lib, mac.lib, etc)
# java uf sqlitejdbc-vXXX-native.jar linux-x86.lib
# The first is the native library, the second is the java support files.
# Generating the more complete sqlitejdbc-vXXX.jar requires building the
# NestedVM source, which requires running a Linux machine, and looking at
# the other make files.
include Makefile.common
default: test
test: native $(test_classes)
$(JAVA) -Djava.library.path=build/$(target) \
-cp "build/$(sqlitejdbc)-native.jar$(sep)build$(sep)$(libjunit)" \
org.junit.runner.JUnitCore $(tests)
native: build/$(sqlitejdbc)-native.jar build/$(target)/$(LIBNAME)
build/$(sqlitejdbc)-native.jar: $(native_classes)
cd build && jar cf $(sqlitejdbc)-native.jar $(java_classlist)
build/$(target)/$(LIBNAME): build/$(sqlite)-$(target)/sqlite3.o build/org/sqlite/NativeDB.class
@mkdir -p build/$(target)
$(JAVAH) -classpath build -jni -o build/NativeDB.h org.sqlite.NativeDB
$(CC) $(CFLAGS) -c -o build/$(target)/NativeDB.o \
$(CC) $(CFLAGS) $(LINKFLAGS) -o build/$(target)/$(LIBNAME) \
build/$(target)/NativeDB.o build/$(sqlite)-$(target)/*.o
$(STRIP) build/$(target)/$(LIBNAME)
build/$(sqlite)-%/sqlite3.o: dl/$(sqlite)
unzip -qo dl/$(sqlite) -d build/
mv build/sqlite-amalgamation-$(sqlite_version) build/$(sqlite)-$*
perl -pi -e "s/sqlite3_api;/sqlite3_api = 0;/g" \
(cd build/$(sqlite)-$*; $(CC) -o sqlite3.o -c $(CFLAGS) \
build/org/%.class: src/org/
@mkdir -p build
$(JAVAC) -source 1.2 -target 1.2 -sourcepath src -d build $<
build/test/%.class: src/test/
@mkdir -p build
$(JAVAC) -target 1.5 -classpath "build$(sep)$(libjunit)" \
-sourcepath src/test -d build $<
@mkdir -p dl
curl -odl/$(sqlite) \$(subst .,_,$(sqlite_version)).zip
rm -rf build dist