diff options
author | Marvin Borner | 2020-07-22 16:32:32 +0200 |
---|---|---|
committer | Marvin Borner | 2020-07-22 16:32:32 +0200 |
commit | 5121d4bc820b39901461c759a8fbd57d3a8462e3 (patch) | |
tree | 467775459de88994df48bcaeaed9b39d7703a6e4 /Makefile | |
parent | 881a837adb930a0a3316ab57da95d46c1943f3f1 (diff) |
Switched to Makefile.
Kinda for the sake of minimalism
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c25895f --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +COBJS = src/main.o \ + src/drivers/vesa.o +CC = cross/opt/bin/i686-elf-gcc +LD = cross/opt/bin/i686-elf-ld +AS = nasm + +CFLAGS = -Wall -Wextra -nostdlib -nostdinc -ffreestanding -std=c99 -pedantic-errors -Isrc/lib/ -Isrc/inc/ -c + +all: compile clean + +%.o: %.c + $(CC) $(CFLAGS) $< -o $@ + +kernel: $(COBJS) + +compile: kernel + mkdir -p build/ + $(AS) -f bin src/entry.asm -o build/boot.bin + $(LD) -N -emain -Ttext 0x00050000 -o build/kernel.bin $(COBJS) --oformat binary + +clean: + find src/ -name "*.o" -type f -delete |