Skip to content

Run frontier MoE models on hardware you already own — pure C, zero deps, experts streamed from disk. Tiny engine, immense model. 🐦

C

build: a bare make target for every engine on Windows (#1945, #1900)

JustVugg8f4f3b01937b
diff --git a/c/Makefile b/c/Makefile
index c4501e91..7719eaa6 100644
--- a/c/Makefile
+++ b/c/Makefile
@@ -1259,7 +1259,11 @@ tests/bench_cuda_resident_batch$(EXE): tests/bench_cuda_resident_batch.cu backen
# the GPU sits idle. Same guard #783 put on kimi_k3, which since gaining an
# MXFP4 expert path no longer needs it. tests/test_makefile_cuda_scope.py
# asserts this shape.
-olmoe$(EXE): olmoe.c $(VK_OBJ) $(VK_SPV)
+ifneq ($(EXE),)
+.PHONY: olmoe
+olmoe: olmoe$(EXE)
+endif
+olmoe$(EXE): olmoe.c $(VK_OBJ) $(VK_SPV) .build-config
$(CC) $(NOCUDA_CFLAGS) olmoe.c $(VK_OBJ) -o olmoe$(EXE) $(NOCUDA_LDFLAGS)
# Qwen3.6-35B-A3B engine (hybrid Gated Attention + Gated DeltaNet + streaming
@@ -1405,6 +1409,10 @@ tests/test_qi_gemm$(EXE): tests/test_qi_gemm.c
# DeepSeek V4.1 Flash: one file, like every other portable engine. The fp4 experts
# stream from the official checkpoint and quant.h's mxfp4 kernel reads them as they
# are, so there is no conversion target here to go with it.
+ifneq ($(EXE),)
+.PHONY: deepseek_v41
+deepseek_v41: deepseek_v41$(EXE)
+endif
deepseek_v41$(EXE): deepseek_v41.c $(VK_OBJ) $(VK_SPV) .build-config
$(CC) $(CFLAGS) deepseek_v41.c $(VK_OBJ) -o deepseek_v41$(EXE) $(LDFLAGS)
@@ -1440,7 +1448,11 @@ mimo-tiny-serve-check: mimo-tiny-generate mimo$(EXE)
# loader and SERVE=1 protocol. With CUDA=1 it links the same expert tier as
# qwen36 (fp8 streaming mode: hot experts get VRAM copies, the RAM LRU stays);
# without it the tier header's inline stubs keep the build toolkit-free.
-qwen38$(EXE): qwen38.c $(QWEN36_TIER_OBJ) $(CUDA_OBJ) $(VK_OBJ) $(VK_SPV)
+ifneq ($(EXE),)
+.PHONY: qwen38
+qwen38: qwen38$(EXE)
+endif
+qwen38$(EXE): qwen38.c $(QWEN36_TIER_OBJ) $(CUDA_OBJ) $(VK_OBJ) $(VK_SPV) .build-config
$(CC) $(QWEN36_CFLAGS) qwen38.c $(QWEN36_TIER_OBJ) $(CUDA_OBJ) $(VK_OBJ) -o qwen38$(EXE) $(QWEN36_LDFLAGS)
.PHONY: qwen38-tiny-generate qwen38-tiny-check
@@ -1699,7 +1711,11 @@ tests/bench_qwen36_dense_batch$(EXE): tests/bench_qwen36_dense_batch.c qwen36.c
$(QWEN36_TIER_OBJ) $(CUDA_OBJ) $(VK_OBJ)
$(CC) $(QWEN36_CFLAGS) $< $(QWEN36_TIER_OBJ) $(CUDA_OBJ) $(VK_OBJ) -o $@ $(QWEN36_LDFLAGS)
-inkling$(EXE): inkling.c $(INK_CUDA_OBJ) $(METAL_OBJ) $(VK_OBJ) $(VK_SPV)
+ifneq ($(EXE),)
+.PHONY: inkling
+inkling: inkling$(EXE)
+endif
+inkling$(EXE): inkling.c $(INK_CUDA_OBJ) $(METAL_OBJ) $(VK_OBJ) $(VK_SPV) .build-config
$(CC) $(CFLAGS) inkling.c $(INK_CUDA_OBJ) $(METAL_OBJ) $(VK_OBJ) -o inkling$(EXE) $(LDFLAGS)
# ENGINES WITHOUT A CUDA BACKEND (#783).
@@ -1716,10 +1732,18 @@ NOCUDA_LDFLAGS = $(filter-out -lcudart -lstdc++ -lcuda -L$(CUDA_HOME)/lib64 \
# GLM-5.3-Flash: routed experts stream from the int4-gs64 container.
# METAL=1 accelerates resident matrices and routed MoE; CPU remains fallback.
-glm53$(EXE): glm53.c $(METAL_OBJ) $(VK_OBJ) $(VK_SPV)
+ifneq ($(EXE),)
+.PHONY: glm53
+glm53: glm53$(EXE)
+endif
+glm53$(EXE): glm53.c $(METAL_OBJ) $(VK_OBJ) $(VK_SPV) .build-config
$(CC) $(CFLAGS) glm53.c $(METAL_OBJ) $(VK_OBJ) -o glm53$(EXE) $(LDFLAGS)
-kimi_k3$(EXE): kimi_k3.c $(CUDA_OBJ) $(VK_OBJ) $(VK_SPV) $(METAL_OBJ)
+ifneq ($(EXE),)
+.PHONY: kimi_k3
+kimi_k3: kimi_k3$(EXE)
+endif
+kimi_k3$(EXE): kimi_k3.c $(CUDA_OBJ) $(VK_OBJ) $(VK_SPV) $(METAL_OBJ) .build-config
$(CC) $(CFLAGS) kimi_k3.c $(CUDA_OBJ) $(VK_OBJ) $(METAL_OBJ) -o kimi_k3$(EXE) $(LDFLAGS)
# Use a baseline that matches the compiler target. macOS already targets a
@@ -1741,6 +1765,10 @@ endif
portable:
$(MAKE) colibri$(EXE) ARCH=$(PORTABLE_ARCH)
+ifneq ($(EXE),)
+.PHONY: iobench
+iobench: iobench$(EXE)
+endif
iobench$(EXE): iobench.c
$(CC) $(CFLAGS) iobench.c -o iobench$(EXE) $(LDFLAGS)
diff --git a/c/tests/test_makefile_windows_aliases.py b/c/tests/test_makefile_windows_aliases.py
new file mode 100644
index 00000000..2bda19f2
--- /dev/null
+++ b/c/tests/test_makefile_windows_aliases.py
@@ -0,0 +1,38 @@
+"""Every engine the installer builds has a bare `make <engine>` on Windows (#1945, #1900).
+
+With EXE=.exe the real rules are `<engine>.exe:`; a bare `make qwen38` without an alias
+falls to make's built-in %: %.c rule, which compiles qwen38.c alone (no CUDA loader, no
+Vulkan objects) and fails at the link, or keeps a CPU-only binary in silence. The dry
+run below is what make would do for the installer's own target names.
+"""
+import shutil
+import subprocess
+import sys
+import unittest
+from pathlib import Path
+
+C_DIR = Path(__file__).resolve().parents[1]
+MAKE = shutil.which("make")
+sys.path.insert(0, str(C_DIR))
+import family_registry # noqa: E402
+
+
[email protected](MAKE, "make is required")
+class MakefileWindowsAliasTests(unittest.TestCase):
+ def test_every_installer_target_takes_its_exe_rule(self):
+ targets = sorted({f.build_target for f in family_registry.all_families()})
+ self.assertIn("qwen38", targets)
+ for target in targets:
+ if target == "deepseek-v4": # its own phony target in Makefile.deepseek-v4
+ continue
+ with self.subTest(target=target):
+ out = subprocess.run(
+ [MAKE, "--no-print-directory", "-B", "-n", target, "TRIPLET=x86_64-w64-mingw32"],
+ cwd=C_DIR, text=True, capture_output=True, check=True,
+ ).stdout
+ self.assertIn(f"-o {target}.exe", out)
+ self.assertNotRegex(out, rf"\b{target}\.c\s+-o {target}\s*$")
+
+
+if __name__ == "__main__":
+ unittest.main()