1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2025-02-24 15:55:41 -05:00
kernel/arch/Makefile

25 lines
523 B
Makefile
Raw Normal View History

2017-11-01 04:53:54 +00:00
CCPREFIX = i686-elf-
AS = $(CCPREFIX)as
CC = $(CCPREFIX)gcc
OBJS = boot.s.o main.c.o logger.c.o console.c.o gdt.c.o idt.c.o isr.c.o isr.asm.o multiboot.c.o protected.asm.o
2017-11-01 09:20:44 +00:00
2017-11-01 04:53:54 +00:00
all: kernel
clean:
2017-11-01 05:01:29 +00:00
rm -f kernel $(OBJS)
2017-11-01 04:53:54 +00:00
kernel: $(OBJS)
2017-11-01 06:42:30 +00:00
$(CC) -T linker.ld -o $@ -ffreestanding -nostdlib -lgcc $(OBJS)
2017-11-01 08:53:27 +00:00
grub-file --is-x86-multiboot2 $@
2017-11-01 04:53:54 +00:00
%.c.o: %.c
2017-11-02 03:38:06 +00:00
$(CC) -c $< -o $@ -std=gnu99 -ffreestanding -nostdinc -fno-builtin -fno-stack-protector -Wall -Wextra -I "$(I)"
2017-11-01 04:53:54 +00:00
%.s.o: %.s
$(AS) $< -o $@
2017-11-01 05:26:22 +00:00
%.asm.o: %.asm
nasm -felf -o $@ $<