Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/MojoLlama/blob/main/src/mojollama/engine/Makefile # MojoLlama Archived Mojo/MAX quantizer and serving research repository (read-only history) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `MojoLlama / src / mojollama / engine / Makefile` 44 lines · 1656 bytes Raw Blame History 1 # ── Makefile for mojo_engine ────────────────────────────────────────── 2 # Compiles mojo_engine.c, links against ../kernels/q4_kernel_omp.so, 3 # and produces the mojo_engine binary. 4 # 5 # Usage: 6 # make — build the engine 7 # make clean — remove build artefacts 8 # make run — build & run with default args 9 # ───────────────────────────────────────────────────────────────────── 10 11 CC ?= gcc 12 CFLAGS := -O3 -mavx2 -mfma -mf16c -fopenmp -Wall -Wextra 13 LDFLAGS := -L../kernels -l:q4_kernel_omp.so -Wl,-rpath,'$$ORIGIN/../kernels' 14 LDLIBS := -lpthread -lm 15 16 # ── Targets ───────────────────────────────────────────────────────── 17 18 TARGET := mojo_engine 19 SRC := mojo_engine.c 20 OBJ := $(SRC:.c=.o) 21 22 .PHONY: all clean run 23 24 all: $(TARGET) 25 26 $(TARGET): $(OBJ) 27 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) 28 29 %.o: %.c 30 $(CC) $(CFLAGS) -c -o $@ $< 31 32 # ── Convenience run (override with MODEL/PORT/THREADS env vars) ──── 33 34 MODEL ?= /dev/null 35 PORT ?= 8080 36 THREADS ?= 4 37 38 run: $(TARGET) 39 ./$(TARGET) --model $(MODEL) --port $(PORT) --threads $(THREADS) 40 41 # ── Clean ─────────────────────────────────────────────────────────── 42 43 clean: 44 rm -f $(OBJ) $(TARGET)