Files
lean-sdl3/justfile
T
Greg ShuflinandClaude Fable 5.1 2de47f0db9 Fix macOS link: use ld64 flags instead of GNU ld ones
ld64.lld rejects --allow-shlib-undefined and -rpath=$ORIGIN. Add a
macOS branch with -undefined dynamic_lookup and an @executable_path
rpath, and skip the Linux-only patchelf step in the justfile.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-08 15:26:20 -07:00

54 lines
1.2 KiB
Makefile

_default:
@just --list
[doc: "Build the general test app"]
[group: "build"]
build-test-app:
@just _build test-app
@just _perform_nix_patch test-app
[doc: "Build the general test app"]
[group: "run"]
run-test-app: build-test-app
.lake/build/bin/test-app
[doc: "Build the webcam demo"]
[group: "build"]
build-webcam-demo:
@just _build webcam-app
@just _perform_nix_patch webcam-app
[doc: "Run the webcam demo"]
[group: "run"]
run-webcam-demo: build-webcam-demo
.lake/build/bin/webcam-app
_build binary-name:
lake build {{binary-name}} --verbose
[linux]
_perform_nix_patch binary-name:
patchelf --set-interpreter /usr/lib/ld-linux-x86-64.so.2 .lake/build/bin/{{binary-name}}
patchelf --set-rpath '$ORIGIN:/usr/lib' .lake/build/bin/{{binary-name}}
[macos]
_perform_nix_patch binary-name:
@true
# Build the C version of the SDL3 webcam
[group: "C_build"]
build-c-webcam-demo:
@just _build-c-example examples/sdl-webcam-example.c c-webcam-example
[group: "C_build"]
build-c-gamepad-example:
@just _build-c-example examples/sdl-gamepad-example.c c-gamepad-example
# Build one of the C SDL3 examples
[group: "C_build"]
_build-c-example c-sourcefile binary-name:
gcc -lSDL3 {{c-sourcefile}} -o {{binary-name}}