|
1 | | -.DEFAULT_GOAL := help |
2 | | - |
3 | | -VERSION := $(shell git describe --tags --always --dirty="-dev") |
4 | 1 | SHELL := /bin/bash |
5 | 2 | WRAPPER := scripts/env_wrapper.sh |
6 | 3 |
|
7 | | -##@ Help |
8 | | - |
9 | | -# Awk script from https://github.com/paradigmxyz/reth/blob/main/Makefile |
10 | | -.PHONY: help |
11 | | -help: ## Display this help. |
12 | | - @awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) |
13 | | - |
14 | | -.PHONY: v |
15 | | -v: ## Show the version |
16 | | - @echo "Version: ${VERSION}" |
17 | | - |
18 | | -##@ Build |
19 | | - |
20 | | -build build-dev: check-module |
21 | | - |
22 | | -check-module: |
23 | | -ifndef IMAGE |
24 | | - $(error IMAGE is not set. Please specify IMAGE=<image> when running make build or make build-dev) |
25 | | -endif |
26 | | - |
27 | | -.PHONY: all build build-dev setup measure clean check-perms check-module |
| 4 | +.PHONY: all build build-dev measure clean |
28 | 5 |
|
29 | 6 | # Default target |
30 | 7 | all: build |
31 | 8 |
|
32 | | -# Ensure repo was cloned with correct permissions |
33 | | -check-perms: ## Check repository permissions |
34 | | - @scripts/check_perms.sh |
35 | | - |
36 | | -# Setup dependencies (Linux only) |
37 | | -setup: ## Install dependencies (Linux only) |
38 | | - @scripts/setup_deps.sh |
39 | | - |
40 | 9 | # Build module |
41 | | -build: check-perms setup ## Build the specified module |
42 | | - @$(WRAPPER) mkosi --force -I $(IMAGE).conf |
| 10 | +build: |
| 11 | + scripts/check_perms.sh |
| 12 | + scripts/setup_deps.sh |
| 13 | + $(WRAPPER) mkosi --force -I $(IMAGE).conf |
43 | 14 |
|
44 | 15 | # Build module with devtools profile |
45 | | -build-dev: check-perms setup ## Build module with development tools |
46 | | - @$(WRAPPER) mkosi --force --profile=devtools -I $(IMAGE).conf |
47 | | - |
48 | | -##@ Utilities |
| 16 | +build-dev: |
| 17 | + scripts/check_perms.sh |
| 18 | + scripts/setup_deps.sh |
| 19 | + $(WRAPPER) mkosi --force --profile=devtools -I $(IMAGE).conf |
49 | 20 |
|
50 | | -# Run measured-boot on the EFI file |
51 | | -measure: ## Export TDX measurements for the built image |
| 21 | +# Export TDX measurements for the built image |
| 22 | +measure: |
52 | 23 | @if [ ! -f build/tdx-debian.efi ]; then \ |
53 | 24 | echo "Error: build/tdx-debian.efi not found. Run 'make build' first."; \ |
54 | 25 | exit 1; \ |
55 | 26 | fi |
56 | | - @$(WRAPPER) measured-boot build/tdx-debian.efi build/measurements.json --direct-uki |
| 27 | + $(WRAPPER) measured-boot build/tdx-debian.efi build/measurements.json --direct-uki |
57 | 28 | echo "Measurements exported to build/measurements.json" |
58 | 29 |
|
59 | | -# Clean build artifacts |
60 | | -clean: ## Remove cache and build artifacts |
| 30 | +# Remove cache and build artifacts |
| 31 | +clean: |
61 | 32 | rm -rf build/ mkosi.builddir/ mkosi.cache/ lima-nix/ |
62 | | - @if command -v limactl >/dev/null 2>&1 && limactl list | grep -q '^tee-builder'; then \ |
| 33 | + if command -v limactl >/dev/null 2>&1 && limactl list | grep -q '^tee-builder'; then \ |
63 | 34 | echo "Stopping and deleting lima VM 'tee-builder'..."; \ |
64 | 35 | limactl stop tee-builder || true; \ |
65 | 36 | limactl delete tee-builder || true; \ |
|
0 commit comments