aboutsummaryrefslogtreecommitdiff
path: root/build.mk
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-06-25 22:26:00 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-06-25 22:26:00 +0200
commitfe3fe5d737e61e6e179b63f0480216c421810fd8 (patch)
tree3ba8b7ce178187b31261d8a1cd2ae2e97a1e9d05 /build.mk
parent6a9aa3302362e7d129b804cd621d39a1c1e7c43d (diff)
downloadffwd-fe3fe5d737e61e6e179b63f0480216c421810fd8.tar.gz
ffwd-fe3fe5d737e61e6e179b63f0480216c421810fd8.zip
build: vendor yyjson 0.12.0 in deps/yyjson
Diffstat (limited to 'build.mk')
-rw-r--r--build.mk20
1 files changed, 7 insertions, 13 deletions
diff --git a/build.mk b/build.mk
index 667cf03..cc0c06e 100644
--- a/build.mk
+++ b/build.mk
@@ -34,19 +34,13 @@ ifeq ($(strip $(OPENBLAS_LDFLAGS)),)
OPENBLAS_LDFLAGS = -lopenblas
endif
-YYJSON_CFLAGS ?= $(shell sh -c 'pkg-config --cflags yyjson 2>/dev/null')
-YYJSON_LDFLAGS ?= $(shell sh -c 'pkg-config --libs yyjson 2>/dev/null')
-ifeq ($(OS),Darwin)
-ifeq ($(strip $(YYJSON_CFLAGS)),)
- YYJSON_CFLAGS = -I/opt/homebrew/include -I/usr/local/include
-endif
-ifeq ($(strip $(YYJSON_LDFLAGS)),)
- YYJSON_LDFLAGS = -L/opt/homebrew/lib -L/usr/local/lib -lyyjson
-endif
-endif
-ifeq ($(strip $(YYJSON_LDFLAGS)),)
- YYJSON_LDFLAGS = -lyyjson
-endif
+# yyjson is vendored under deps/yyjson and built into a per-config static archive
+# (deps/yyjson/Makefile), so there is no system or pkg-config dependency.
+# YYJSON_CFLAGS resolves <yyjson.h> to the vendored header; YYJSON_LDFLAGS names
+# the archive by full path (as the server links libae.a), which links the same
+# way on macOS and Linux. Consumers build it via $(MAKE) -C deps/yyjson.
+YYJSON_CFLAGS := -I$(ROOT)/deps/yyjson
+YYJSON_LDFLAGS := $(OUTDIR)/libyyjson.a
MLX_PREFIX := $(shell brew --prefix mlx 2>/dev/null)
MLXC_PREFIX := $(shell brew --prefix mlx-c 2>/dev/null)