mirror of
https://github.com/tailix/kernel.git
synced 2024-11-20 11:16:10 -05:00
21 lines
314 B
Makefile
21 lines
314 B
Makefile
|
CCPREFIX = i686-elf-
|
||
|
|
||
|
AS = $(CCPREFIX)as
|
||
|
CC = $(CCPREFIX)gcc
|
||
|
|
||
|
OBJS = boot.s.o main.c.o
|
||
|
|
||
|
all: kernel
|
||
|
|
||
|
clean:
|
||
|
rm kernel $(OBJS)
|
||
|
|
||
|
kernel: $(OBJS)
|
||
|
$(CC) -T linker.ld -o $@ -ffreestanding -nostdlib -O2 -lgcc $(OBJS)
|
||
|
|
||
|
%.c.o: %.c
|
||
|
$(CC) -c $< -o $@ -std=c99 -ffreestanding -O2 -Wall -Wextra
|
||
|
|
||
|
%.s.o: %.s
|
||
|
$(AS) $< -o $@
|