root/XerialJ/trunk/sqlite-jdbc/script/Makefile

Revision 2252, 2.7 kB (checked in by leo, 4 years ago)

deleted the sqlitejdbc folder

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Date Rev LastChangedBy URL AUthor
Line 
1# Makefile for the native SQLite JDBC Driver
2#
3# No auto-goop. Just try typing 'make'. You should get two interesting files:
4#     build/TARGET_OS/LIBNAME
5#     build/sqlitejdbc-vXXX-native.jar
6#
7# To combine these, type:
8#         cd build
9#         mv LIBNAME linux-x86.lib (or win-x86.lib, freebsd-ppc.lib, mac.lib, etc)
10#     java uf sqlitejdbc-vXXX-native.jar linux-x86.lib
11#
12# The first is the native library, the second is the java support files.
13# Generating the more complete sqlitejdbc-vXXX.jar requires building the
14# NestedVM source, which requires running a Linux machine, and looking at
15# the other make files.
16#
17
18include Makefile.common
19
20default: test
21
22test: native $(test_classes)
23        $(JAVA) -Djava.library.path=build/$(target) \
24            -cp "build/$(sqlitejdbc)-native.jar$(sep)build$(sep)$(libjunit)" \
25            org.junit.runner.JUnitCore $(tests)
26
27native: build/$(sqlitejdbc)-native.jar build/$(target)/$(LIBNAME)
28
29native: build/$(sqlite)-$(target)/sqlite3.o $(native_classes)
30        @mkdir -p build/$(target)
31        $(JAVAH) -classpath build -jni -o build/NativeDB.h org.sqlite.NativeDB
32        cd build && jar cf $(sqlitejdbc)-native.jar $(java_classlist)
33        $(CC) $(CFLAGS) -c -o build/$(target)/NativeDB.o \
34                src/org/sqlite/NativeDB.c
35        $(CC) $(CFLAGS) $(LINKFLAGS) -o build/$(target)/$(LIBNAME) \
36                build/$(target)/NativeDB.o build/$(sqlite)-$(target)/*.o
37        $(STRIP) build/$(target)/$(LIBNAME)
38       
39build/$(sqlitejdbc)-native.jar: $(native_classes)
40        cd build && jar cf $(sqlitejdbc)-native.jar $(java_classlist)
41
42build/$(target)/$(LIBNAME): build/$(sqlite)-$(target)/sqlite3.o build/org/sqlite/NativeDB.class
43        @mkdir -p build/$(target)
44        $(JAVAH) -classpath build -jni -o build/NativeDB.h org.sqlite.NativeDB
45        $(CC) $(CFLAGS) -c -o build/$(target)/NativeDB.o \
46                src/org/sqlite/NativeDB.c
47        $(CC) $(CFLAGS) $(LINKFLAGS) -o build/$(target)/$(LIBNAME) \
48                build/$(target)/NativeDB.o build/$(sqlite)-$(target)/*.o
49        $(STRIP) build/$(target)/$(LIBNAME)
50
51build/$(sqlite)-%/sqlite3.o: dl/$(sqlite)-amal.zip
52        @mkdir -p build/$(sqlite)-$*
53        unzip -qo dl/$(sqlite)-amal.zip -d build/$(sqlite)-$*
54        perl -pi -e "s/sqlite3_api;/sqlite3_api = 0;/g" \
55            build/$(sqlite)-$*/sqlite3ext.h
56        (cd build/$(sqlite)-$*; $(CC) -o sqlite3.o -c $(CFLAGS) \
57            -DSQLITE_ENABLE_COLUMN_METADATA \
58            -DSQLITE_CORE \
59            -DSQLITE_ENABLE_FTS3 \
60            -DSQLITE_OMIT_LOAD_EXTENSION sqlite3.c)
61
62build/org/%.class: src/org/%.java
63        @mkdir -p build
64        $(JAVAC) -source 1.2 -target 1.2 -sourcepath src -d build $<
65
66build/test/%.class: src/test/%.java
67        @mkdir -p build
68        $(JAVAC) -target 1.5 -classpath "build$(sep)$(libjunit)" \
69            -sourcepath src/test -d build $<
70
71dl/$(sqlite)-amal.zip:
72        @mkdir -p dl
73        curl -odl/$(sqlite)-amal.zip \
74        http://www.sqlite.org/sqlite-amalgamation-$(subst .,_,$(sqlite_version)).zip
75
76clean:
77        rm -rf build dist
78
79
80
81
82
83
Note: See TracBrowser for help on using the browser.