Add a make build path for distro packaging

Mirror the crafter-build pipeline in a plain GNU Makefile — precompile
the libc++ std module and the Imsd partitions in dependency order,
archive imsd-core, link the three executables with the same clang/
libc++ flags — so distributions can build from source without
packaging crafter-build first. make check runs the same 7 suites;
make install stages the binaries plus the packaging/ files under
DESTDIR/PREFIX.

Rewrite packaging/APKBUILD from a documentation skeleton into a real
source-build APKBUILD on top of it (Alpine's llvm-runtimes ships the
std module sources since 22.x). project.cpp remains the canonical
build description.

Assisted-by: Claude:claude-fable-5
This commit is contained in:
Jorijn van der Graaf 2026-08-07 21:05:33 +02:00
commit 10379586b5
3 changed files with 173 additions and 24 deletions

View file

@ -95,6 +95,21 @@ crafter-build -- --product=dialerd # bin/imsd-dialerd-.../imsd-dialerd (dialer
crafter-build test # unit tests (Util, Aka, Ipsec, Messages, Engine, Sip, Sdp)
```
### Building with make (distro packaging)
For environments without crafter-build, the Makefile mirrors the same clang
module pipeline: GNU make, clang++ with libc++ and the libc++ std module
sources (`std.cppm` — package `llvm-runtimes` on Alpine, `libc++` on Arch),
lld, and gio-2.0 headers.
```sh
make # build/make/{imsd,imsd-media,imsd-dialerd}
make check # the same 7 unit-test suites
make install # DESTDIR/PREFIX staged install incl. the packaging/ files
```
`project.cpp` stays the canonical build description; the Makefile tracks it.
### Cross-compiling for a phone (aarch64 Alpine/postmarketOS)
```sh
@ -121,8 +136,9 @@ after `packaging/ims-pdn-up.sh` has brought up the ims PDN through
ModemManager. It spawns `/usr/libexec/imsd-media` per call. Registration
resumes an in-kernel IPsec SA when one is present (avoiding the network's
fresh-SA throttle) and keeps itself alive with a re-REGISTER refresh at half
the granted lifetime. `packaging/APKBUILD.binary` + `make-bin-tarball.sh`
wrap a cross-compiled build into an apk.
the granted lifetime. `packaging/APKBUILD` builds the apk from source via
the Makefile; `packaging/APKBUILD.binary` + `make-bin-tarball.sh` wrap a
cross-compiled build into an apk instead.
## Configuration