blob: aafcf4407966aa7e5554048ebae93ed825b37a81 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
include build.mk
# Top-level build:
# Root owns BACKEND/MODE and exports the resolved flags through build.mk.
LIBS := libffwd
TOOLS := tools/cli tools/server
.PHONY: all libs tools test clean debug profile release blas cpu mlx cuda gpu \
bench bench-model bench-tokenizer bench-server-utils $(LIBS) $(TOOLS)
all: libs tools
@ln -sf $(BUILDREL)/ffwd-cli ./ffwd-cli
@ln -sf $(BUILDREL)/ffwd-server ./ffwd-server
libs: $(LIBS)
tools: $(TOOLS)
$(LIBS):
$(MAKE) -C $@
tools/cli: | libffwd
$(MAKE) -C $@
tools/server: | libffwd
$(MAKE) -C $@
# The current unit suite is CPU-internal; GPU checks are explicit driver targets.
test:
$(MAKE) -C tests BACKEND=blas test
$(MAKE) -C tools/server BACKEND=blas test
clean:
$(RM) -r build
@for d in $(TOOLS) tests bench; do $(MAKE) -C $$d clean; done
$(RM) -f ./ffwd-cli ./ffwd-server ffwd.exports ffwd.map
blas:
$(MAKE) BACKEND=blas MODE=$(MODE) all
cpu: blas
mlx:
$(MAKE) BACKEND=mlx MODE=$(MODE) all
cuda:
$(MAKE) BACKEND=cuda MODE=$(MODE) all
ifeq ($(OS),Darwin)
gpu: mlx
else
gpu: cuda
endif
release:
$(MAKE) MODE=release BACKEND=$(BACKEND) all
debug:
$(MAKE) MODE=debug BACKEND=$(BACKEND) all
profile:
$(MAKE) MODE=profile BACKEND=$(BACKEND) all
bench bench-model bench-tokenizer bench-server-utils:
$(MAKE) -C bench $@
|