1
0
Fork 0
Redox-From-Scratch/Makefile

41 lines
785 B
Makefile
Raw Permalink Normal View History

2024-12-11 18:21:14 -08:00
BUILD_DIR=./build
2024-12-12 07:14:44 -08:00
export QEMU?=qemu-system-x86_64
2024-12-11 18:21:14 -08:00
2024-12-16 20:50:27 -08:00
TOOLCHAIN = $(CURDIR)/tools/bin/x86_64-unknown-redox/toolchain
export PATH := $(TOOLCHAIN)/bin:$(PATH)
export CARGO := $(TOOLCHAIN)/bin/cargo
2024-12-12 08:53:55 -08:00
# Default rule
.PHONY: default
default: bios
2024-12-11 18:21:14 -08:00
2024-12-12 08:53:55 -08:00
# Remove all build files
2024-12-12 07:14:44 -08:00
.PHONY: clean
2024-12-11 18:21:14 -08:00
clean:
2024-12-12 07:14:44 -08:00
rm -drf $(BUILD_DIR)
cd bootloader; cargo clean
2024-12-12 08:53:55 -08:00
# Make _everything_
.PHONY: all
all: bios
# Make bios bootloader
.PHONY: bios
bios: $(BUILD_DIR)/bios.bin $(BUILD_DIR)/bios.img
2024-12-12 07:14:44 -08:00
qemu: $(BUILD_DIR)/bios.img
$(QEMU) \
-d cpu_reset \
-no-reboot \
-smp 4 -m 2048 \
-chardev stdio,id=debug,signal=off,mux=on \
-serial chardev:debug \
-mon chardev=debug \
-machine q35 \
-net none \
-enable-kvm \
-cpu host \
-drive file="$<",format=raw
2024-12-12 07:26:17 -08:00
include make/filesystem
2024-12-12 07:14:44 -08:00
include make/bios