Skip to content

Commit d99838a

Browse files
committed
chore: simplify makefile
1 parent 42adb6b commit d99838a

File tree

2 files changed

+20
-52
lines changed

2 files changed

+20
-52
lines changed

Makefile

Lines changed: 15 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,36 @@
1-
.DEFAULT_GOAL := help
2-
3-
VERSION := $(shell git describe --tags --always --dirty="-dev")
41
SHELL := /bin/bash
52
WRAPPER := scripts/env_wrapper.sh
63

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
285

296
# Default target
307
all: build
318

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-
409
# 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
4314

4415
# 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
4920

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:
5223
@if [ ! -f build/tdx-debian.efi ]; then \
5324
echo "Error: build/tdx-debian.efi not found. Run 'make build' first."; \
5425
exit 1; \
5526
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
5728
echo "Measurements exported to build/measurements.json"
5829

59-
# Clean build artifacts
60-
clean: ## Remove cache and build artifacts
30+
# Remove cache and build artifacts
31+
clean:
6132
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 \
6334
echo "Stopping and deleting lima VM 'tee-builder'..."; \
6435
limactl stop tee-builder || true; \
6536
limactl delete tee-builder || true; \

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,13 @@ Install lima:
3434
brew install lima
3535
```
3636

37-
Now build in the container:
37+
After dependencies are installed, you can start a build using
38+
`env_wrapper.sh`, optionally using the Azure, GCP, or devtools profile.
3839

3940
```
40-
make build IMAGE=tdx-dummy
41-
```
42-
43-
To build with development tools:
44-
45-
```
46-
make build-dev IMAGE=tdx-dummy
41+
scripts/check_perms.sh
42+
scripts/setup_deps.sh
43+
scripts/env_wrapper.sh mkosi --force --profile=gcp -I tdx-dummy.conf
4744
```
4845

4946
## Adding Files to Modules

0 commit comments

Comments
 (0)