GNUmakefile 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. # Quick-and-dirty makefile to bootstrap the sqlite3-jni project. This
  2. # build assumes a Linux-like system.
  3. default: all
  4. JAVA_HOME ?= $(HOME)/jdk/current
  5. # e.g. /usr/lib/jvm/default-javajava-19-openjdk-amd64
  6. JDK_HOME ?= $(JAVA_HOME)
  7. # ^^^ JDK_HOME is not as widely used as JAVA_HOME
  8. bin.jar := $(JDK_HOME)/bin/jar
  9. bin.java := $(JDK_HOME)/bin/java
  10. bin.javac := $(JDK_HOME)/bin/javac
  11. bin.javadoc := $(JDK_HOME)/bin/javadoc
  12. ifeq (,$(wildcard $(JDK_HOME)))
  13. $(error set JDK_HOME to the top-most dir of your JDK installation.)
  14. endif
  15. MAKEFILE := $(lastword $(MAKEFILE_LIST))
  16. $(MAKEFILE):
  17. package.jar := sqlite3-jni.jar
  18. dir.top := ../..
  19. dir.tool := ../../tool
  20. dir.jni := $(patsubst %/,%,$(dir $(MAKEFILE)))
  21. dir.src := $(dir.jni)/src
  22. dir.src.c := $(dir.src)/c
  23. dir.bld := $(dir.jni)/bld
  24. dir.bld.c := $(dir.bld)
  25. dir.src.jni := $(dir.src)/org/sqlite/jni
  26. dir.src.capi := $(dir.src.jni)/capi
  27. dir.src.fts5 := $(dir.src.jni)/fts5
  28. dir.tests := $(dir.src)/tests
  29. mkdir ?= mkdir -p
  30. $(dir.bld.c):
  31. $(mkdir) $@
  32. javac.flags ?= -Xlint:unchecked -Xlint:deprecation
  33. java.flags ?=
  34. javac.flags += -encoding utf8
  35. # -------------^^^^^^^^^^^^^^ required for Windows builds
  36. jnicheck ?= 1
  37. ifeq (1,$(jnicheck))
  38. java.flags += -Xcheck:jni
  39. endif
  40. classpath := $(dir.src)
  41. CLEAN_FILES := $(package.jar)
  42. DISTCLEAN_FILES := $(dir.jni)/*~ $(dir.src.c)/*~ $(dir.src.jni)/*~
  43. sqlite3-jni.h := $(dir.src.c)/sqlite3-jni.h
  44. .NOTPARALLEL: $(sqlite3-jni.h)
  45. CApi.java := $(dir.src.capi)/CApi.java
  46. SQLTester.java := $(dir.src.capi)/SQLTester.java
  47. CApi.class := $(CApi.java:.java=.class)
  48. SQLTester.class := $(SQLTester.java:.java=.class)
  49. ########################################################################
  50. # The future of FTS5 customization in this API is as yet unclear.
  51. # The pieces are all in place, and are all thin proxies so not much
  52. # complexity, but some semantic changes were required in porting
  53. # which are largely untested.
  54. #
  55. # Reminder: this flag influences the contents of $(sqlite3-jni.h),
  56. # which is checked in. Please do not check in changes to that file in
  57. # which the fts5 APIs have been stripped unless that feature is
  58. # intended to be stripped for good.
  59. enable.fts5 ?= 1
  60. ifeq (,$(wildcard $(dir.tests)/*))
  61. enable.tester := 0
  62. else
  63. enable.tester := 1
  64. endif
  65. # bin.version-info = binary to output various sqlite3 version info
  66. # building the distribution zip file.
  67. bin.version-info := $(dir.top)/version-info
  68. .NOTPARALLEL: $(bin.version-info)
  69. $(bin.version-info): $(dir.tool)/version-info.c $(sqlite3.h) $(dir.top)/Makefile
  70. $(MAKE) -C $(dir.top) version-info
  71. # Be explicit about which Java files to compile so that we can work on
  72. # in-progress files without requiring them to be in a compilable statae.
  73. JAVA_FILES.main := $(patsubst %,$(dir.src.jni)/annotation/%,\
  74. Experimental.java \
  75. NotNull.java \
  76. Nullable.java \
  77. ) $(patsubst %,$(dir.src.capi)/%,\
  78. AbstractCollationCallback.java \
  79. AggregateFunction.java \
  80. AuthorizerCallback.java \
  81. AutoExtensionCallback.java \
  82. BusyHandlerCallback.java \
  83. CollationCallback.java \
  84. CollationNeededCallback.java \
  85. CommitHookCallback.java \
  86. ConfigLogCallback.java \
  87. ConfigSqlLogCallback.java \
  88. NativePointerHolder.java \
  89. OutputPointer.java \
  90. PrepareMultiCallback.java \
  91. PreupdateHookCallback.java \
  92. ProgressHandlerCallback.java \
  93. ResultCode.java \
  94. RollbackHookCallback.java \
  95. ScalarFunction.java \
  96. SQLFunction.java \
  97. CallbackProxy.java \
  98. CApi.java \
  99. TableColumnMetadata.java \
  100. TraceV2Callback.java \
  101. UpdateHookCallback.java \
  102. ValueHolder.java \
  103. WindowFunction.java \
  104. XDestroyCallback.java \
  105. sqlite3.java \
  106. sqlite3_blob.java \
  107. sqlite3_context.java \
  108. sqlite3_stmt.java \
  109. sqlite3_value.java \
  110. ) $(patsubst %,$(dir.src.jni)/wrapper1/%,\
  111. AggregateFunction.java \
  112. ScalarFunction.java \
  113. SqlFunction.java \
  114. Sqlite.java \
  115. SqliteException.java \
  116. ValueHolder.java \
  117. WindowFunction.java \
  118. )
  119. JAVA_FILES.unittest := $(patsubst %,$(dir.src.jni)/%,\
  120. capi/Tester1.java \
  121. wrapper1/Tester2.java \
  122. )
  123. ifeq (1,$(enable.fts5))
  124. JAVA_FILES.unittest += $(patsubst %,$(dir.src.fts5)/%,\
  125. TesterFts5.java \
  126. )
  127. JAVA_FILES.main += $(patsubst %,$(dir.src.fts5)/%,\
  128. fts5_api.java \
  129. fts5_extension_function.java \
  130. fts5_tokenizer.java \
  131. Fts5.java \
  132. Fts5Context.java \
  133. Fts5ExtensionApi.java \
  134. Fts5PhraseIter.java \
  135. Fts5Tokenizer.java \
  136. XTokenizeCallback.java \
  137. )
  138. endif
  139. JAVA_FILES.tester := $(SQLTester.java)
  140. JAVA_FILES.package.info := \
  141. $(dir.src.jni)/package-info.java \
  142. $(dir.src.jni)/annotation/package-info.java
  143. CLASS_FILES.main := $(JAVA_FILES.main:.java=.class)
  144. CLASS_FILES.unittest := $(JAVA_FILES.unittest:.java=.class)
  145. CLASS_FILES.tester := $(JAVA_FILES.tester:.java=.class)
  146. JAVA_FILES += $(JAVA_FILES.main) $(JAVA_FILES.unittest)
  147. ifeq (1,$(enable.tester))
  148. JAVA_FILES += $(JAVA_FILES.tester)
  149. endif
  150. CLASS_FILES :=
  151. define CLASSFILE_DEPS
  152. all: $(1).class
  153. $(1).class: $(1).java
  154. CLASS_FILES += $(1).class
  155. endef
  156. $(foreach B,$(basename \
  157. $(JAVA_FILES.main) $(JAVA_FILES.unittest) $(JAVA_FILES.tester)),\
  158. $(eval $(call CLASSFILE_DEPS,$(B))))
  159. $(CLASS_FILES): $(MAKEFILE)
  160. $(bin.javac) $(javac.flags) -h $(dir.bld.c) -cp $(classpath) $(JAVA_FILES)
  161. #.PHONY: classfiles
  162. ########################################################################
  163. # Set up sqlite3.c and sqlite3.h...
  164. #
  165. # To build with SEE (https://sqlite.org/see), either put sqlite3-see.c
  166. # in the top of this build tree or pass
  167. # sqlite3.c=PATH_TO_sqlite3-see.c to the build. Note that only
  168. # encryption modules with no 3rd-party dependencies will currently
  169. # work here: AES256-OFB, AES128-OFB, and AES128-CCM. Not
  170. # coincidentally, those 3 modules are included in the sqlite3-see.c
  171. # bundle.
  172. #
  173. # A custom sqlite3.c must not have any spaces in its name.
  174. # $(sqlite3.canonical.c) must point to the sqlite3.c in
  175. # the sqlite3 canonical source tree, as that source file
  176. # is required for certain utility and test code.
  177. sqlite3.canonical.c := $(firstword $(wildcard $(dir.src.c)/sqlite3.c) $(dir.top)/sqlite3.c)
  178. sqlite3.canonical.h := $(firstword $(wildcard $(dir.src.c)/sqlite3.h) $(dir.top)/sqlite3.h)
  179. sqlite3.c := $(sqlite3.canonical.c)
  180. sqlite3.h := $(sqlite3.canonical.h)
  181. #ifeq (,$(shell grep sqlite3_activate_see $(sqlite3.c) 2>/dev/null))
  182. # SQLITE_C_IS_SEE := 0
  183. #else
  184. # SQLITE_C_IS_SEE := 1
  185. # $(info This is an SEE build.)
  186. #endif
  187. .NOTPARALLEL: $(sqlite3.h)
  188. $(sqlite3.h):
  189. $(MAKE) -C $(dir.top) sqlite3.c
  190. $(sqlite3.c): $(sqlite3.h)
  191. opt.threadsafe ?= 1
  192. opt.fatal-oom ?= 1
  193. opt.debug ?= 1
  194. opt.metrics ?= 1
  195. SQLITE_OPT = \
  196. -DSQLITE_THREADSAFE=$(opt.threadsafe) \
  197. -DSQLITE_TEMP_STORE=2 \
  198. -DSQLITE_USE_URI=1 \
  199. -DSQLITE_OMIT_LOAD_EXTENSION \
  200. -DSQLITE_OMIT_DEPRECATED \
  201. -DSQLITE_OMIT_SHARED_CACHE \
  202. -DSQLITE_C=$(sqlite3.c) \
  203. -DSQLITE_JNI_FATAL_OOM=$(opt.fatal-oom) \
  204. -DSQLITE_JNI_ENABLE_METRICS=$(opt.metrics)
  205. opt.extras ?= 1
  206. ifeq (1,$(opt.extras))
  207. SQLITE_OPT += -DSQLITE_ENABLE_RTREE \
  208. -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
  209. -DSQLITE_ENABLE_STMTVTAB \
  210. -DSQLITE_ENABLE_DBPAGE_VTAB \
  211. -DSQLITE_ENABLE_DBSTAT_VTAB \
  212. -DSQLITE_ENABLE_BYTECODE_VTAB \
  213. -DSQLITE_ENABLE_OFFSET_SQL_FUNC \
  214. -DSQLITE_ENABLE_PREUPDATE_HOOK \
  215. -DSQLITE_ENABLE_NORMALIZE \
  216. -DSQLITE_ENABLE_SQLLOG \
  217. -DSQLITE_ENABLE_COLUMN_METADATA
  218. endif
  219. ifeq (1,$(opt.debug))
  220. SQLITE_OPT += -DSQLITE_DEBUG -g -DDEBUG -UNDEBUG
  221. else
  222. SQLITE_OPT += -Os
  223. endif
  224. ifeq (1,$(enable.fts5))
  225. SQLITE_OPT += -DSQLITE_ENABLE_FTS5
  226. endif
  227. sqlite3-jni.c := $(dir.src.c)/sqlite3-jni.c
  228. sqlite3-jni.o := $(dir.bld.c)/sqlite3-jni.o
  229. sqlite3-jni.h := $(dir.src.c)/sqlite3-jni.h
  230. package.dll := $(dir.bld.c)/libsqlite3-jni.so
  231. # All javac-generated .h files must be listed in $(sqlite3-jni.h.in):
  232. sqlite3-jni.h.in :=
  233. # $(java.with.jni) lists all Java files which contain JNI decls:
  234. java.with.jni :=
  235. define ADD_JNI_H
  236. sqlite3-jni.h.in += $$(dir.bld.c)/org_sqlite_jni$(3)_$(2).h
  237. java.with.jni += $(1)/$(2).java
  238. $$(dir.bld.c)/org_sqlite_jni$(3)_$(2).h: $(1)/$(2).java
  239. endef
  240. # Invoke ADD_JNI_H once for each Java file which includes JNI
  241. # declarations:
  242. $(eval $(call ADD_JNI_H,$(dir.src.capi),CApi,_capi))
  243. $(eval $(call ADD_JNI_H,$(dir.src.capi),SQLTester,_capi))
  244. ifeq (1,$(enable.fts5))
  245. $(eval $(call ADD_JNI_H,$(dir.src.fts5),Fts5ExtensionApi,_fts5))
  246. $(eval $(call ADD_JNI_H,$(dir.src.fts5),fts5_api,_fts5))
  247. $(eval $(call ADD_JNI_H,$(dir.src.fts5),fts5_tokenizer,_fts5))
  248. endif
  249. $(sqlite3-jni.h.in): $(dir.bld.c)
  250. #package.dll.cfiles :=
  251. package.dll.cflags = \
  252. -std=c99 \
  253. -fPIC \
  254. -I. \
  255. -I$(dir $(sqlite3.h)) \
  256. -I$(dir.src.c) \
  257. -I$(JDK_HOME)/include \
  258. $(patsubst %,-I%,$(patsubst %.h,,$(wildcard $(JDK_HOME)/include/*))) \
  259. -Wall
  260. # The gross $(patsubst...) above is to include the platform-specific
  261. # subdir which lives under $(JDK_HOME)/include and is a required
  262. # include path for client-level code.
  263. #
  264. # Using (-Wall -Wextra) triggers an untennable number of
  265. # gcc warnings from sqlite3.c for mundane things like
  266. # unused parameters.
  267. ########################################################################
  268. ifeq (1,$(enable.tester))
  269. package.dll.cflags += -DSQLITE_JNI_ENABLE_SQLTester
  270. endif
  271. $(sqlite3-jni.h): $(sqlite3-jni.h.in) $(MAKEFILE)
  272. @cat $(sqlite3-jni.h.in) > $@.tmp
  273. @if cmp $@ $@.tmp >/dev/null; then \
  274. rm -f $@.tmp; \
  275. echo "$@ not modified"; \
  276. else \
  277. mv $@.tmp $@; \
  278. echo "Updated $@"; \
  279. fi
  280. @if [ x1 != x$(enable.fts5) ]; then \
  281. echo "*** REMINDER:"; \
  282. echo "*** enable.fts5=0, so please do not check in changes to $@."; \
  283. fi
  284. $(package.dll): $(sqlite3-jni.h) $(sqlite3.c) $(sqlite3.h)
  285. $(package.dll): $(sqlite3-jni.c) $(MAKEFILE)
  286. $(CC) $(package.dll.cflags) $(SQLITE_OPT) \
  287. $(sqlite3-jni.c) -shared -o $@
  288. all: $(package.dll)
  289. .PHONY: test test-one
  290. Tester1.flags ?=
  291. Tester2.flags ?=
  292. test.flags.jvm = -ea -Djava.library.path=$(dir.bld.c) \
  293. $(java.flags) -cp $(classpath)
  294. test.deps := $(CLASS_FILES) $(package.dll)
  295. test-one: $(test.deps)
  296. $(bin.java) $(test.flags.jvm) org.sqlite.jni.capi.Tester1 $(Tester1.flags)
  297. $(bin.java) $(test.flags.jvm) org.sqlite.jni.wrapper1.Tester2 $(Tester2.flags)
  298. test-sqllog: $(test.deps)
  299. @echo "Testing with -sqllog..."
  300. $(bin.java) $(test.flags.jvm) org.sqlite.jni.capi.Tester1 $(Tester1.flags) -sqllog
  301. test-mt: $(test.deps)
  302. @echo "Testing in multi-threaded mode:";
  303. $(bin.java) $(test.flags.jvm) org.sqlite.jni.capi.Tester1 \
  304. -t 7 -r 50 -shuffle $(Tester1.flags)
  305. $(bin.java) $(test.flags.jvm) org.sqlite.jni.wrapper1.Tester2 \
  306. -t 7 -r 50 -shuffle $(Tester2.flags)
  307. test: test-one test-mt
  308. tests: test test-sqllog
  309. tester.scripts := $(sort $(wildcard $(dir.src)/tests/*.test))
  310. tester.flags ?= # --verbose
  311. .PHONY: tester tester-local tester-ext
  312. ifeq (1,$(enable.tester))
  313. tester-local: $(CLASS_FILES.tester) $(package.dll)
  314. $(bin.java) -ea -Djava.library.path=$(dir.bld.c) \
  315. $(java.flags) -cp $(classpath) \
  316. org.sqlite.jni.capi.SQLTester $(tester.flags) $(tester.scripts)
  317. tester: tester-local
  318. else
  319. tester:
  320. @echo "SQLTester support is disabled."
  321. endif
  322. tester.extdir.default := $(dir.tests)/ext
  323. tester.extdir ?= $(tester.extdir.default)
  324. tester.extern-scripts := $(wildcard $(tester.extdir)/*.test)
  325. ifneq (,$(tester.extern-scripts))
  326. tester-ext:
  327. $(bin.java) -ea -Djava.library.path=$(dir.bld.c) \
  328. $(java.flags) -cp $(classpath) \
  329. org.sqlite.jni.capi.SQLTester $(tester.flags) $(tester.extern-scripts)
  330. else
  331. tester-ext:
  332. @echo "******************************************************"; \
  333. echo "*** Include the out-of-tree test suite in the 'tester'"; \
  334. echo "*** target by either symlinking its directory to"; \
  335. echo "*** $(tester.extdir.default) or passing it to make"; \
  336. echo "*** as tester.extdir=/path/to/that/dir."; \
  337. echo "******************************************************";
  338. endif
  339. tester-ext: tester-local
  340. tester: tester-ext
  341. tests: tester
  342. ########################################################################
  343. # Build each SQLITE_THREADMODE variant and run all tests against them.
  344. multitest: clean
  345. define MULTIOPT
  346. multitest: multitest-$(1)
  347. multitest-$(1):
  348. $$(MAKE) opt.debug=$$(opt.debug) $(patsubst %,opt.%,$(2)) \
  349. tests clean enable.fts5=1
  350. endef
  351. $(eval $(call MULTIOPT,01,threadsafe=0 oom=1))
  352. $(eval $(call MULTIOPT,00,threadsafe=0 oom=0))
  353. $(eval $(call MULTIOPT,11,threadsafe=1 oom=1))
  354. $(eval $(call MULTIOPT,10,threadsafe=1 oom=0))
  355. $(eval $(call MULTIOPT,21,threadsafe=2 oom=1))
  356. $(eval $(call MULTIOPT,20,threadsafe=2 oom=0))
  357. ########################################################################
  358. # jar bundle...
  359. package.jar.in := $(abspath $(dir.src)/jar.in)
  360. CLEAN_FILES += $(package.jar.in)
  361. JAVA_FILES.jar := $(JAVA_FILES.main) $(JAVA_FILES.unittest) $(JAVA_FILES.package.info)
  362. CLASS_FILES.jar := $(filter-out %/package-info.class,$(JAVA_FILES.jar:.java=.class))
  363. $(package.jar.in): $(package.dll) $(MAKEFILE)
  364. ls -1 \
  365. $(dir.src.jni)/*/*.java $(dir.src.jni)/*/*.class \
  366. | sed -e 's,^$(dir.src)/,,' | sort > $@
  367. $(package.jar): $(CLASS_FILES.jar) $(MAKEFILE) $(package.jar.in)
  368. @rm -f $(dir.src)/c/*~ $(dir.src.jni)/*~
  369. cd $(dir.src); $(bin.jar) -cfe ../$@ org.sqlite.jni.capi.Tester1 @$(package.jar.in)
  370. @ls -la $@
  371. @echo "To use this jar you will need the -Djava.library.path=DIR/CONTAINING/libsqlite3-jni.so flag."
  372. @echo "e.g. java -Djava.library.path=bld -jar $@"
  373. jar: $(package.jar)
  374. run-jar: $(package.jar) $(package.dll)
  375. $(bin.java) -Djava.library.path=$(dir.bld) -jar $(package.jar) $(run-jar.flags)
  376. ########################################################################
  377. # javadoc...
  378. dir.doc := $(dir.jni)/javadoc
  379. doc.index := $(dir.doc)/index.html
  380. javadoc.exclude := -exclude org.sqlite.jni.fts5
  381. # ^^^^ 2023-09-13: elide the fts5 parts from the public docs for
  382. # the time being, as it's not clear where the Java bindings for
  383. # those bits are going.
  384. # javadoc.exclude += -exclude org.sqlite.jni.capi
  385. # ^^^^ exclude the capi API only for certain builds (TBD)
  386. $(doc.index): $(JAVA_FILES.main) $(MAKEFILE)
  387. @if [ -d $(dir.doc) ]; then rm -fr $(dir.doc)/*; fi
  388. $(bin.javadoc) -cp $(classpath) -d $(dir.doc) -quiet \
  389. -subpackages org.sqlite.jni $(javadoc.exclude)
  390. @echo "javadoc output is in $@"
  391. .PHONY: doc javadoc docserve
  392. .FORCE: doc
  393. doc: $(doc.index)
  394. javadoc: $(doc.index)
  395. # Force rebild of docs
  396. redoc:
  397. @rm -f $(doc.index)
  398. @$(MAKE) doc
  399. docserve: $(doc.index)
  400. cd $(dir.doc) && althttpd -max-age 1 -page index.html
  401. ########################################################################
  402. # Clean up...
  403. CLEAN_FILES += $(dir.bld.c)/* \
  404. $(dir.src.jni)/*.class \
  405. $(dir.src.jni)/*/*.class \
  406. $(package.dll) \
  407. hs_err_pid*.log
  408. .PHONY: clean distclean
  409. clean:
  410. -rm -f $(CLEAN_FILES)
  411. distclean: clean
  412. -rm -f $(DISTCLEAN_FILES)
  413. -rm -fr $(dir.bld.c) $(dir.doc)
  414. ########################################################################
  415. # disttribution bundle rules...
  416. ifeq (,$(filter snapshot,$(MAKECMDGOALS)))
  417. dist-name-prefix := sqlite-jni
  418. else
  419. dist-name-prefix := sqlite-jni-snapshot-$(shell /usr/bin/date +%Y%m%d)
  420. endif
  421. dist-name := $(dist-name-prefix)-TEMP
  422. dist-dir.top := $(dist-name)
  423. dist-dir.src := $(dist-dir.top)/src
  424. dist.top.extras := \
  425. README.md
  426. .PHONY: dist snapshot
  427. dist: \
  428. $(bin.version-info) $(sqlite3.canonical.c) \
  429. $(package.jar) $(MAKEFILE)
  430. @echo "Making end-user deliverables..."
  431. @echo "****************************************************************************"; \
  432. echo "*** WARNING: be sure to build this with JDK8 (javac 1.8) for compatibility."; \
  433. echo "*** reasons!"; $$($(bin.javac) -version); \
  434. echo "****************************************************************************"
  435. @rm -fr $(dist-dir.top)
  436. @mkdir -p $(dist-dir.src)
  437. @cp -p $(dist.top.extras) $(dist-dir.top)/.
  438. @cp -p jar-dist.make $(dist-dir.top)/Makefile
  439. @cp -p $(dir.src.c)/*.[ch] $(dist-dir.src)/.
  440. @cp -p $(sqlite3.canonical.c) $(sqlite3.canonical.h) $(dist-dir.src)/.
  441. @set -e; \
  442. vnum=$$($(bin.version-info) --download-version); \
  443. vjar=$$($(bin.version-info) --version); \
  444. vdir=$(dist-name-prefix)-$$vnum; \
  445. arczip=$$vdir.zip; \
  446. cp -p $(package.jar) $(dist-dir.top)/sqlite3-jni-$${vjar}.jar; \
  447. echo "Making $$arczip ..."; \
  448. rm -fr $$arczip $$vdir; \
  449. mv $(dist-dir.top) $$vdir; \
  450. zip -qr $$arczip $$vdir; \
  451. rm -fr $$vdir; \
  452. ls -la $$arczip; \
  453. set +e; \
  454. unzip -lv $$arczip || echo "Missing unzip app? Not fatal."
  455. snapshot: dist
  456. .PHONY: dist-clean
  457. clean: dist-clean
  458. dist-clean:
  459. rm -fr $(dist-name) $(wildcard sqlite-jni-*.zip)