interplane.Get Omega
Read in your language

sqlite

[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.

Brought by drakestapleton

branch master Branches Tags History

sqlite / ext / wasm / SQLTester / GNUmakefile

55 lines · 1428 bytes Raw Blame History
1#!/this/is/make
2#
3# This makefile compiles SQLTester test files into something
4# we can readily import into JavaScript.
5all:
6
7SHELL := $(shell which bash 2>/dev/null)
8MAKEFILE := $(lastword $(MAKEFILE_LIST))
9CLEAN_FILES :=
10DISTCLEAN_FILES := ./--dummy-- *~
11
12test-list.mjs := test-list.mjs
13test-list.mjs.gz := $(test-list.mjs).gz
14CLEAN_FILES += $(test-list.mjs)
15
16tests.dir := $(firstword $(wildcard tests ../../jni/src/tests))
17$(info test script dir=$(tests.dir))
18
19tests.all := $(wildcard $(tests.dir)/*.test)
20
21bin.touint8array := ./touint8array
22$(bin.touint8array): $(bin.touint8array).c $(MAKEFILE)
23 $(CC) -o $@ $<
24CLEAN_FILES += $(bin.touint8array)
25
26ifneq (,$(tests.all))
27$(test-list.mjs): $(bin.touint8array) $(tests.all) $(MAKEFILE)
28 @{\
29 echo 'export default ['; \
30 sep=''; \
31 for f in $(sort $(tests.all)); do \
32 echo -en $$sep'{"name": "'$${f##*/}'", "content":'; \
33 $(bin.touint8array) < $$f; \
34 echo -n '}'; \
35 sep=',\n'; \
36 done; \
37 echo '];'; \
38 } > $@
39 @echo "Created $@"
40$(test-list.mjs.gz): $(test-list.mjs)
41 gzip -c $< > $@
42CLEAN_FILES += $(test-list.mjs.gz)
43all: $(test-list.mjs.gz)
44else
45 @echo "Cannot build $(test-list.mjs) for lack of input test files."; \
46 echo "Symlink ./tests to a directory containing SQLTester-format "; \
47 echo "test scripts named *.test, then try again"; \
48 exit 1
49endif
50
51.PHONY: clean distclean
52clean:
53 -rm -f $(CLEAN_FILES)
54distclean: clean
55 -rm -f $(DISTCLEAN_FILES)