This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (52 loc) · 1.6 KB
/
Makefile
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
export ARCH ?= x86_64
export ROOT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
export BUILD_DIR ?= $(ROOT_DIR)/build
export SYSROOT_DIR ?= $(ROOT_DIR)/sysroot
export RELEASE_DIR ?= $(ROOT_DIR)/release
export GITREV := $(shell git rev-parse --short HEAD)
LIVECD := $(RELEASE_DIR)/aurix-$(GITREV)-livecd_$(ARCH).iso
LIVEHDD := $(RELEASE_DIR)/aurix-$(GITREV)-livehdd_$(ARCH).img
QEMU_FLAGS := -m 2G -smp 4 -serial stdio
.PHONY: boot
boot:
@printf ">>> Building bootloader...\n"
@$(MAKE) -C boot boot
@printf ">>> Building UEFI bootloader...\n"
@$(MAKE) -C boot uefi
.PHONY: kernel
kernel:
@printf ">>> Building kernel...\n"
@$(MAKE) -C kernel
.PHONY: install
install: boot kernel
@printf ">>> Building sysroot...\n"
@mkdir -p $(SYSROOT_DIR)
@$(MAKE) -C boot install
@$(MAKE) -C kernel install
ovmf:
@printf ">>> Downloading OVMF images...\n"
@utils/download-ovmf.sh
.PHONY: livecd
livecd: install
@printf ">>> Generating Live CD..."
@mkdir -p $(RELEASE_DIR)
@utils/arch/$(ARCH)/generate-iso.sh $(LIVECD)
.PHONY: livehdd
livehdd: install
@printf ">>> Generating Live HDD..."
@mkdir -p $(RELEASE_DIR)
@utils/arch/$(ARCH)/generate-hdd.sh $(LIVEHDD)
.PHONY: run
run: livecd
@printf ">>> Running QEMU...\n"
@qemu-system-$(ARCH) $(QEMU_FLAGS) $(QEMU_MACHINE_FLAGS) -cdrom $(LIVECD)
.PHONY: run-uefi
run-uefi: livecd ovmf
@printf ">>> Running QEMU (UEFI)...\n"
@qemu-system-$(ARCH) $(QEMU_FLAGS) $(QEMU_MACHINE_FLAGS) -bios ovmf/ovmf-$(ARCH).fd -cdrom $(LIVECD)
.PHONY: clean
clean:
@rm -rf $(BUILD_DIR) $(SYSROOT_DIR)
.PHONY: distclean
distclean:
@rm -rf $(BUILD_DIR) $(SYSROOT_DIR) $(RELEASE_DIR) ovmf/