1 include Makefile.common
3 nestedvm_version := 2007-06-30
4 nestedvm := nestedvm-$(nestedvm_version)
8 test: dist/$(sqlitejdbc)-pure.jar $(test_classes)
9 $(JAVA) -cp "dist/$(sqlitejdbc)-pure.jar$(sep)build$(sep)$(libjunit)" \
10 org.junit.runner.JUnitCore $(tests)
12 dist/$(sqlitejdbc)-pure.jar: build/org/sqlite/SQLite.class $(java_classes)
14 cd build && jar cf ../$@ \
15 org/sqlite/SQLite.class $(java_classlist) \
16 -C ../$(nestedvm)/build org/ibex
18 build/org/sqlite/%.class: ../src/main/java/org/sqlite/%.java
20 $(JAVAC) -source 1.2 -target 1.2 -classpath "$(nestedvm)/build" \
21 -sourcepath ../src/main/java -d build $<
23 build/test/org/sqlite/%.class: ../src/test/java/org/sqlite/%.java
25 $(JAVAC) -target 1.5 -classpath "build$(sep)$(libjunit)" \
26 -sourcepath ../src/test/java -d build/test $<
29 $(MAKE) -C $(nestedvm) $*
33 cp ../archive/$(nestedvm).tgz $@
34 # curl -odl/$(nestedvm).tgz http://files.zentus.com/sqlitejdbc/$(nestedvm).tgz
36 dl/$(sqlite)-amal.zip:
38 curl -odl/$(sqlite)-amal.zip \
39 http://www.sqlite.org/sqlite-amalgamation-$(subst .,_,$(sqlite_version)).zip
41 $(nestedvm)/Makefile: dl/$(nestedvm).tgz
42 tar xfz dl/$(nestedvm).tgz
45 build/SQLite.mips: $(nestedvm)/Makefile $(nestedvm)/env.sh dl/$(sqlite)-amal.zip
47 @mkdir -p build/$(sqlite)-nestedvm
48 unzip -qo dl/$(sqlite)-amal.zip -d build/$(sqlite)-nestedvm
49 cp ../src/main/java/org/sqlite/Nested*.c build/$(sqlite)-nestedvm
50 perl -pi -e "s/sqlite3_api;/sqlite3_api = 0;/g" \
51 build/$(sqlite)-nestedvm/sqlite3ext.h
53 # we need a dummy main
54 echo 'int main() { return 0; }' >> build/$(sqlite)-nestedvm/sqlite3.c
56 perl -npe '$$_ =~ s/utimes.*//g;' -i build/$(sqlite)-nestedvm/sqlite3.c
58 (. ./$(nestedvm)/env.sh; cd build/$(sqlite)-nestedvm; \
59 $$CC -c $$CFLAGS -Ilib/inc_mac -o sqlite3.o \
60 -DSQLITE_THREADSAFE=0 \
61 -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT \
62 -DSQLITE_ENABLE_COLUMN_METADATA \
64 -DSQLITE_ENABLE_FTS3 \
65 -DSQLITE_ENABLE_RTREE \
67 $$CC -c $$CFLAGS -o NestedDB.o Nested*.c)
69 ./$(nestedvm)/upstream/install/bin/mips-unknown-elf-gcc \
70 -march=mips1 --static -lc\
71 -o $@ build/$(sqlite)-nestedvm/sqlite3.o \
72 build/$(sqlite)-nestedvm/NestedDB.o
74 build/org/sqlite/SQLite.class: build/SQLite.mips
75 java -cp $(nestedvm)/build$(sep)$(nestedvm)/upstream/build/classgen/build \
76 org.ibex.nestedvm.Compiler \
77 -outformat class -d build -o unixRuntime \
78 org.sqlite.SQLite build/SQLite.mips