-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
611 lines (461 loc) · 18.1 KB
/
Makefile
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
# Profiles
PROFILE?=release
ifeq ($(PROFILE),release)
PROFILE_FLAG:=--release
WASM_PROFILE_FLAG:=$(PROFILE_FLAG)
else
ifeq ($(PROFILE),debug)
PROFILE_FLAG:=
WASM_PROFILE_FLAG:=--dev
else
PROFILE_FLAG:=--profile=$(PROFILE)
WASM_PROFILE_FLAG:=$(PROFILE_FLAG)
endif
endif
# Features
FEATURE_ARG_BASE?=--no-default-features --features=
FFMPEG_FEATURES?=enable-ffmpeg-build
FRONTEND_RUST_FLAGS?=$(FEATURE_ARG_BASE)frontend-rust
FRONTEND_FFMPEG_RUST_FLAGS?=$(FEATURE_ARG_BASE)frontend-rust,$(FFMPEG_FEATURES)
FRONTEND_BINARY_FLAGS?=--bin=babycat $(FEATURE_ARG_BASE)frontend-binary
FRONTEND_FFMPEG_BINARY_FLAGS?=--bin=babycat $(FEATURE_ARG_BASE)frontend-binary,$(FFMPEG_FEATURES)
FRONTEND_PYTHON_FLAGS?=$(FEATURE_ARG_BASE)frontend-python
FRONTEND_FFMPEG_PYTHON_FLAGS?=$(FEATURE_ARG_BASE)frontend-python,$(FFMPEG_FEATURES)
FRONTEND_C_FLAGS?=$(FEATURE_ARG_BASE)frontend-c
FRONTEND_FFMPEG_C_FLAGS?=$(FEATURE_ARG_BASE)frontend-c,$(FFMPEG_FEATURES)
FRONTEND_WASM_FLAGS?=$(FEATURE_ARG_BASE)frontend-wasm
ifdef FEATURES
FRONTEND_RUST_FLAGS:=$(FEATURES)
FRONTEND_FFMPEG_RUST_FLAGS:=$(FEATURES)
FRONTEND_BINARY_FLAGS:=$(FEATURES)
FRONTEND_FFMPEG_BINARY_FLAGS:=$(FEATURES)
FRONTEND_PYTHON_FLAGS:=$(FEATURES)
FRONTEND_FFMPEG_PYTHON_FLAGS:=$(FEATURES)
FRONTEND_C_FLAGS:=$(FEATURES)
FRONTEND_FFMPEG_C_FLAGS:=$(FEATURES)
FRONTEND_WASM_FLAGS:=-$(FEATURES)
endif
# Target directories
CARGO_TARGET_DIR?=$(PWD)/target
CARGO_TARGET_PROFILE_DIR?=$(CARGO_TARGET_DIR)/$(PROFILE)
WHEEL_DIR?=$(CARGO_TARGET_PROFILE_DIR)/python
MANYLINUX_WHEEL_DIR?=$(CARGO_TARGET_PROFILE_DIR)/python-manylinux
FFMPEG_WHEEL_DIR?=$(CARGO_TARGET_PROFILE_DIR)/python-ffmpeg
WASM_DIR?=$(CARGO_TARGET_PROFILE_DIR)/wasm
# Paths to commands that we depend on
CARGO?=cargo
RUSTUP?=rustup
CBINDGEN?=cbindgen
CLANG_FORMAT?=clang-format
DOXYGEN?=doxygen
DOCKER?=docker
WASM_PACK?=wasm-pack
NPM?=npm
NODE_MODULES_PATH?=$(PWD)/node_modules
NODE_BIN?=$(NODE_MODULES_PATH)/.bin
ESLINT?=$(NODE_BIN)/eslint
PRETTIER?=$(NODE_BIN)/prettier
NETLIFY?=$(NODE_BIN)/netlify
# Command flags
RUSTFLAGS+="--print native-static-libs"
# System Information
RUST_HOST?=$(shell rustc -vV | grep host)
OS?=
# Python venv configuration.
ifeq ($(OS),Windows_NT)
PYTHON?=python
VENV_SUBDIR?=Scripts
else
PYTHON?=python3
VENV_SUBDIR?=bin
endif
DISABLE_VENV?=0
VENV_DIR?=$(PWD)/venv
ifeq ($(DISABLE_VENV), 1)
CREATE_VENV_CMD?=
DELETE_VENV_CMD?=
VENV_BIN?=
else
CREATE_VENV_CMD?=$(PYTHON) -m venv $(VENV_DIR)
DELETE_VENV_CMD?=rm -rfv $(VENV_DIR)
VENV_BIN?=$(VENV_DIR)/$(VENV_SUBDIR)/
endif
# This is the shared library filename
# (excluding the extension, see SHARED_LIB_EXT below)
# that `cargo build` creates.
ifeq ($(OS),Windows_NT)
ifneq (,$(findstring gnu,$(RUST_HOST)))
BABYCAT_SHARED_LIB_NAME?=libbabycat
endif
BABYCAT_SHARED_LIB_NAME?=babycat
else
BABYCAT_SHARED_LIB_NAME?=libbabycat
endif
# This is the filename for the babycat binary.
ifeq ($(OS),Windows_NT)
BABYCAT_BINARY_NAME?=babycat.exe
else
BABYCAT_BINARY_NAME?=babycat
endif
# This sets the file extension for linking to shared libraries.
# We typically use this when testing Babycat's C FFI bindings.
ifeq ($(OS),Windows_NT)
ifneq (,$(findstring gnu,$(RUST_HOST)))
SHARED_LIB_EXT?=a
endif
SHARED_LIB_EXT?=lib
else
ifeq ($(shell uname -s),Darwin)
SHARED_LIB_EXT?=dylib
else
SHARED_LIB_EXT?=so
endif
endif
# The path to the Babycat shared library.
SHARED_LIB_FILENAME?=$(BABYCAT_SHARED_LIB_NAME).$(SHARED_LIB_EXT)
SHARED_LIB_PATH?=$(CARGO_TARGET_PROFILE_DIR)/$(SHARED_LIB_FILENAME)
SHARED_LIB_NATIVE_FLAGS?=$(SHARED_LIB_PATH).flags
CARGO_TARGET_C_DIR=$(CARGO_TARGET_PROFILE_DIR)/c
CARGO_TARGET_FFMPEG_C_DIR=$(CARGO_TARGET_PROFILE_DIR)/ffmpeg-c
FRONTEND_C_LIB?=$(CARGO_TARGET_C_DIR)/$(BABYCAT_SHARED_LIB_NAME).$(SHARED_LIB_EXT)
FRONTEND_FFMPEG_C_LIB?=$(CARGO_TARGET_FFMPEG_C_DIR)/$(BABYCAT_SHARED_LIB_NAME).$(SHARED_LIB_EXT)
# Tools in our Python venv
PIP?=$(VENV_BIN)pip
BLACK?=$(VENV_BIN)black
ISORT?=$(VENV_BIN)isort
MATURIN?=$(VENV_BIN)maturin
PYLINT?=$(VENV_BIN)pylint
MYPY?=$(VENV_BIN)mypy
PYTEST?=$(VENV_BIN)pytest
SPHINX_BUILD?=$(VENV_BIN)sphinx-build
PYTHON_CODE_PATHS?=./tests-python ./docs/source/conf.py
JAVASCRIPT_CODE_PATHS?=./tests-wasm-nodejs/test.js
# Commands to execute
# pip
PIP_INSTALL_WHEEL?=$(PIP) install --force-reinstall $(WHEEL_DIR)/*.whl
PIP_INSTALL_MANYLINUX_WHEEL?=$(PIP) install --force-reinstall $(MANYLINUX_WHEEL_DIR)/*.whl
PIP_INSTALL_FFMPEG_WHEEL?=$(PIP) install --force-reinstall $(FFMPEG_WHEEL_DIR)/*.whl
# cargo
CARGO_BUILD?=$(CARGO) build $(PROFILE_FLAG)
CARGO_RUN?=$(CARGO) run $(PROFILE_FLAG)
CARGO_TEST?=$(CARGO) test $(PROFILE_FLAG)
# maturin
MATURIN_FLAGS?=--manifest-path=Cargo.toml
MATURIN_BUILD?=$(MATURIN) build $(MATURIN_FLAGS)
# wasm-pack
WASM_PACK_BUILD?=$(WASM_PACK) build $(WASM_PROFILE_FLAG)
# ===================================================================
# help ==============================================================
# ===================================================================
help:
@cat makefile-help.txt
.PHONY: help
# ===================================================================
# clean =============================================================
# ===================================================================
clean-cache:
rm -rfv .b/* .ipynb_checkpoints .mypy_cache .pytest_cache tests-python/__pycache__
find . -name '.DS_Store' -delete
.PHONY: clean-cache
clean-docs:
rm -rfv docs/build docs/source/api/python/generated
.PHONY: clean-docs
clean-node-modules:
rm -rfv $(NODE_MODULES_PATH) tests-wasm-nodejs/node_modules examples-wasm/decode/node_modules
.PHONY: clean-node-modules
clean-target:
rm -rfv target babycat.h examples-wasm/decode/dist
.PHONY: clean-target
clean-venv:
$(DELETE_VENV_CMD)
.PHONY: clean-venv
clean: clean-cache clean-docs clean-node-modules clean-target clean-venv
.PHONY: clean
# ===================================================================
# init-python =======================================================
# ===================================================================
.b/init-python-venv:
$(CREATE_VENV_CMD)
@touch $@
init-python-venv: .b/init-python-venv
.PHONY: init-python-venv
.b/init-python-build: .b/init-python-venv requirements-build.txt
$(PIP) install -r requirements-build.txt
@touch $@
init-python-build: .b/init-python-build
.PHONY: init-python-build
.b/init-python-deps: .b/init-python-venv requirements.txt
$(PIP) install -r requirements.txt
@touch $@
init-python-deps: .b/init-python-deps
.PHONY: init-python-deps
.b/init-python-dev: .b/init-python-venv requirements-dev.txt
$(PIP) install -r requirements-dev.txt
@touch $@
init-python-dev: .b/init-python-dev
.PHONY: init-python-dev
.b/init-python-docs: .b/init-python-venv requirements-docs.txt
$(PIP) install -r requirements-docs.txt
@touch $@
init-python-docs: .b/init-python-docs
init-python: init-python-build init-python-deps init-python-dev init-python-docs
.PHONY: init-python
init-python-deps: init-python-venv requirements.txt
$(PIP) install -r requirements.txt
.PHONY: init-python-deps
init-python-dev: init-python-venv requirements-dev.txt
$(PIP) install -r requirements-dev.txt
.PHONY: init-python-dev
# ===================================================================
# init-npm ==========================================================
# ===================================================================
.b/init-npm-dev: package.json
$(NPM) rebuild && $(NPM) install
@touch $@
.b/init-npm-test: tests-wasm-nodejs/package.json
cd tests-wasm-nodejs && $(NPM) rebuild && $(NPM) install
@touch $@
init-npm: .b/init-npm-dev .b/init-npm-test
.PHONY: init-npm
# ===================================================================
# init-cargo ========================================================
# ===================================================================
.b/init-cargo-clippy:
$(RUSTUP) component add clippy
@touch $@
init-cargo-clippy: .b/init-cargo-clippy
.PHONY: init-cargo-clippy
.b/init-cargo-fmt:
$(RUSTUP) component add rustfmt
@touch $@
init-cargo-fmt: .b/init-cargo-fmt
.PHONY: init-cargo-fmt
.b/init-cargo-wasm32-unknown-unknown:
$(RUSTUP) target add wasm32-unknown-unknown
@touch $@
init-cargo-wasm32-unknown-unknown: .b/init-cargo-wasm32-unknown-unknown
.PHONY: init-cargo-wasm32-unknown-unknown
.b/init-cargo-cbindgen:
$(CARGO) install cbindgen || true
@touch $@
init-cargo-cbindgen: .b/init-cargo-cbindgen
.PHONY: init-cargo-cbindgen
init-cargo: init-cargo-clippy init-cargo-fmt init-cargo-wasm32-unknown-unknown init-cargo-cbindgen
.PHONY: init-cargo
init: init-python init-npm init-cargo
.PHONY: init
# ===================================================================
# init-docker =======================================================
# ===================================================================
.b/init-docker-maturin: docker/maturin/Dockerfile
$(DOCKER) build -t babycat/maturin -f docker/maturin/Dockerfile .
@touch $@
init-docker-maturin: .b/init-docker-maturin
.PHONY: init-docker-maturin
# ===================================================================
# fmt ===============================================================
# ===================================================================
fmt-c:
$(CLANG_FORMAT) -i tests-c/*.c examples-c/*.c
.PHONY: fmt-c
fmt-javascript: .b/init-npm-dev
$(ESLINT) --fix $(JAVASCRIPT_CODE_PATHS)
$(PRETTIER) --write $(JAVASCRIPT_CODE_PATHS)
.PHONY: fmt-javascript
fmt-python: .b/init-python-dev
$(BLACK) $(PYTHON_CODE_PATHS)
$(ISORT) $(PYTHON_CODE_PATHS)
.PHONY: fmt-python
fmt-rust: .b/init-cargo-fmt
$(CARGO) fmt
.PHONY: fmt-rust
fmt: fmt-c fmt-javascript fmt-python fmt-rust
.PHONY: fmt
# ===================================================================
# fmt-check =========================================================
# ===================================================================
fmt-check-c:
$(CLANG_FORMAT) --dry-run -Werror tests-c/*
.PHONY: fmt-check-c
fmt-check-javascript: .b/init-npm-dev
$(ESLINT) $(JAVASCRIPT_CODE_PATHS)
$(PRETTIER) --check --loglevel=silent $(JAVASCRIPT_CODE_PATHS)
.PHONY: fmt-check-javascript
fmt-check-python: .b/init-python-dev
$(BLACK) --quiet $(PYTHON_CODE_PATHS)
$(ISORT) --quiet $(PYTHON_CODE_PATHS)
.PHONY: fmt-check-python
fmt-check-rust: .b/init-cargo-fmt
$(CARGO) fmt -- --check
.PHONY: fmt-check-rust
fmt-check: fmt-check-c fmt-check-javascript fmt-check-python fmt-check-rust
.PHONY: fmt-check
# ===================================================================
# lint ==============================================================
# ===================================================================
lint-python: .b/init-python-dev
$(PYLINT) $(PYTHON_CODE_PATHS)
$(MYPY) $(PYTHON_CODE_PATHS)
.PHONY: lint-python
lint-rust: .b/init-cargo-clippy
$(ALL_FEATURES_TARGET) $(CARGO) clippy $(PROFILE_FLAG) --all-features
.PHONY: lint-rust
lint: lint-python lint-rust
.PHONY: lint
# ===================================================================
# build =============================================================
# ===================================================================
build-rust:
$(CARGO_BUILD) $(FRONTEND_RUST_FLAGS)
.PHONY: build-rust
build-ffmpeg-rust:
$(CARGO_BUILD) $(FRONTEND_FFMPEG_RUST_FLAGS)
.PHONY: build-ffmpeg-rust
build-rust-all-features:
$(CARGO_BUILD) --all-features
.PHONY: build-rust-all-features
build-binary:
$(CARGO_BUILD) $(FRONTEND_BINARY_FLAGS)
.PHONY: build-binary
build-ffmpeg-binary:
$(CARGO_BUILD) $(FRONTEND_FFMPEG_BINARY_FLAGS)
.PHONY: build-ffmpeg-binary
build-c-header: .b/init-cargo-cbindgen
$(CBINDGEN) --quiet --output=babycat.h
.PHONY: build-c-header
build-c: build-c-header
mkdir -p "$(CARGO_TARGET_C_DIR)"
RUSTFLAGS=$(RUSTFLAGS) $(CARGO_BUILD) $(FRONTEND_C_FLAGS) 2> tmp_build_c_log.txt && cp "$(SHARED_LIB_PATH)" "$(FRONTEND_C_LIB)"
cat tmp_build_c_log.txt | grep native-static-libs | cut -d ':' -f 3 > $(SHARED_LIB_NATIVE_FLAGS)
rm tmp_build_c_log.txt
.PHONY: build-c
build-ffmpeg-c: build-c-header
mkdir -p "$(CARGO_TARGET_FFMPEG_C_DIR)"
$(CARGO_BUILD) $(FRONTEND_FFMPEG_C_FLAGS) && cp "$(SHARED_LIB_PATH)" "$(FRONTEND_FFMPEG_C_LIB)"
.PHONY: build-ffmpeg-c
build-python: .b/init-python-build
$(MATURIN_BUILD) --out="$(WHEEL_DIR)" --profile=$(PROFILE) $(FRONTEND_PYTHON_FLAGS)
.PHONY: build-python
build-python-manylinux: .b/init-docker-maturin
mkdir -p $(MANYLINUX_WHEEL_DIR)
$(DOCKER) run --user=$$(id -u):$$(id -g) -eCARGO_TARGET_DIR=/tmp --volume="$(PWD):/src" --volume="$(MANYLINUX_WHEEL_DIR):/wheels" --workdir=/src babycat/maturin build --out=/wheels $(MATURIN_FLAGS) --profile=$(PROFILE) $(FRONTEND_PYTHON_FLAGS)
.PHONY: build-python-manylinux
build-ffmpeg-python: .b/init-python-build
$(MATURIN_BUILD) --out="$(FFMPEG_WHEEL_DIR)" --profile=$(PROFILE) $(FRONTEND_FFMPEG_PYTHON_FLAGS)
.PHONY: build-ffmpeg-python
build-wasm-bundler:
$(WASM_PACK_BUILD) --target=bundler --out-dir="$(WASM_DIR)/bundler" -- $(FRONTEND_WASM_FLAGS)
.PHONY: build-wasm-bundler
build-wasm-nodejs:
$(WASM_PACK_BUILD) --target=nodejs --out-dir="$(WASM_DIR)/nodejs" -- $(FRONTEND_WASM_FLAGS)
.PHONY: build-wasm-nodejs
build-wasm-web:
$(WASM_PACK_BUILD) --target=web --out-dir="$(WASM_DIR)/web" -- $(FRONTEND_WASM_FLAGS)
.PHONY: build-wasm-web
build-wasm: build-wasm-bundler build-wasm-nodejs build-wasm-web
.PHONY: build-wasm
build: build-rust build-binary build-c build-python build-wasm
.PHONY: build
build-ffmpeg: build-ffmpeg-rust build-ffmpeg-binary build-ffmpeg-c build-ffmpeg-python
.PHONY: build-ffmpeg
# ===================================================================
# build-ex ==========================================================
# ===================================================================
build-ex-rust-decode:
$(CARGO_BUILD) $(FRONTEND_RUST_FLAGS) --example=decode
.PHONY: build-ex-rust-decode
build-ex-rust-resampler:
$(CARGO_BUILD) $(FRONTEND_RUST_FLAGS) --example=resampler_comparison
.PHONY: build-ex-rust-resampler
build-ex-c-decode: build-c
mkdir -p "$(CARGO_TARGET_PROFILE_DIR)/examples-c/"
$(CC) -Wall -o "$(CARGO_TARGET_PROFILE_DIR)/examples-c/decode" examples-c/decode.c "$(FRONTEND_C_LIB)" $(shell cat ${SHARED_LIB_NATIVE_FLAGS})
.PHONY: build-ex-c-decode
build-ex-wasm-decode: build-wasm-web
mkdir -p "$(CARGO_TARGET_PROFILE_DIR)/examples-wasm/decode"
cd examples-wasm/decode/ && $(NPM) rebuild && $(NPM) install && ./node_modules/.bin/webpack
.PHONY: build-ex-wasm-decode
build-ex: build-ex-rust-decode build-ex-rust-resampler build-ex-c-decode build-ex-wasm-decode
.PHONY: build-ex
# ===================================================================
# run-ex ============================================================
# ===================================================================
run-ex-rust-decode:
$(CARGO_RUN) $(FRONTEND_RUST_FLAGS) --example=decode
.PHONY: run-ex-rust-decode
run-ex-rust-resampler:
$(CARGO_RUN) $(FRONTEND_RUST_FLAGS) --example=resampler_comparison
.PHONY: run-ex-rust-resampler
run-ex-c-decode: build-ex-c-decode
"$(CARGO_TARGET_PROFILE_DIR)/examples-c/decode"
.PHONY: run-ex-c-decode
run-ex-wasm-decode: build-wasm-web
mkdir -p "$(CARGO_TARGET_PROFILE_DIR)/examples-wasm/decode"
cd examples-wasm/decode/ && $(NPM) rebuild && $(NPM) install && ./node_modules/.bin/webpack
.PHONY: run-ex-wasm-decode
run-ex: run-ex-rust-decode run-ex-rust-resampler run-ex-c-decode run-ex-wasm-decode
.PHONY: run-ex
# ===================================================================
# docs ==============================================================
# ===================================================================
docs-sphinx: clean-docs .b/init-python-docs .b/init-npm-dev build-c-header build-ffmpeg-python build-wasm-bundler
mkdir docs/build
$(DOXYGEN)
$(PIP_INSTALL_FFMPEG_WHEEL) && PATH="$(PATH):$(NODE_BIN)" $(SPHINX_BUILD) -M dirhtml docs/source docs/build
.PHONY: docs-sphinx
docs-rustdoc:
$(CARGO) doc --no-deps $(PROFILE_FLAG) $(FRONTEND_FFMPEG_RUST_FLAGS)
.PHONY: docs-rustdoc
docs: docs-sphinx docs-rustdoc
.PHONY: docs
# ===================================================================
# deploy-docs =======================================================
# ===================================================================
deploy-docs-sphinx-netlify-draft: docs-sphinx
$(NETLIFY) deploy --dir=docs/build/dirhtml
.PHONY: deploy-docs-sphinx-netlify-draft
deploy-docs-sphinx-netlify-prod: docs-sphinx
$(NETLIFY) deploy --prod --dir=docs/build/dirhtml
.PHONY: deploy-docs-sphinx-netlify-prod
# ===================================================================
# test ==============================================================
# ===================================================================
test-c: build-c
$(CC) -g -Wall -Werror=unused-function -o "$(CARGO_TARGET_PROFILE_DIR)/test-c" tests-c/test.c "$(FRONTEND_C_LIB)"
"$(CARGO_TARGET_PROFILE_DIR)/test-c"
.PHONY: test-c
test-ffmpeg-c: build-ffmpeg-c
$(CC) -g -Wall -Werror=unused-function -o $(CARGO_TARGET_PROFILE_DIR)/test-ffmpeg-c tests-c/test.c "$(FRONTEND_FFMPEG_C_LIB)"
"$(CARGO_TARGET_PROFILE_DIR)/test-ffmpeg-c"
.PHONY: test-ffmpeg-c
test-rust:
$(CARGO_TEST) $(FRONTEND_RUST_FLAGS)
.PHONY: test-rust
test-ffmpeg-rust:
$(CARGO_TEST) $(FRONTEND_FFMPEG_RUST_FLAGS)
.PHONY: test-ffmpeg-rust
test-python: .b/init-python-dev build-python
$(PIP_INSTALL_WHEEL) && $(PYTEST)
.PHONY: test-python
test-ffmpeg-python: .b/init-python-dev build-ffmpeg-python
$(PIP_INSTALL_FFMPEG_WHEEL) && $(PYTEST)
.PHONY: test-ffmpeg-python
test-python-manylinux: .b/init-python-dev build-python-manylinux
$(PIP_INSTALL_MANYLINUX_WHEEL) && $(PYTEST)
.PHONY: test-python-manylinux
test-wasm-nodejs: build-wasm-nodejs .b/init-npm-test
cd tests-wasm-nodejs && $(NPM) run test
.PHONY: test-wasm-nodejs
test: test-rust test-python test-c test-wasm-nodejs
.PHONY: test
test-ffmpeg: test-ffmpeg-rust test-ffmpeg-python test-ffmpeg-c
.PHONY: test-ffmpeg
# ===================================================================
# doctest ===========================================================
# ===================================================================
doctest-python: build-ffmpeg-python
$(PIP_INSTALL_FFMPEG_WHEEL) && $(PYTEST) tests-python/test_doctests.py
doctest-rust:
$(CARGO_TEST) $(FRONTEND_FFMPEG_RUST_FLAGS) --doc
doctest: doctest-rust doctest-python
.PHONY: doctest doctest-rust doctest-python