-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (56 loc) · 1.72 KB
/
Copy pathMakefile
File metadata and controls
64 lines (56 loc) · 1.72 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
# Makefile — Ember Vulkan ICD
#
# Convenience wrapper around Meson build system.
# For full control, use Meson directly.
#
# Default target
.PHONY: help
help:
@echo "Ember Vulkan — available targets"
@echo ""
@echo " help Show this help message"
@echo " build Configure and build the project"
@echo " test Build and run tests"
@echo " install Install the ICD (requires sudo)"
@echo " clean Remove build artifacts"
@echo " distclean Full clean (removes builddir)"
@echo " re Clean + build (rebuild from scratch)"
@echo " format Check C code formatting with clang-format"
@echo ""
BUILDDIR ?= builddir
.PHONY: build
build:
@echo "==> Configuring with Meson..."
@test -d $(BUILDDIR) || meson setup $(BUILDDIR)
@echo "==> Building..."
meson compile -C $(BUILDDIR)
.PHONY: test
test: build
@echo "==> Running tests..."
LD_LIBRARY_PATH=$(BUILDDIR) ./$(BUILDDIR)/ember_info
.PHONY: install
install:
@echo "==> Installing Ember Vulkan ICD..."
sudo meson install -C $(BUILDDIR)
.PHONY: clean
clean:
@echo "==> Cleaning build artifacts..."
@test -d $(BUILDDIR) && meson compile -C $(BUILDDIR) --clean || true
@echo "Done."
.PHONY: distclean
distclean:
@echo "==> Removing build directory..."
rm -rf $(BUILDDIR)
@echo "Done."
.PHONY: re
re: distclean build
@echo "Rebuild complete."
.PHONY: format
format:
@echo "==> Checking C code formatting..."
@if command -v clang-format >/dev/null 2>&1; then \
clang-format --dry-run --Werror src/*.c src/*/*.c src/*/*.h include/*/*.h 2>/dev/null || \
echo "Some files need formatting. Run: clang-format -i src/*.c src/*/*.c src/*/*.h include/*/*.h"; \
else \
echo "clang-format not installed. Install it with: sudo pacman -S clang"; \
fi