Reorganize Makefile
This commit is contained in:
parent
3427ec187b
commit
7b91b68403
1 changed files with 7 additions and 7 deletions
14
Makefile
14
Makefile
|
@ -1,15 +1,15 @@
|
||||||
|
run_bootloader: compile_bootloader
|
||||||
|
qemu-system-i386 -drive format=raw,file=target/boot.bin -monitor stdio
|
||||||
|
|
||||||
run_kernel: compile_kernel
|
run_kernel: compile_kernel
|
||||||
qemu-system-i386 -kernel target/kernel.bin
|
qemu-system-i386 -kernel target/kernel.bin
|
||||||
|
|
||||||
compile_kernel:
|
|
||||||
nasm -felf32 kernel/boot.asm -o target/boot.o
|
|
||||||
i686-elf-gcc -c kernel/kernel.c -o target/kernel.o -std=gnu99 -ffreestanding -O2 -Wall -Wextra
|
|
||||||
i686-elf-gcc -T kernel/linker.ld -o target/kernel.bin -ffreestanding -O2 -nostdlib target/boot.o target/kernel.o -lgcc
|
|
||||||
|
|
||||||
compile_bootloader: compile_kernel
|
compile_bootloader: compile_kernel
|
||||||
rm -rf target/bootloader.bin
|
rm -rf target/bootloader.bin
|
||||||
nasm -f bin -o target/bootloader.bin bootloader/main.asm
|
nasm -f bin -o target/bootloader.bin bootloader/main.asm
|
||||||
cat target/bootloader.bin target/kernel.bin > target/boot.bin
|
cat target/bootloader.bin target/kernel.bin > target/boot.bin
|
||||||
|
|
||||||
run_bootloader: compile_bootloader
|
compile_kernel:
|
||||||
qemu-system-i386 -drive format=raw,file=target/boot.bin -monitor stdio
|
nasm -felf32 kernel/boot.asm -o target/boot.o
|
||||||
|
i686-elf-gcc -c kernel/kernel.c -o target/kernel.o -std=gnu99 -ffreestanding -O2 -Wall -Wextra
|
||||||
|
i686-elf-gcc -T kernel/linker.ld -o target/kernel.bin -ffreestanding -O2 -nostdlib target/boot.o target/kernel.o -lgcc
|
||||||
|
|
Loading…
Reference in a new issue