-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjustfile
More file actions
96 lines (72 loc) · 2.26 KB
/
justfile
File metadata and controls
96 lines (72 loc) · 2.26 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
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
# Default recipe
default: build
# Build directory
build_dir := "build"
# Setup meson build directory
setup:
meson setup {{build_dir}}
# Setup with debug build type
setup-debug:
meson setup {{build_dir}} --buildtype=debug
# Setup with release build type
setup-release:
meson setup {{build_dir}} --buildtype=release
# Build the project
build: setup
meson compile -C {{build_dir}}
# Rebuild from scratch
rebuild: clean setup build
# Clean build artifacts
clean:
rm -rf {{build_dir}}
# Install binaries
install: build
meson install -C {{build_dir}}
# Run ecm encoder
run-ecm *args:
{{build_dir}}/ecm {{args}}
# Run unecm decoder
run-unecm *args:
{{build_dir}}/unecm {{args}}
# Show project info
info:
meson introspect {{build_dir}} --projectinfo
# Show all targets
targets:
meson introspect {{build_dir}} --targets
# Configure with different C standard (e.g., just configure-std c11)
configure-std std:
meson configure {{build_dir}} -Dc_std={{std}}
# Reconfigure existing build
reconfigure:
meson setup {{build_dir}} --reconfigure
# Wipe and reconfigure
wipe:
meson setup {{build_dir}} --wipe
# Format source files (requires clang-format)
fmt:
clang-format -i src/*.c include/*.h tests/*.c
# Check formatting without modifying
fmt-check:
clang-format --dry-run --Werror src/*.c include/*.h tests/*.c
# Run clang static analyzer
analyze:
clang --analyze -std=c2x -Xanalyzer -analyzer-output=text -I include -I {{build_dir}} src/ecm.c src/unecm.c
# Setup with Address Sanitizer
setup-asan:
meson setup {{build_dir}} --buildtype=debug -Db_sanitize=address
# Run ecm with Address Sanitizer (build with setup-asan first)
asan-ecm *args:
{{build_dir}}/ecm {{args}}
# Run unecm with Address Sanitizer (build with setup-asan first)
asan-unecm *args:
{{build_dir}}/unecm {{args}}
# Run valgrind memory check on ecm (Linux only)
valgrind-ecm *args:
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes {{build_dir}}/ecm {{args}}
# Run valgrind memory check on unecm (Linux only)
valgrind-unecm *args:
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes {{build_dir}}/unecm {{args}}
# Run performance benchmarks
benchmark: build
meson test -C {{build_dir}} perf_benchmark --verbose