1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Build the SQLRite C sample.
#
# Run from this directory (`examples/c/`). `make` first builds the
# Rust cdylib via cargo, then compiles `hello.c` against its header
# and shared library. The resulting binary embeds an rpath pointing
# at the cargo target dir so `./hello` runs without any
# LD_LIBRARY_PATH / DYLD_* environment juggling.
#
# Targets:
# make hello — build the example
# make run — build + run
# make clean — remove the binary (cargo artifacts stay)
# Relative paths from `examples/c/` up to the workspace root. Kept
# literal (not computed via `git` / `cd … && pwd`) because `$(shell …)`
# with multi-command fallbacks is fiddly across make versions.
REPO_ROOT :=
HEADER_DIR :=
LIB_DIR :=
LIB_NAME :=
CC ?=
CFLAGS ?=
LDFLAGS :=
:
:
# Build the Rust cdylib. Cargo handles up-to-date checks internally
# so this is cheap on incremental builds.
:
: : :