summaryrefslogtreecommitdiff
path: root/Makefile
blob: 8f4b28473147aab84c8a5a5b689ecdf13e89bc6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FILLES = ./build/kernel.asm.o

BOOTLOADER=./src/boot/bootloader.asm
TARGET=./bin/boot.bin

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