Files
sqlite/Makefile
T
waozi ddb130a0e6 Add the SQLite C library as a Ziran package
The binding started in Inbe's storage code: SQLite's own functions and
return codes, plus variants that take Ziran strings and copy them to the
NUL-terminated text SQLite expects. The test opens an in-memory database
and checks text with escapes, 64-bit integers, statement reuse, long SQL,
errors, and a refused tail pointer.
2026-09-29 22:07:56 -03:00

25 lines
679 B
Makefile

.DEFAULT_GOAL := check
ZIRAN ?= ziran
CC ?= cc
BUILD := build
SQLITE_LIBS ?= $(shell pkg-config --libs sqlite3 2>/dev/null || echo -lsqlite3)
.PHONY: check test clean
# Checks the package, then runs the test against the system SQLite. The
# portable bundle cannot call into the SQLite C library, so the test is
# native only.
check: test
test:
$(ZIRAN) check --project
$(ZIRAN) build --project --target=c --entry sqlite_test:main \
-o $(BUILD)/test-c tests/sqlite_test.zi
$(CC) -std=c99 -pedantic-errors -I$$($(ZIRAN) pkg path ziran)/include \
-I$(BUILD)/test-c $(BUILD)/test-c/*.c $(SQLITE_LIBS) -o $(BUILD)/sqlite-test
$(BUILD)/sqlite-test
clean:
rm -rf $(BUILD)