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

46 lines
883 B
Makefile
Raw Normal View History

2017-11-04 02:40:46 -04:00
AS = $(CCPREFIX)as
CC = $(CCPREFIX)gcc
# Architecture-dependent
2017-11-03 22:14:28 -04:00
OBJS = start.s.o
2017-11-03 22:15:05 -04:00
OBJS += init.c.o
2017-11-04 08:19:51 -04:00
OBJS += multiboot.c.o
2017-11-05 01:56:29 -05:00
OBJS += memory.c.o
2017-11-04 10:43:07 -04:00
OBJS += paging.c.o paging.asm.cpp.o
# Architecture-independent
OBJS += info.c.o
2017-11-03 22:32:23 -04:00
OBJS += main.c.o
2017-11-03 22:13:30 -04:00
2017-11-04 01:31:37 -04:00
OBJS += logger.c.o
OBJS += console.c.o
OBJS += kprintf.c.o
2017-11-02 22:22:19 -04:00
OBJS += protected.c.o protected.asm.cpp.o
2017-11-02 22:27:21 -04:00
OBJS += exception.c.o exception.asm.cpp.o
2017-11-02 22:51:24 -04:00
OBJS += hwint.c.o hwint.asm.cpp.o
2017-11-05 04:50:04 -05:00
OBJS += syscall.c.o syscall.asm.cpp.o
2017-11-01 05:20:44 -04:00
2017-11-03 00:19:48 -04:00
OBJS += timer.c.o
2017-11-01 00:53:54 -04:00
all: kernel
clean:
2017-11-01 01:01:29 -04:00
rm -f kernel $(OBJS)
2017-11-01 00:53:54 -04:00
kernel: $(OBJS)
2017-11-04 02:04:04 -04:00
$(CC) -T linker.ld -o $@ -ffreestanding -nostdlib -lgcc $(OBJS) $(LIBK)
2017-11-01 04:53:27 -04:00
grub-file --is-x86-multiboot2 $@
2017-11-01 00:53:54 -04:00
%.c.o: %.c
2017-11-04 03:43:03 -04:00
$(CC) -c $< -o $@ -std=gnu99 -ffreestanding -nostdinc -fno-builtin -fno-stack-protector -Wall -Wextra -I "$(INCLUDE)"
2017-11-01 00:53:54 -04:00
%.s.o: %.s
$(AS) $< -o $@
2017-11-01 01:26:22 -04:00
2017-11-02 12:01:00 -04:00
%.asm.cpp.o: %.asm.cpp
nasm -felf -o $@ $<
%.asm.cpp: %.asm
cpp -P $< $@