Fix the makefile

This commit is contained in:
Baptiste Wicht 2013-12-02 15:57:06 +01:00
parent c3c0878d31
commit f9375a4c63
2 changed files with 15 additions and 10 deletions

View File

@ -1,23 +1,21 @@
.PHONY: default clean bootloader kernel micro_kernel force_look qemu bochs debug .PHONY: default clean force_look qemu bochs debug
default: bootloader micro_kernel kernel thor.flp default: thor.flp
bootloader: force_look bootloader/bootloader.bin: force_look
cd bootloader; $(MAKE) cd bootloader; $(MAKE)
micro_kernel: force_look micro_kernel/micro_kernel.bin: force_look
cd micro_kernel; $(MAKE) cd micro_kernel; $(MAKE)
kernel: force_look kernel/kernel.bin: force_look
cd kernel; $(MAKE) cd kernel; $(MAKE)
filler.bin: kernel/kernel.bin micro_kernel/micro_kernel.bin bootloader/stage1.bin bootloader/stage2.bin bootloader/padding.bin filler.bin: kernel/kernel.bin micro_kernel/micro_kernel.bin bootloader/bootloader.bin
bash fill.bash bash fill.bash
thor.flp: filler.bin thor.flp: filler.bin
cat bootloader/stage1.bin > thor.bin cat bootloader/bootloader.bin > thor.bin
cat bootloader/stage2.bin >> thor.bin
cat bootloader/padding.bin >> thor.bin
cat micro_kernel/micro_kernel.bin >> thor.bin cat micro_kernel/micro_kernel.bin >> thor.bin
cat kernel/kernel.bin >> thor.bin cat kernel/kernel.bin >> thor.bin
cat filler.bin >> thor.bin cat filler.bin >> thor.bin

View File

@ -1,4 +1,4 @@
default: stage1.bin stage2.bin padding.bin default: bootloader.bin
stage1.bin: stage1.asm stage1.bin: stage1.asm
nasm -w+all -f bin -o stage1.bin stage1.asm nasm -w+all -f bin -o stage1.bin stage1.asm
@ -9,6 +9,13 @@ stage2.bin: stage2.asm
padding.bin: padding.bin:
dd if=/dev/zero of=padding.bin bs=512 count=34 dd if=/dev/zero of=padding.bin bs=512 count=34
bootloader.bin: stage1.bin stage2.bin padding.bin
cat stage1.bin > bootloader.bin
cat stage2.bin >> bootloader.bin
cat padding.bin >> bootloader.bin
clean: clean:
rm -f stage1.bin rm -f stage1.bin
rm -f stage2.bin rm -f stage2.bin
rm -f padding.bin
rm -f bootloader.bin