summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 18 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 4df65dd..8f4b284 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,24 @@
+FILLES = ./build/kernel.asm.o
+
BOOTLOADER=./src/boot/bootloader.asm
TARGET=./bin/boot.bin
-all:
+all: ./bin/boot.bin ./bin/kernel.bin
+ rm -rf ./bin/os.bin
+ dd if=./bin/boot.bin >> ./bin/os.bin
+ dd if=./bin/kernel.bin >> ./bin/os.bin
+ dd if=/dev/zero bs=512 count=100 >> ./bin/os.bin
+./bin/kernel.bin: ./build/kernel.asm.o
+ i686-elf-ld -g -relocatable ./build/kernel.asm.o -o ./build/cemOS.o
+ i686-elf-gcc -T ./src/linker.ld -o ./bin/kernel.bin -ffreestanding -O0 -nostdlib ./build/cemOS.o
+
+./bin/boot.bin: ./src/boot/bootloader.asm
nasm -f bin $(BOOTLOADER) -o $(TARGET)
+
+./build/kernel.asm.o: ./src/kernel.asm
+ nasm -f elf -g ./src/kernel.asm -o ./build/kernel.asm.o
+
clean:
rm -f $(TARGET)
+ rm -f build/cemOS.o
+ rm -f build/kernel.asm.o