1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-10-30 12:03:52 -04:00
kernel/arch/Makefile
2017-11-03 02:22:57 +00:00

31 lines
591 B
Makefile

CCPREFIX = i686-elf-
AS = $(CCPREFIX)as
CC = $(CCPREFIX)gcc
OBJS = boot.s.o main.c.o
OBJS += logger.c.o console.c.o
OBJS += multiboot.c.o
OBJS += isr.c.o isr.asm.cpp.o
OBJS += protected.c.o protected.asm.cpp.o
all: kernel
clean:
rm -f kernel $(OBJS)
kernel: $(OBJS)
$(CC) -T linker.ld -o $@ -ffreestanding -nostdlib -lgcc $(OBJS)
grub-file --is-x86-multiboot2 $@
%.c.o: %.c
$(CC) -c $< -o $@ -std=gnu99 -ffreestanding -nostdinc -fno-builtin -fno-stack-protector -Wall -Wextra
%.s.o: %.s
$(AS) $< -o $@
%.asm.cpp.o: %.asm.cpp
nasm -felf -o $@ $<
%.asm.cpp: %.asm
cpp -P $< $@