25 lines
685 B
Makefile
25 lines
685 B
Makefile
all: build/kernel-i386.elf
|
|
clean:
|
|
-@rm build/* 2> /dev/null || true
|
|
|
|
build/kernel-i386.elf: src/* build/
|
|
tcc -m32 -nostdlib -Wl,-Ttext,0x100000 -o build/kernel-i386.elf src/start32.s src/*.c
|
|
image: build/kernel-i386.elf mount
|
|
cp build/kernel-i386.elf mnt/roska/start32.elf
|
|
sync
|
|
|
|
qemu-multiboot: build/kernel-i386.elf
|
|
qemu-system-i386 -kernel build/kernel-i386.elf -serial stdio
|
|
qemu-image: image
|
|
qemu-system-i386 roska.img -serial stdio
|
|
|
|
mount: roska.img mnt/
|
|
@if ! mountpoint -q "mnt/"; then \
|
|
sudo mount -o loop,offset=1048576,umask=177,dmask=022,uid=$(shell id -u),gid=$(shell id -g) roska.img mnt/; \
|
|
fi;
|
|
umount:
|
|
@sudo umount mnt
|
|
mnt/:
|
|
@mkdir mnt
|
|
build/:
|
|
@mkdir build
|