Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (55 loc) · 1.48 KB
/
Copy pathMakefile
File metadata and controls
70 lines (55 loc) · 1.48 KB
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
66
67
68
69
70
all: dev
# One of build/presets/*.env; see apps/website/docs/presets.md.
PRESET ?= full
MT_FLAGS := -sUSE_PTHREADS -pthread
DEV_ARGS := --progress=plain
DEV_CFLAGS := --profiling
DEV_MT_CFLAGS := $(DEV_CFLAGS) $(MT_FLAGS)
PROD_CFLAGS := -O3 -msimd128
PROD_MT_CFLAGS := $(PROD_CFLAGS) $(MT_FLAGS)
clean:
rm -rf ./packages/core$(PKG_SUFFIX)/dist
.PHONY: build
build:
make clean PKG_SUFFIX="$(PKG_SUFFIX)"
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
EXTRA_LDFLAGS="$(EXTRA_LDFLAGS)" \
FFMPEG_ST="$(FFMPEG_ST)" \
FFMPEG_JSPI="$(FFMPEG_JSPI)" \
FFMPEG_MT="$(FFMPEG_MT)" \
PRESET="$(PRESET)" \
docker buildx build \
--build-arg EXTRA_CFLAGS \
--build-arg EXTRA_LDFLAGS \
--build-arg FFMPEG_MT \
--build-arg FFMPEG_ST \
--build-arg FFMPEG_JSPI \
--build-arg PRESET \
-o ./packages/core$(PKG_SUFFIX) \
$(EXTRA_ARGS) \
.
build-st:
make build \
FFMPEG_ST=yes
# Opt-in single-thread core that switches threads with JSPI instead of Asyncify.
build-jspi:
make build \
PKG_SUFFIX=-jspi \
FFMPEG_ST=yes \
FFMPEG_JSPI=yes
build-mt:
make build \
PKG_SUFFIX=-mt \
FFMPEG_MT=yes
dev:
make build-st EXTRA_CFLAGS="$(DEV_CFLAGS)" EXTRA_ARGS="$(DEV_ARGS)"
dev-jspi:
make build-jspi EXTRA_CFLAGS="$(DEV_CFLAGS)" EXTRA_ARGS="$(DEV_ARGS)"
dev-mt:
make build-mt EXTRA_CFLAGS="$(DEV_MT_CFLAGS)" EXTRA_ARGS="$(DEV_ARGS)"
prd:
make build-st EXTRA_CFLAGS="$(PROD_CFLAGS)"
prd-mt:
make build-mt EXTRA_CFLAGS="$(PROD_MT_CFLAGS)"
prd-jspi:
make build-jspi EXTRA_CFLAGS="$(PROD_CFLAGS)"