summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile22
1 files changed, 9 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 9f03f93..1fc4194 100644
--- a/Makefile
+++ b/Makefile
@@ -4,10 +4,10 @@ export TARGET=x86_64-unknown-uefi
4export PROFILE=debug 4export PROFILE=debug
5export OUT_DIR=target/$(TARGET)/$(PROFILE) 5export OUT_DIR=target/$(TARGET)/$(PROFILE)
6export ESP_DIR=esp 6export ESP_DIR=esp
7export KERNEL=$(OUT_DIR)/raisernics.efi 7export KERNEL=$(OUT_DIR)/rsdos.efi
8export BZIMAGE=$(ESP_DIR)/bzImage 8export BZIMAGE=$(ESP_DIR)/bzImage
9export INITRD=$(ESP_DIR)/initramfs.cpio.gz 9export INITRD=$(ESP_DIR)/initramfs.cpio.gz
10export BOOTLOADER=../rng/rsbl/../build/bootloader/BOOTX64.EFI 10export BOOTLOADER=rsboot/rsboot.efi
11export OVMF=/usr/share/edk2/x64/OVMF.4m.fd 11export OVMF=/usr/share/edk2/x64/OVMF.4m.fd
12export BOOT_EFI=$(ESP_DIR)/EFI/BOOT/BOOTX64.EFI 12export BOOT_EFI=$(ESP_DIR)/EFI/BOOT/BOOTX64.EFI
13 13
@@ -15,7 +15,7 @@ export BOOT_EFI=$(ESP_DIR)/EFI/BOOT/BOOTX64.EFI
15 15
16# ---- Build --------------------------------------------------------------- 16# ---- Build ---------------------------------------------------------------
17 17
18all: $(BZIMAGE) $(INITRD) $(BOOT_EFI) 18all: $(BZIMAGE) $(INITRD)
19 19
20release: PROFILE=release 20release: PROFILE=release
21release: export PROFILE=release 21release: export PROFILE=release
@@ -26,16 +26,12 @@ release: all
26# shellcheck disable=SC2034 26# shellcheck disable=SC2034
27CARGO_FLAGS= 27CARGO_FLAGS=
28 28
29$(OUT_DIR)/raisernics.efi: $(shell find src -name '*.rs') Cargo.toml build.rs 29$(OUT_DIR)/rsdos.efi: $(shell find rsnix shell rsdos -name '*.rs') Cargo.toml rsnix/Cargo.toml shell/Cargo.toml rsdos/Cargo.toml
30 cargo build --target $(TARGET) $(CARGO_FLAGS) 30 cargo build --package rsdos --target $(TARGET) $(CARGO_FLAGS)
31 31
32$(BZIMAGE): $(KERNEL) | $(ESP_DIR) 32$(BZIMAGE): $(KERNEL) | $(ESP_DIR)
33 cp "$<" "$@" 33 cp "$<" "$@"
34 34
35$(BOOT_EFI): $(BOOTLOADER) | $(ESP_DIR)
36 mkdir -p $(ESP_DIR)/EFI/BOOT
37 cp "$<" "$@"
38
39$(ESP_DIR): 35$(ESP_DIR):
40 mkdir -p $(ESP_DIR) 36 mkdir -p $(ESP_DIR)
41 37
@@ -95,7 +91,7 @@ run-image: all
95# ---- Disk image ---------------------------------------------------------- 91# ---- Disk image ----------------------------------------------------------
96 92
97image: all 93image: all
98 ./tools/boot-image.sh raisernics.img 94 ./tools/boot-image.sh rs-dos.img
99 95
100# ---- Utilities ----------------------------------------------------------- 96# ---- Utilities -----------------------------------------------------------
101 97
@@ -104,14 +100,14 @@ fmt:
104 100
105clean: 101clean:
106 cargo clean 102 cargo clean
107 rm -rf $(ESP_DIR) raisernics.img 103 rm -rf $(ESP_DIR) rs-dos.img
108 104
109help: 105help:
110 @echo "raisernics — Make targets" 106 @echo "rs-dos — Make targets"
111 @echo "" 107 @echo ""
112 @echo " make build kernel + ESP (default)" 108 @echo " make build kernel + ESP (default)"
113 @echo " make release build with --release (smaller binary)" 109 @echo " make release build with --release (smaller binary)"
114 @echo " make image create bootable USB image (raisernics.img)" 110 @echo " make image create bootable USB image (rs-dos.img)"
115 @echo " make run QEMU serial console (no graphics)" 111 @echo " make run QEMU serial console (no graphics)"
116 @echo " make run-gui QEMU with graphical window (GOP/PS2)" 112 @echo " make run-gui QEMU with graphical window (GOP/PS2)"
117 @echo " make debug QEMU + GDB stub on :1234" 113 @echo " make debug QEMU + GDB stub on :1234"