diff options
Diffstat (limited to 'kernel/Makefile')
-rw-r--r-- | kernel/Makefile | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/Makefile b/kernel/Makefile new file mode 100644 index 0000000..7a29c9e --- /dev/null +++ b/kernel/Makefile @@ -0,0 +1,21 @@ + +AS = nasm +ASFLAGS = -felf + +CC = i586-elf-gcc +CFLAGS = -ffreestanding -O2 -std=gnu99 -Wall -Wextra -I ./include +LD = i586-elf-gcc +LDFLAGS = -T linker.ld -ffreestanding -O2 -nostdlib -lgcc + +OBJ = l0/loader.o l0/kmain.o + +all: kernel.bin + +kernel.bin: $(OBJ) + $(LD) $(LDFLAGS) -o $@ $^ + +%.o: %.s + $(AS) $(ASFLAGS) -o $@ $< + +%.o: %.c + $(CC) -c $< -o $@ $(CFLAGS) |