-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (53 loc) · 1.72 KB
/
Makefile
File metadata and controls
70 lines (53 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
65
66
67
68
69
70
.PHONY: build build-unsigned test install clean lint sign kernel rootfs claude-rootfs artifacts all
BINARY_NAME=faize
VERSION=$(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS=-ldflags "-X main.version=$(VERSION)"
ENTITLEMENTS=faize.entitlements
UNAME_S=$(shell uname -s)
ARTIFACTS_DIR=$(HOME)/.faize/artifacts
# Build and sign (macOS gets entitlements for Virtualization.framework)
build: build-unsigned sign
# Build without signing (for CI or cross-compilation)
build-unsigned:
go build $(LDFLAGS) -o $(BINARY_NAME) ./cmd/faize
# Sign with entitlements (macOS only, no-op on other platforms)
sign:
ifeq ($(UNAME_S),Darwin)
@echo "Signing $(BINARY_NAME) with virtualization entitlements..."
codesign --entitlements $(ENTITLEMENTS) --force -s - $(BINARY_NAME)
else
@echo "Skipping code signing (not on macOS)"
endif
test:
go test -v ./...
install: build
cp $(BINARY_NAME) $(GOPATH)/bin/$(BINARY_NAME) 2>/dev/null || cp $(BINARY_NAME) ~/go/bin/$(BINARY_NAME)
ifeq ($(UNAME_S),Darwin)
@echo "Note: Installed binary may need re-signing. Run 'make sign' in install location if needed."
endif
clean:
rm -f $(BINARY_NAME)
go clean
lint:
golangci-lint run ./...
# Development helpers
dev: build
./$(BINARY_NAME) --help
run: build
./$(BINARY_NAME) --debug --minimal-test --project /tmp
fmt:
go fmt ./...
vet:
go vet ./...
# Artifact targets
kernel:
@mkdir -p $(ARTIFACTS_DIR)
bash scripts/build-kernel.sh 6.6.10 "" $(ARTIFACTS_DIR)/vmlinux
rootfs:
@mkdir -p $(ARTIFACTS_DIR)
bash scripts/build-rootfs.sh $(ARTIFACTS_DIR)/rootfs.img
claude-rootfs:
@mkdir -p $(ARTIFACTS_DIR)
bash scripts/build-claude-rootfs.sh $(ARTIFACTS_DIR)/claude-rootfs.img
artifacts: kernel claude-rootfs
all: build artifacts