-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
122 lines (107 loc) · 4.95 KB
/
Makefile
File metadata and controls
122 lines (107 loc) · 4.95 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# AetherOS Top-Level Build System
#
# Targets:
# all Build all userspace components
# kernel Download, patch, and compile the PREEMPT_RT kernel
# modules Build out-of-tree kernel modules (ntsync, wl-bridge)
# compositor Build aether-comp Wayland compositor
# enclave Build aether-enclave Rust manager
# crypto Build pam_bitlocker PAM module
# install Install all components (requires root)
# clean Remove build artifacts
SHELL := /bin/bash
BUILD_DIR := $(CURDIR)/build
PREFIX ?= /opt/aetheros
JOBS ?= $(shell nproc)
.PHONY: all kernel modules compositor enclave crypto install clean help
all: modules compositor enclave crypto
# ------------------------------------------------------------------ #
# Kernel #
# ------------------------------------------------------------------ #
kernel:
@echo ">>> Building PREEMPT_RT kernel..."
JOBS=$(JOBS) bash kernel/scripts/build-kernel.sh
# ------------------------------------------------------------------ #
# Out-of-tree kernel modules #
# ------------------------------------------------------------------ #
modules: modules-ntsync modules-wl-bridge
modules-ntsync:
@echo ">>> Building ntsync module..."
$(MAKE) -C modules/ntsync
modules-wl-bridge:
@echo ">>> Building aether-wl-bridge module..."
$(MAKE) -C enclave/virtio-wl
# ------------------------------------------------------------------ #
# Aether Compositor #
# ------------------------------------------------------------------ #
compositor:
@echo ">>> Building Aether Compositor..."
cmake -B $(BUILD_DIR)/aether-comp \
-S compositor/aether-comp \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=$(PREFIX)
$(MAKE) -C $(BUILD_DIR)/aether-comp -j$(JOBS)
# ------------------------------------------------------------------ #
# Enclave Manager (Rust) #
# ------------------------------------------------------------------ #
enclave:
@echo ">>> Building Aether Enclave Manager..."
cargo build --release --manifest-path enclave/manager/Cargo.toml
# ------------------------------------------------------------------ #
# BitLocker PAM module #
# ------------------------------------------------------------------ #
crypto:
@echo ">>> Building BitLocker/LUKS2 PAM module..."
$(MAKE) -C crypto/bitlocker-pam
# ------------------------------------------------------------------ #
# Install #
# ------------------------------------------------------------------ #
install:
@echo ">>> Installing AetherOS (requires root)..."
sudo bash installer/install.sh
# ------------------------------------------------------------------ #
# FEX-Emu binfmt setup (ARM64 only) #
# ------------------------------------------------------------------ #
fex-setup:
@echo ">>> Registering FEX-Emu binfmt_misc handlers..."
sudo bash translation/fex/setup.sh
# ------------------------------------------------------------------ #
# TPM PCR seal #
# ------------------------------------------------------------------ #
tpm-seal:
@echo ">>> Sealing FVEK to TPM PCR policy..."
sudo bash bootloader/tpm/setup-pcr.sh
# ------------------------------------------------------------------ #
# Clean #
# ------------------------------------------------------------------ #
clean:
$(MAKE) -C modules/ntsync clean 2>/dev/null || true
$(MAKE) -C enclave/virtio-wl clean 2>/dev/null || true
$(MAKE) -C crypto/bitlocker-pam clean 2>/dev/null || true
rm -rf $(BUILD_DIR)
cargo clean --manifest-path enclave/manager/Cargo.toml 2>/dev/null || true
# ------------------------------------------------------------------ #
# Help #
# ------------------------------------------------------------------ #
help:
@echo ""
@echo "AetherOS Build System"
@echo "====================="
@echo ""
@echo "Targets:"
@echo " all Build all userspace components (default)"
@echo " kernel Build PREEMPT_RT Linux kernel"
@echo " modules Build ntsync + wl-bridge kernel modules"
@echo " compositor Build Aether Wayland compositor"
@echo " enclave Build CrosVM enclave manager (Rust)"
@echo " crypto Build BitLocker/LUKS2 PAM module"
@echo " fex-setup Register FEX-Emu binfmt_misc (ARM64)"
@echo " tpm-seal Seal FVEK to TPM 2.0 PCRs"
@echo " install Install all components (sudo)"
@echo " clean Remove all build artifacts"
@echo ""
@echo "Variables:"
@echo " PREFIX=$(PREFIX)"
@echo " JOBS=$(JOBS)"
@echo " ARCH=$(shell uname -m)"
@echo ""